bubu

float3 from float4

Discussion created by bubu on Aug 12, 2010
Latest reply on Aug 13, 2010 by danbartlett@ntlworld.com

What's the correct way to downcast a float4 into a float3 discarding the .w component, pls?

 

float4 b;

 

1. float3 a = as_float3(b); //this should be ok

2. float3 a = (float3)b; //I'm not sure about this

3. float3 a = (float3)(b.x,b.y,b.z); //obviously ok, but I want it simpler.

Outcomes