Sign in to follow this  

Vertex blend error!!!!

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

i am crazy with my vertex blend.. this is my vertex define.. struct Vertex { enum{ FVF = D3DFVF_XYZB1 | D3DFVF_LASTBETA_UBYTE4 | 3DFVF_NORMAL | D3DFVF_TEX1 }; D3DXVECTOR3 p; union { float beta; BYTE indices[4]; }; D3DXVECTOR3 n; float tu, tv; }; and before render it i set the renderstate as: SetRenderState( D3DRS_INDEXEDVERTEXBLENDENABLE, TRUE ); SetRenderState( D3DRS_VERTEXBLEND, D3DVBF_0WEIGHTS ); but when i render: SetFVF(Vertex::FVF) SetStreamSource(........) DrawPrimitive........ when call DrawPrimitive ,,,i get an error in debug window : Direct3D9: (ERROR) :The number of blend weights in the FVF should match what is set in D3DRS_VERTEXBLEND for indexed vertex blending why ??? anybody can help me? thanks.

Share this post


Link to post
Share on other sites
see the directx document:

D3DVBF_DISABLE
Disable vertex blending; apply only the world matrix set by the D3DTS_WORLDMATRIX macro, where the index value for the transformation state is 0.

D3DVBF_1WEIGHTS
Enable vertex blending between the two matrices set by the D3DTS_WORLDMATRIX macro, where the index value for the transformation states are 0 and 1.


D3DVBF_0WEIGHTS
Use a single matrix with a weight of 1.0.


my vertex only has one weight of 1.0, and have to set to D3DVBF_0WEIGHTS

and i tried D3DVBF_1WEIGHTS, i still have this error too.

Share this post


Link to post
Share on other sites

This topic is 4781 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.

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