Archived

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

Vertex format causing problems

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

This FVF works type CUSTOMVERTEX Position as D3DVECTOR Normal as D3DVECTOR Diffuse as LONG Specular as LONG tu as SINGLE tv as SINGLE ent type const D3DFVF = (D3DFVF_POSITION or D3DFVF_NORMAL or D3DFVF_DIFFUSE or D3DFVF_SPECULAR or D3DFVF_TEX0) But this one doesn''t work right type CUSTOMVERTEX Position as D3DVECTOR Normal as D3DVECTOR Diffuse as LONG Specular as LONG tu as SINGLE tv as SINGLE tu2 as SINGLE tv2 as SINGLE ent type const D3DFVF = (D3DFVF_POSITION or D3DFVF_NORMAL or D3DFVF_DIFFUSE or D3DFVF_SPECULAR or D3DFVF_TEX1 or D3DFVF_TEX2) With the first one when I render with just diffuse and 4 diffuse colours it gradiates it properley over the face. However, when I use the second one, only two colours are used. Sometimes for no reason it uses different combinations of the colours. All the colours are storedd in the vertex. Is it something to do with specifying the length of the texture coords

Share this post


Link to post
Share on other sites
Okay, how could I fix this. Basically all I want to do is use all (or as many) texture stages but still being able to blend colours (diffuse, specular) properley.

Share this post


Link to post
Share on other sites
D3DFVF_TEX2 tells that you have 2 pairs uv-coordinates
D3DFVF_TEX1 tells that you have 1 pair uv-coordinates

provide only D3DFVF_TEX2 in your D3DFVF, so you can define 2 sets of texture coordinates

Share this post


Link to post
Share on other sites