Skip to main content
GameDev.net gamedev.net
🔒 Locked

D3DFVF Mesh showing up all crazy colors

Started by REspawn Apr 12, 2007 at 4:36 PM 3 replies 1.9k views
Original Post
REspawn
REspawn
Hi, im having some trouble with my mesh when i add the D3DFVF_TEX1 value to it, the whole thing shows up with crazy colors like a rainbow had sex with my vertex data and I can see why its doing this. I know all the UV values that are coming in are right so i think it must be the way i have the FVF values set up, i included a pic of the problem and the sample code for my vertex struct. Thanks for any help, -Dave a. Mesh without D3DFVF_TEX1 b. With D3DFVF_TEX1 added and nothing else

struct Vertex{
    float x, y, z, u, v;
    DWORD color;

    enum FVF{ FVF_Flags = D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_DIFFUSE };
};


blaze02
blaze02
Here is the URL to one of the hardest pages to find on MSDN.
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dx8_c/directx_cpp/graphics_using_6b78.asp

When you set up an FVF, Direct3D needs to make assumptions about the memory layout. Simple solution: the vertex needs the "DWORD color" before the "float u, v".

C ya.
REspawn
REspawn
Cheers blaze02 that solved it.
blaze02
blaze02
Quote:
Original post by Namethatnobodyelsetook
Also note this documentation page is being resurrected in an upcoming SDK (June I think).

Wow. How do you know that?

I'm just glad that I have it bookmarked now.

Cheers.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.