Hanna-Barbera
2005-01-07 20:54:43 UTC
Hi,
I'm wondering what is the proper way to cast variables in HLSL.
Say I want a float4 to become a float3
objLightPos0= (float3)mul(float4(LightPosition0, 1.0), matViewInverse);
When I do this
objLightPos0= float3(mul(float4(LightPosition0, 1.0), matViewInverse));
I get a compile error
I'm wondering what is the proper way to cast variables in HLSL.
Say I want a float4 to become a float3
objLightPos0= (float3)mul(float4(LightPosition0, 1.0), matViewInverse);
When I do this
objLightPos0= float3(mul(float4(LightPosition0, 1.0), matViewInverse));
I get a compile error