Original Post
I finally made GLSL shader for normal mapping and I also want to use specular based on normal texture. My normal mapping works without problem and specular also works but has some bugs. I have glitch in specular in place where UV coordinates of same vertex differs. My friend told me that its well known common problem but he doesn't know how to solve it, so I am asking here. Best thing to do is simply show you what exactly I mean in picture (as reference model I used zombie head from turbosquid, this one was for free :) )
for calculating specular I am using well known formula vec4 spec = pow( max(dot(halfVector,normal),0.0) , specularPower ); I am sending tangent array to shader for every vertex based on crossproduct of triangle vertexes and UVs vectors. Am I missing something? Is there any way to solve this? Do I need to recalculate tangent in some other way for these vertexes? Thanks for answers [Edited by - SaTANO on February 17, 2010 1:34:19 PM]
for calculating specular I am using well known formula vec4 spec = pow( max(dot(halfVector,normal),0.0) , specularPower ); I am sending tangent array to shader for every vertex based on crossproduct of triangle vertexes and UVs vectors. Am I missing something? Is there any way to solve this? Do I need to recalculate tangent in some other way for these vertexes? Thanks for answers [Edited by - SaTANO on February 17, 2010 1:34:19 PM]
