I am trying to get into antialiasing in my shaders, but I don’t know if I understand this function. I understand that dfdx() and dfdy() return the derivative (slope) of a varying parameter in screen space.
But for example, what is the use of the following which appears in a shader I’m studying:
fwidth(fragmentWorldPosition.y)
Thanks for any help wrapping my brain around this.
Ah ha. That’s a simple plain language explanation. But I guess only time will let me get an intuitive understanding of what can be done with it. Your example of an edge detect is helpful.
There are really powerful effects that rely on this concept. I was looking at a blog where someone was doing ambient occlusion, liquids textures, etc… For me its just about basic antialiasing at this point.