   Parallax mapping problem, half of the result turns black
  Hi,trying to implement parallax mapping in GLSL following the guide on gamedev. I think I'm almost there.However my problem is that half my quad/result turns black and the other half is where the parallax is.No idea what the problem might be. I suspected it might be TBN but I can't see how.. now I'm suspecting something openGL specific..Anyone know what the problem might be?[Edited by - aelzor on May 29, 2010 4:30:18 AM]
  Hey,I think the problem is in your vertex shader code. I've had this same problem multiple times by having code in my vertex shader that scales or shifts the texture coordinates somehow, and when I keep implementing my fragment shader code I never remember this shift, and tend to get behaviour which only ends with my fragment shader being applied to half the quad. I'd check that first for errors.Here's code that should give you normal texture coord mapping:varying vec2 texCoord;void main(void){texCoord = gl_MultiTexCoord0;gl_Position = ftransform();};  Hi,This is my vertex shader. As you can see I use the functions mentioned above.varying vec2 v_texCoord;varying vec3 EyeDir, normal, lightDir, halfVector;varying vec4 ambientGlobal, ambient, diffuse;void main( void ){gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;vec3 ecPos = vec3(gl_ModelViewMatrix * gl_Vertex);v_texCoord = gl_MultiTexCoord0.xy;/*--------------------Lighting------------------*/  vec3 lighDir = normalize(gl_LightSource[0].position.xyz - ecPos);    ambientGlobal = gl_LightModel.ambient * gl_FrontMaterial.ambient;    ambient = gl_LightSource[0].ambient * gl_FrontMaterial.ambient;    diffuse = gl_FrontMaterial.diffuse * gl_LightSource[0].diffuse;/*---------------Calculate TBN---------------*/    vec3 tangent;    vec3 binormal;    normal = normalize(gl_NormalMatrix * gl_Normal);    tangent = gl_NormalMatrix * vec3(gl_MultiTexCoord2);    binormal = cross(normal, tangent);   /*---------------Calculate TBN matrix---------------*/   mat3 tbnMatrix = mat3(tangent, binormal, normal); lightDir = tbnMatrix * lightDir;   EyeDir = tbnMatrix *  (-ecPos);   normal = tbnMatrix * normal;   gl_Position = ftransform();gl_TexCoord[0] = gl_MultiTexCoord0;gl_TexCoord[1] = gl_MultiTexCoord1;gl_TexCoord[2] = gl_MultiTexCoord2;  halfVector = gl_LightSource[0].halfVector.xyz;  halfVector = tbnMatrix * halfVector;}Can you see anything else that may cause the problem?   