Surface curvature in fragment shader

hi everyone !

Is there a way to find the curvature of a surface being rendered at the fragment level (in the fragment shader) ?
In the fragment shader the only surface information i can access is the (interpolated)normal so it would be very helpfull to have access to the non-interpolated normal from the 3 vertex of the triangle in order to compute the curvature.

thx for any help

The best you can do is the dFdx() and dFdy() functions. They will tell you how much the normal will move over to the next fragment sample location, which might be enough for what you need.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.