Home:ALL Converter>Problem with Parallax Normal Mapping in Opengl , GLSL

Problem with Parallax Normal Mapping in Opengl , GLSL

Ask Time:2011-01-19T04:14:17         Author:Pythagoras of Samos

Json Formatter

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: alt text

alt text

(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 ?

Author:Pythagoras of Samos,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/4728555/problem-with-parallax-normal-mapping-in-opengl-glsl
yy