NOTE: originally, what is labeled as “dFdy(t)” above, was mislabeled as “dFdx(t)”. Also, what is labeled as fragment sample point was previously labeled “f( s, t )”. I suppose that isn’t wrong per se, but I thought it wasn’t very clear, so I fixed it. You may have to refresh or clear cache to see the revision.
I am working on antialiasing a procedural texture. In order to do so, I am trying to understand how dFdx() and the y version work. I looked through the orange book, and the GLSL spec. Based on how I understand it currently, I have drawn in the image above. Can you let me know if I am understanding this correctly?
It is my understanding that dFdx() is not giving you a derivative ( which makes sense to me – how could the GL possibly derive that without knowing the texture function? ), but rather the distance in s ( for dFdx() ), or t ( for dFdy() ) to the next position there would be a sample in that direction, if offset by one pixel in the x, and y direction in the frame buffer.
How can you find out which direction these virtual samples are from the current fragment? Is that universal, or manufacturer dependent? Again, I may be mistaken in my understanding, but if it does work the way I am seeing it now, what happens when dFdx( t ) + t is no longer inside the primitive ( e.g. dFdx(t) + t < 0.0, or dFdx(t) + t > 1.0 )?
I may be misunderstanding how this function works. If so, I’d love to understand this, and will correct my drawing for the record.
Thanks!