Flexible Vertex Format Flags

Started by
3 comments, last by Abdhl Al Hazred 22 years, 9 months ago
Is it possible to combine any Flexible Vertex Format Flags? (ie. D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL | D3DFVF_TEX1) It dosn´t work for me. When the stars are right they will awake...
When the stars are right they will awake...
Advertisement
Yes, that''s the whole point (to specify a vertex with any mix of data).

What doesn''t work?
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
While the flag descriptors are correct, are you ordering the variables correctly in your vertex structure? XYZ Coords come first, then normals, then color, then texture:

  typedef struct sVertex {  float x, y, z;  float nx, ny, nz;  D3DCOLOR Diffuse;  float u, v;} sVertex;#define FVF (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX1)  



Jim



Jim Adams
home.att.net/~rpgbook
Programming Role-Playing Games with DirectX 8
No you cannot combine all fvf flags. There are some restrictions. For example you cannot combine D3DFVF_XYZ and D3DFVF_XYZRHW because you cannot use both transformed and untransformed coordinates in the same vertex.

-René

Real programmers don't document, if it was hard to write it should be hard to understand

Yes, sorry, not *any* mix of data, but definitely the attributes listed...
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials

This topic is closed to new replies.

Advertisement