Commit 263b66a9 authored by chili's avatar chili
Browse files

testing fixed rgb=>n mapping

parent d2b1cd65
...@@ -40,6 +40,15 @@ float4 main( float3 viewPos : Position,float3 n : Normal,float2 tc : Texcoord ) ...@@ -40,6 +40,15 @@ float4 main( float3 viewPos : Position,float3 n : Normal,float2 tc : Texcoord )
n.y = -normalSample.y * 2.0f + 1.0f; n.y = -normalSample.y * 2.0f + 1.0f;
n.z = -normalSample.z; n.z = -normalSample.z;
n = mul(n, (float3x3) modelView); n = mul(n, (float3x3) modelView);
}
else
{
// unpack normal data
const float3 normalSample = nmap.Sample(splr, tc).xyz;
n.x = normalSample.x * 2.0f - 1.0f;
n.y = -normalSample.y * 2.0f + 1.0f;
n.z = -normalSample.z * 2.0f + 1.0f;
n = mul(n, (float3x3) modelView);
} }
// fragment to light vector data // fragment to light vector data
const float3 vToL = lightPos - viewPos; const float3 vToL = lightPos - viewPos;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment