Vertex format causing problems

Started by
3 comments, last by de_matt 20 years, 6 months ago
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
Advertisement
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
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.
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
Wow, wicked, thanks

This topic is closed to new replies.

Advertisement