Visual Debugging
For my shader I need to calculate tangent space view directions - since in my case the tangent frame is constant over the entire surface, it is straightforward to do this in the vertex shader and let the hardware interpolate (linearly) over the surface. Of course this isn’t numerically exact, but I was wondering how badly.
So here’s a plot that compares the vertex shader calculations to the same thing done in the fragment shader; error values are exagerrated by a factor of 10. The bottom line is that if your shader looks fairly good close to the vertices but shows weird behaviour in other areas, chances are that it’s the linear interpolation that is getting at you.
No comments yet.