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: Flickering textures....

  1. #1
    Junior Member Newbie
    Join Date
    May 2012
    Posts
    17

    Flickering textures....

    Hi!

    I have a problem with my terrain and that is; the textures is flickering(Like tv noise*) when the "camera" is further away from the terrain and when viewing it in close-up the flickering dissapears, why's that? How can I solve it?

    Video(watch in HD!): https://www.youtube.com/watch?v=yLiN0bfXRYU

    *Tv noise:
    http://cdn1.cdnme.se/cdn/9-2/613587/...v_51042408.jpg


    Thanks
    Daniel

  2. #2
    Member Regular Contributor Nowhere-01's Avatar
    Join Date
    Feb 2011
    Location
    Novosibirsk
    Posts
    251
    try enabling MipMapping:

    Code :
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     
    glTexImage2D(....);
     
    glGenerateMipmap(GL_TEXTURE_2D); //should go after you specified texture image

    http://en.wikipedia.org/wiki/Mipmap
    Last edited by Nowhere-01; 08-02-2013 at 10:40 PM.

  3. #3
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    495
    Quote Originally Posted by Nowhere-01 View Post
    Code :
    glTexImage2D(....);
     
    glGenerateMipmap(GL_TEXTURE_2D); //should go after you specified texture image
    glGenerateMipmap() requires OpenGL 3.0. If you need the code to work with earlier versions, replace glTexImage2D() with gluBuild2DMipmaps() or gluBuild2DMipmapLevels() (the latter requires GLU 1.3).

  4. #4
    Junior Member Newbie
    Join Date
    May 2012
    Posts
    17
    Wow, it worked, i'm so happy now!! Thanks man, you are my hero Nowhere-01!!

    GClements: I'm using OpenGL 4.0

Posting Permissions

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