A question about binormals and tangents (shader related)

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Viking86
Posts: 24
Joined: Tue Apr 20, 2010 2:29 pm

A question about binormals and tangents (shader related)

Post by Viking86 »

Greetings, thanks to some great people here I've managed to implement relief mapping using shader code from the Typhoon Labs shader designer.

Now with only changin the code for getting the binormal and tangent

Code: Select all

 eyeSpaceTangent  = normalize(gl_NormalMatrix * gl_MultiTexCoord1.xyz);
 eyeSpaceBinormal = normalize(gl_NormalMatrix * gl_MultiTexCoord2.xyz);
Now it kinda works,
More info on the pictures, to be more specific it seems that it tilts the image in the opposite direction in which it needs to when watching from the side. Look here for illustration http://www.imagesforme.com/upload/0c4a8b6b.bmp

Image

since the only change was done in the vertex shader for the code for getting binormals and tangents. Is it possible that this is related to the engine itself?
It makes no sense that it looks good when watched from 0 and 180 degrees, but bad when 90 and 270.
I know that for OpenGL irrilicht uses the above code for accesing binormals and tangents
Post Reply