Results 1 to 3 of 3

Thread: FVF component order

  1. #1

    FVF component order

    Hi all.

    I was thinking. If you define:

    [pascal]
    dwFVF := ( D3DFVF_XYZ OR D3DFVF_NORMAL OR D3DFVF_DIFFUSE OR
    D3DFVF_SPECULAR OR D3DFVF_TEX2 );
    [/pascal]

    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.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2

    FVF component order

    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/bo...5-Modeling.pdf)
    Code:
    #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.
    There are only 10 types of people in this world; those who understand binary and those who don't.

  3. #3

    FVF component order

    Thanx very much
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •