I generate terrain with texture. Everthing is ok
but after that I am trying to add skybox but the problem occurs here. When I put a texture for skybox the texture is mapped on the terrain. I thing there is something with binding textures. But I could not find any solutions.
Can anyone knows this problem?
When you want to specify the properties of your sky texture, you should use from the function glBindTexture() . As an example
in your init code:
glBindTexture( GL_TEXTURE_2D, SkyTexture );
//glTexParameter()
//glTexImage2D()
…
And in your draw code, you use from the following code:
glBindTexture( GL_TEXTURE_2D, SkyTexture );
//Draw The sky box
there’s the same manner for the terrain texture:
in your init code:
glBindTexture( GL_TEXTURE_2D, TerrainTexture );
//glTexParameter()
//glTexImage2D()
…
and in your draw function:
glBindTexture( GL_TEXTURE_2D, TerrainTexture );
//Draw your terrain
Merry christmas & happy new year
-Ehsan-