float3 NormalVec = normalize( mul( Normal, ViewProjMatrix) );
should of been:
float3 NormalVec = normalize( mul( ViewProjMatrix, Normal ) );
[Edited by - Roadkill247 on April 4, 2008 2:47:01 PM]
float3 NormalVec = normalize( mul( Normal, ViewProjMatrix) );
float3 NormalVec = normalize( mul( ViewProjMatrix, Normal ) );
// Reflection WaterOutput o; // Compute normal in camera spacefloat3 NormalVec = normalize( mul( ViewProjMatrix, Normal ) ); // Obtain the reverse eye vectorfloat3 EyeVec = normalize( mul( Position, ViewProjMatrix ) ); // Store the reflection vector in texcoordo.ReflectCoord = reflect( -EyeVec, NormalVec );o.RefractCoord = refract( EyeVec, NormalVec, 0.8f ); // Apply the projectiono.Position = mul( Position, ViewProjMatrix ); // Pass coords through o.TexCoord = TexCoord; return o; // End of Reflection
// Cut down for examplereturn ( texCUBE( EnvSampler, i.ReflectCoord ) / 2.0f );