Texture Matrix scaling gives pixelated textures

This topic contains 3 replies, has 2 voices, and was last updated by  Xmas 8 years, 8 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #29715

    grayson
    Member

    When I use the Texture matrix to scale texture coordinates i get very pixelated textures on the device, but when the same code runs in the emulator it shows up at the expected resolution.

    Here is the code i am using;

    glActiveTexture(GL_TEXTURE1);
    glMatrixMode(GL_TEXTURE);
    glLoadIdentity();
    glScalef(detailscale, detailscale, detailscale);
    glBindTexture(GL_TEXTURE_2D, detail);
    glMatrixMode(GL_MODELVIEW);

    Is there a limitation with the MBX lite chip for this or would this be a memory ot mipmap issue?

    Any help would be appreciated.

    #32772

    Xmas
    Member

    You might run into problems if your texture coordinates or your scale factor are too large. MBX texture coordinate range is a bit more limited than that of the latest PC GPUs.

    I suppose you have a small detail texture and want to repeat it many times over a surface. How large do your texture coordinates get? Can you modify them to “restart” at some edges in your mesh? Centering your coordinate range on 0 instead of using only positive values should also help.

    #32773

    grayson
    Member

    Thank-you, I will try those suggestions.

    Another note is that when I manually set the texture scale in the uv coordinates to the same as that when using the glScalef everything looks like it should on the device. it is only when using the Texture Matrix stack that I get the issue.

    #32774

    Xmas
    Member

    That is odd. Which device is it you’re targeting?

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.