Quote:
I also tried just casting the matWorld to (float3x3) for the multiplication with the normal but that doesn't pass my compiler
normalize ( mul ( In.Normal.xyz, (float3x3)matWorldIT ) );
Also you're doing a bunch of operations with float4 ... like this:
// get the normalized vector from this pixel to lightfloat3 LightVector = normalize ( lightPos - In.Position );
lightPos and In.Position are both float4, not sure if the normalize returns what you expect or if it's your problem tho :)
Try to use your original pixel shader (first post) but change the following:
// normalize normal and bring it into world spaceIn.Normal = normalize ( mul ( In.Normal, matWorld ) );// bring position into world spaceIn.Position = mul ( In.Position, matWorld );...// get the normalized vector from this pixel to lightfloat3 LightVector = normalize ( lightPosition - In.Position );
for
// normalize normal and bring it into world spaceIn.Normal = normalize ( mul ( In.Normal.xyz, (float3x3)matWorld ) );// bring position into world spaceIn.Position = mul ( float4(In.Position.xyz,1), matWorld );...// get the normalized vector from this pixel to lightfloat3 LightVector = normalize ( lightPosition.xyz - In.Position );
[Edited by - c3Dp on March 17, 2010 11:37:40 PM]