Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Texture Color Distortion at Angles

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2012
    Location
    Indiana
    Posts
    3

    Texture Color Distortion at Angles

    Hello, this is my first post here and i am kind of new to opengl so i came here looking for some help. I really dont know what is causing this and it is rather annoying so maybe some one here might know what it is.

    I have a simple opengl project that has some textures in it. The textures are rendered fine up close but from a distance at steep angles the color gets shifted to blue(the texture is originally mostly green) for some reason. The textures are just simple cubemaps with a MIN_FILTER of GL_NEAREST_MIPMAP_LINEAR and a MAG_FILTER of GL_NEAREST. It also doesn't seem to matter from what side i am looking at the texture from, the blue lines seem to always run in the x axis(see picture).

    I really have no idea has how to fix this and my attempts to google it have failed so i have come to you for help, thanks in advance.

    Pic attached depicting what i mean.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,725

    Re: Texture Color Distortion at Angles

    Where do the mipmaps come from? If you're loading them from disk, have you taken them into an image editor and looked at them?

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2012
    Location
    Indiana
    Posts
    3

    Re: Texture Color Distortion at Angles

    I am fairly new so i am just using SOIL to load my textures and generate the mipmaps, as i do not know how soil does it i can not tell you how they are being generated so maybe it could just be soil's fault.

    On the same note, the odd effect does not appear when i don't use the mipmaps so it is looking to be some how a side effect of the mipmaps.

  4. #4
    Junior Member Newbie
    Join Date
    Feb 2012
    Location
    Indiana
    Posts
    3

    Re: Texture Color Distortion at Angles

    I am starting to really think its the mipmaps so i am trying to generate them with glGenerateMipmap and not with soil but i cant seem to get it to work properly. All it does is display white.

    my texture loading code is this...


    id = SOIL_load_OGL_single_cubemap(formatedBmpPath,"EWNS UD",SOIL_LOAD_AUTO,SOIL_CREATE_NEW_ID,0);

    glBindTexture(GL_TEXTURE_CUBE_MAP, id);

    glTexParameteri(GL_TEXTURE_CUBE_MAP,GL_TEXTURE_MIN _FILTER,GL_NEAREST_MIPMAP_LINEAR);
    glTexParameteri(GL_TEXTURE_CUBE_MAP,GL_TEXTURE_MAG _FILTER,GL_NEAREST);
    glGenerateMipmap(id);

    i really have no idea what i am doing wrong now... i just dont seem to be having any luck today...

Posting Permissions

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