PDA

View Full Version : Different shading results in ATI Cat 4.4 and NV FW 57.10



Corrail
04-10-2004, 06:09 AM
Hi all!

I've got a problem with a tangent space bump mapping shader. After a lot of pseudo-debugging I noticed that the problem is in my vertex-shader. I different values for my light and my view vectors on ATI Catalyst 4.4 and NV ForceWare 57.10.

Here's my vertex shader source:

attribute vec3 a2v_Normal;
attribute vec3 a2v_Tangent;
attribute vec3 a2v_Binormal;
attribute vec2 a2v_TexCoord;

varying vec3 v2f_LightVec1;
varying vec3 v2f_LightVec2;

varying vec3 v2f_ViewVec;
varying vec2 v2f_TexCoord;

void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

mat3 TBN_Matrix;
TBN_Matrix[0] = gl_NormalMatrix * a2v_Tangent;
TBN_Matrix[1] = gl_NormalMatrix * a2v_Binormal;
TBN_Matrix[2] = gl_NormalMatrix * a2v_Normal;

Space
vec4 Vertex_ModelView = gl_ModelViewMatrix * gl_Vertex;
v2f_LightVec1 = (TBN_Matrix * vec3(gl_LightSource[0].position - Vertex_ModelView));
v2f_LightVec2 = (TBN_Matrix * vec3(gl_LightSource[1].position - Vertex_ModelView));
v2f_ViewVec = TBN_Matrix * vec3(-Vertex_ModelView);

v2f_TexCoord = a2v_TexCoord;
}Thanks a lot for every help!

lc_overlord
04-11-2004, 10:06 AM
Aparently there is still a few bugs here and there.
until recently the lightsource position had the wrong value in the ATI drivers(v4.3), but that had been fixed in the 4.4 drivers(acording to http://www.clockworkcoders.com/oglsl ).
One can only imagine that more of these little buggs exist here and there in booth drivers.

You will just have to wait until booth ATI and Nvidia release the non beta version of GLSLang.
perhaps then they will work the same way for booth of them.

Corrail
04-11-2004, 01:18 PM
...until recently the lightsource position had the wrong value in the ATI drivers(v4.3)...
Thanks for the info. Both (ATI and NV) give a nearly good image but even though they are a little bit different. I had the idea that the image produced by ATI isn't 100% correct.

lc_overlord
04-12-2004, 11:05 AM
The nvidia glsl implementation is probobly less completed than the ATI one.
However i do beleve that nvidia is not far behind.