Archived

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

de_matt

Vertex format causing problems

Recommended Posts

de_matt    181
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
Maximka    122
i think, the flags D3DFVF_TEX1 and D3DFVF_TEX2 are exlusive.
i don''t know how D3D reacts if you use them together.
maybe it is the reaction of D3D

Share this post


Link to post
Share on other sites
de_matt    181
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
Maximka    122
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