Sign in to follow this  
george7378

Setting float3 vectors

Recommended Posts

Store your 3 component vector to a 4 component vector and set the w-component to 0. In the shader side, access the float4 position with .xyz.

 

Cheers!

Share this post


Link to post
Share on other sites

Or use  SetValue

 

 
 
D3DXVECTOR2 SomeFloat2;
effect->SetValue( "SomeFloat2", SomeFloat2, sizeof(D3DXVECTOR2) );
 
D3DXVECTOR3 SomeFloat3;
effect->SetValue( "SomeFloat3", SomeFloat3, sizeof(D3DXVECTOR3) );
 
D3DXMATRIX SomeMatrix;
effect->SetValue( "SomeFloat4x4", SomeMaxtrix, sizeof(D3DXMATRIX) );
Edited by belfegor

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this