I'm currently trying to get some bumpmapping effect to work. guiver6 already posted about this in the Practice-Forum. I finally managed to hunt down the problem and have a very simple test case that shows what is happing, using the following two shaders, I basicly just pass on the tangent from the mesh texcoord-set 1 down to the fragment shader and display it there.
The weird thing is, I get different results in OpenGL vs. DirectX. The DirectX-one seems to be correct, while the OpenGL-one shows abrupt changes on submesh borders.
Thanks for any help.
Greetings,
Rincewind
Here are the shaders:
Code: Select all
//Vertex-shader
void main(
//my inputs
float4 Position : POSITION,
float2 TexCoord0 : TEXCOORD0,
float3 tangent : TEXCOORD1,
//my outputs
out float4 oPosition : POSITION,
out float4 oColor : COLOR,
out float2 oTexCoord0 : TEXCOORD0,
out float3 oTexCoord1 : TEXCOORD1,
//uniform state
uniform float4x4 ModelViewProj
)
{
oPosition = mul(ModelViewProj, Position);
oTexCoord0 = TexCoord0;
oColor = float4(1.0, 1.0, 1.0, 1.0);
oTexCoord1 = tangent;
}
//FragmentShader
void main(
float2 TexCoord0 : TEXCOORD0,
float3 L : TEXCOORD1,
//my outputs
out float4 oColor : COLOR
)
{
oColor = float4(L, 1.0);
}

And here the OpenGL-image:
