Reputation: 3071
I've got a terrible issue with parallax normal mapping and I don't know what can be the problem.
(OpenGL 2.0, C++, WinXP)
My results:
(green are normals, blue are tangents and red are binormals (bitangents) )
Normal mapping is working fine so I assume the tangent vectors are good. The weird thing is, on some walls of cube, parallax mapping is done correctly and in others it is not. I'm sure my GLSL code is OK because I copied it from http://www.dhpoware.com/demos/index.html where you can find a working parallax normal mapping demo - which works on my computer, too.
I tried also 2 ways to calculate tangent vectors so it should not be an issue. I tried switching from DisplayList to VBO and in reverse, it gave the same results, so tangents are probably transferred correctly (I even tried to transfer it as gl_Color).
Height map is loading correctly, I tried to set it as a diffuse map and it looked OK.
glGetError() gives me No Errors and shader compile logs says so.
Of course, I checked texture coordinates over nine thousand times.
mystery... I don't even know what part of code analyze, have you guys got any suggestions ?
Upvotes: 2
Views: 1066
Reputation: 5283
Wild guess following
I'd bet either on a tangent basis (vectors) problem, or on view vector being transformed/considered in the wrong coordinate space.
Without more information, it's difficult for me to say more...
Some source code, or animation of the problem would be helpful.
Upvotes: 1