Jump to content
  • Advertisement
Sign in to follow this  
Kinju

Vertex Blending

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

Hi all, I'm trying to implement the Vertex Blending. Do, I add these components to my vertex declaration: D3DDECLUSAGE_BLENDWEIGHT, D3DDECLTYPE_FLOAT4 D3DDECLUSAGE_BLENDINDICES, D3DDECLTYPE_UBYTE4 Of course, I create the vertex buffer with the weights and matrix indices. In the render method : // Enable the vertex blending m_oDevicePtr->SetRenderState(D3DRS_VERTEXBLEND, true) // Fill the matrix palette for( unsigned int uiBoneIt = 0; uiBoneIt < m_uiBoneCount; uiBoneIt++) m_oDevicePtr->SetTransform(D3DTS_WORLDMATRIX(uiBoneIt + 1), m_oBones[uiBoneIt]->GetAbsoluteMatrix()) // Set the vertex declaration // Set buffers etc... // DrawPrimitive m_oDevicePtr->SetRenderState(D3DRS_VERTEXBLEND, false) Is it a correct method to use the vertex blending without shaders ? Thanks you :) Aurélien.

Share this post


Link to post
Share on other sites
Advertisement
Bare in mind that you need to verify support against D3DCAPS9::MaxVertexBlendMatrixIndex. If memory serves, Nvidia hardware will report 0 - no fixed function vertex blending supported. I got caught with this back in the GeForce 4 timeframe when Nvidia really started pushing vertex shaders. They claimed that there was no point in supporting it.

Anyway, assuming it were actually supported your use of D3DRS_VERTEXBLEND is wrong. If you look at the documentation you'll see that it actually expects a value from the D3DVERTEXBLENDFLAGS enumeration [wink]

hth
Jack

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.

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

Sign me up!