Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

tarin

Vertex Shader declerator question

This topic is 6306 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Let''s say that I want to do skinning in my vertex shader, and after I have the positional x,y,z components of the vertex stream, I have 3 weights that follow it. Following the 3 weights are 4 indices into the matrices. Isn''t the following declerator a bad idea: ... D3DVSDE_REG( 1, D3DVSDT_FLOAT1 ), // Weight 1 D3DVSDE_REG( 2, D3DVSDT_FLOAT1 ), // Weight 2 D3DVSDE_REG( 3, D3DVSDT_FLOAT1 ), // Weight 3 ... because as I understand it, the D3DVSDT_FLOAT1 macro simply expands into a full four-component vector and only uses the first component? Wouldn''t it be a better space saver to do this: ... D3DVSDE_REG( 1, D3DVSDT_FLOAT3 ), // All three weights ... and then get the weights from within the shader by this: v1.x ; weight 1 v1.y ; weight 2 etc... Am I missing something or isn''t this the better way to do this? If so I don''t know why I''ve seen samples from IHVs doing the former way? Or I could be completely off base here... Tarin

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!