i don't see any feedback about my last suggestion.
Printable View
i don't see any feedback about my last suggestion.
No feedback as I have not tried yet. Sleep and work intervene. Although, after a few hours of reflection I think I understand what was happening as stated in my last response. Setting both projection and modelview to identity causes the gl_NormalMatrix to be identity. Makes sense. I think I ran into this trying to emulate OpenGLES on a desktop platform. Start started small and started moving to pure shader world with the side effects of the Desktop GL 'helping'.
That being said I also think my tangent and bi-tangent are incorrect as far as being in tangent space. I believe now, and always suspected, they are in object space. The calculation takes into account vertex and texture directions and makes some minor calculations. I believe the results are in object space. I have an addition piece I am not calling to calculate the inverse which should move to tangent space. With that I'm not sure what I'll gain by doing this. I'd then have to move the light and camera vectors into tangent space. Calculation already being preformed but for object space. Something I need to think about since normals on the map are in tangent space something has to give.
So ultimately I was calculating the normal matrix properly, the shaders were getting an identity so whatever I attempted to replace with made things worse. I think this specific shader requires some thought and rework but as it appears to be working I will work with it, unless someone see off-hand where the object/tangent space resides. It may be in the fragment shader since that’s where the normal is actually extracted.
Seems like I went from a 'how to compute normal matrix' to 'how to better emulate OpenGL ES and its lack of the fixed pipeline'.