D3DFVF Mesh showing up all crazy colors

Started by
3 comments, last by blaze02 17 years ago
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 };
};


Advertisement
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.
-------Harmotion - Free 1v1 top-down shooter!Double Jump StudiosBlog
Cheers blaze02 that solved it.
Also note this documentation page is being resurrected in an upcoming SDK (June I think).
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.
-------Harmotion - Free 1v1 top-down shooter!Double Jump StudiosBlog

This topic is closed to new replies.

Advertisement