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?
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
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).