View Single Post
  #7  
Old 06-24-2013, 10:37 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Thanks. I think the problem is with your normal map lookup code. The texture color values range from 0 to 1. However, the normals need to range from -1 to 1. Also, it appears the green channel in your normal map is flipped. Try modifying your normal map lookup to the following:
Code:
vec3 texNormal = normalize(texture2D(NormalMap, gl_TexCoord[0].xy).rgb * 2.0 - 1.0) * vec3(1.0,-1.0,1.0);
I tried running your shader with this modification and it appeared to render the normals correctly.
Reply With Quote