Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

My UV coordinates never respond to me for some reason. It is just UV mapping itself in the smallest way possible. It's a tile-able texture and the program is subdividing so much I can't even zoom in and see it right. It just looks like lots of noise. So I set my UV coordinates to 0 and 0 for every vertex and it ignored and mapped the same way still. I continuously just changed the coordinates and I'm not getting any results.

Shader: http://gyazo.com/0422d4f37134671eb0b35c2a00605f7e

Declaration:

    D3DVERTEXELEMENT9 Decl[] =
    {
        {
            0,
            0,
            D3DDECLTYPE_FLOAT3,
            D3DDECLMETHOD_DEFAULT,
            D3DDECLUSAGE_POSITION,
            0
        },
        {
            0,
            0,
            D3DDECLTYPE_FLOAT2,
            D3DDECLMETHOD_DEFAULT,
            D3DDECLUSAGE_TEXCOORD,
            0
        },
        D3DDECL_END()
    };

My Vertice UV:

                Vertices[y * WIDTH + x].V = y / 1.28;
                Vertices[y * WIDTH + x].U = x / 1.28;

My struct:

struct CUSTOMVERTEX
{
    float X, Y, Z;
    float U, V;
};
share|improve this question
    
Can you convert your code from screenshot to typed form please? –  Byte56 Aug 23 '12 at 17:10
    
Why? It is perfectly fine in screenshot and will look exactly the same. –  dvds414 Aug 23 '12 at 17:14
2  
Except it will be visible in the question without clicking on the link, and it will be parseable with a search engine. Additionally, I don't know how long gyazo.com keeps images so this question may become useless quickly. Keep in mind, you're asking people to help you. You should desire to make that as easy as possible. Further, the question and answers are not just for you, they're for anyone who has a similar problem in the future. –  Byte56 Aug 23 '12 at 17:16
    
It takes a few seconds to view the links and is a lot easier for me to upload things. My gyazo account holds images forever so no need to worry –  dvds414 Aug 23 '12 at 17:17
    
There you go I editted it for you. –  dvds414 Aug 23 '12 at 17:39
show 3 more comments

1 Answer

I found the issue. The simple solution was changing the declaration in the TEXCOORD area I made it

         {
            0,
            sizeof(float) * 3,
            D3DDECLTYPE_FLOAT2,
            D3DDECLMETHOD_DEFAULT,
            D3DDECLUSAGE_TEXCOORD,
            0
        },
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.