PDA

View Full Version : FVF component order



chronozphere
01-07-2007, 10:39 PM
Hi all. :)

I was thinking. If you define:


dwFVF := ( D3DFVF_XYZ OR D3DFVF_NORMAL OR D3DFVF_DIFFUSE OR
D3DFVF_SPECULAR OR D3DFVF_TEX2 );


The order of component's isn't defined, which is crucial when passing data to D3D.
I tried to find more info about this on MSDN but i didn't found it. :?

Also, D3D has to make up some kind of order when you call the D3DXDeclaratorFromFVF routine.

Does someone know i what order D3D interpret's the different components??

Thanx.

Clootie
02-07-2007, 08:16 PM
D3D doc used to have diagram with right ordering - but it dissappeared some time ago. Ordering should be (I just copied this block from page 10 here http://www.xmission.com/~legalize/book/download/05-Modeling.pdf)

#define D3DFVF_XYZ 0x002
#define D3DFVF_XYZRHW 0x004
#define D3DFVF_XYZB1 0x006
#define D3DFVF_XYZB2 0x008
#define D3DFVF_XYZB3 0x00a
#define D3DFVF_XYZB4 0x00c
#define D3DFVF_XYZB5 0x00e
#define D3DFVF_NORMAL 0x010
#define D3DFVF_PSIZE 0x020
#define D3DFVF_DIFFUSE 0x040
#define D3DFVF_SPECULAR 0x080
#define D3DFVF_TEX0 0x000
#define D3DFVF_TEX1 0x100
#define D3DFVF_TEX2 0x200
#define D3DFVF_TEX3 0x300
#define D3DFVF_TEX4 0x400
#define D3DFVF_TEX5 0x500
#define D3DFVF_TEX6 0x600
#define D3DFVF_TEX7 0x700
#define D3DFVF_TEX8 0x800
#define D3DFVF_LASTBETA_UBYTE4 0x1000 - basicaly you have to order data depending on the value of FVF constant.

chronozphere
02-07-2007, 09:17 PM
Thanx very much :D