Jump to content
  • Advertisement
Sign in to follow this  
Mercenarey

D3DCAPS9::MaxVertexBlendMatrixIndex - WHY??

This topic is 4840 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

Why is there a limit to how many matrices a vertexshader can support? My board has 256 MB memory, but still only has MaxVertexBlendMatrixIndex = 37. Why can't I just make a float4x4 array as big as I like, and then do the mathematical operations that I want on it? Why is there a limit so much smaller than the board's maximum memory?

Share this post


Link to post
Share on other sites
Advertisement
Because (for DX8/9) constants are't stored in main memory, they're registers on the vertex shader.

Share this post


Link to post
Share on other sites
vs_1_1 gives you a minimum of 96 constants, whereas vs_2_0, vs_2_x, and vs_3_0 give you a minimum of 256 constants. If you are using 4x4 matrices, then each matrix requires 4 constants. This gives you a total of 24 on vs_1_1 and 64 on others. If you are efficient and use 3x4 matrices, then each matrix requires 3 contstants. This gives you a total of 32 on vs_1_1 and 85 on others.

The D3D runtime probably reserves a number of constants so it has room for all of the other states that it must store in the constant registers.

Share this post


Link to post
Share on other sites
Quote:
Original post by Mercenarey
Why is there a limit to how many matrices a vertexshader can support? My board has 256 MB memory, but still only has MaxVertexBlendMatrixIndex = 37.

Why can't I just make a float4x4 array as big as I like, and then do the mathematical operations that I want on it? Why is there a limit so much smaller than the board's maximum memory?

The constant has nothing to do with shaders. It specifices the maximum matrix index you can use in indexed vertex blending (a FFP thing).

Share this post


Link to post
Share on other sites
Thanx alot guys, stuff got a bit clearer now.

However, I still don't understand the MaxVertexBlendMatrixIndex property. Atm. I just ignore it, and use 60 matrices on my shader (within the limit of the 256 constants), and index into it as I like - also beyond the 37, as my property states should be max.

What the hell is this property for?

Share this post


Link to post
Share on other sites
Quote:
Original post by Mercenarey
Thanx alot guys, stuff got a bit clearer now.

However, I still don't understand the MaxVertexBlendMatrixIndex property. Atm. I just ignore it, and use 60 matrices on my shader (within the limit of the 256 constants), and index into it as I like - also beyond the 37, as my property states should be max.

What the hell is this property for?

The property is used for indexed vertex blending with the FFP, also known as matrix palette skinning. Using the FFP, you can stuff a matrix index and a number of weights in your vertex structure, and set a number of world matrices using SetTransform(D3DTS_WORLDMATRIX(n), &mat) where n is the index of the matrix to set.

If you're using shaders, this stuff doesn't apply to you. And if you're using the FFP, you might as well ignore it, because IIRC most nVidia cards don't support indexed vertex blending.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!