I'm doing some ray tracing on GPU using a fragment shader...
How can I calculate texture coordinates partial derivatives with respect to screen coordinates so I could perform filtered texture lookup with textureGrad
GLSL function?
Do I need to use ray differentials?
If yes, then how?
Example explaining derivatives calculation for ray-plane intersection (ray described using origin and direction normal vector, plane using one point laying on a plane and normal vector) would be nice, although pointers for general case would also be appreciated...