• Advertisement
Sign in to follow this  

Cubemap error

This topic is 2894 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello friends, I have the following problem to solve. My scene consists of a 3D object that has a dynamic cubemap. When I work with glBegin() glEnd() everything works fine but when I work with VBO, the Cubemap not draw. glUseProgram (ProgramShader [j]); glEnableClientState (GL_VERTEX_ARRAY); glEnableClientState (GL_NORMAL_ARRAY); glEnableClientState (GL_TEXTURE_COORD_ARRAY); glClientActiveTextureARB (GL_TEXTURE0_ARB); glBindBufferARB (GL_ARRAY_BUFFER_ARB, BufferTextur [j]); glTexCoordPointer (2 GL_FLOAT, 0, 0); glEnableClientState (GL_TEXTURE_COORD_ARRAY); glActiveTextureARB (GL_TEXTURE0_ARB); glBindTexture (GL_TEXTURE_CUBE_MAP_ARB, DynTexture); glEnable (GL_TEXTURE_CUBE_MAP_ARB); glClientActiveTextureARB (GL_TEXTURE1_ARB); glBindBufferARB (GL_ARRAY_BUFFER_ARB, BufferTextur [j]); glEnableClientState (GL_TEXTURE_COORD_ARRAY); glTexCoordPointer (2 GL_FLOAT, 0, 0); glActiveTextureARB (GL_TEXTURE1_ARB); glEnable (GL_TEXTURE_2D); glBindTexture (GL_TEXTURE_2D, NumeroDeTextura[M[j]->faces [0]. material].texID); glEnable (GL_TEXTURE_2D); glBindBufferARB(GL_ARRAY_BUFFER_ARB, BufferVertex[j]); glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, BufferIndexs[j]); glVertexPointer(3, GL_FLOAT, 0, 0); glBindBufferARB(GL_ARRAY_BUFFER_ARB, BufferNormal[j]); glNormalPointer(GL_FLOAT, 0, 0); glDrawElements(GL_TRIANGLES,3*M[j]->nfaces,GL_UNSIGNED_SHORT,0); glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glClientActiveTextureARB (GL_TEXTURE1_ARB); glDisableClientState (GL_TEXTURE_COORD_ARRAY); glClientActiveTextureARB (GL_TEXTURE0_ARB); glDisableClientState (GL_TEXTURE_COORD_ARRAY); glActiveTextureARB (GL_TEXTURE0_ARB); glDisable (GL_TEXTURE_CUBE_MAP_ARB); glDisable (GL_TEXTURE_2D); glActiveTextureARB (GL_TEXTURE1_ARB); glDisable (GL_TEXTURE_2D); glUseProgram (0); What could be wrong?

Share this post


Link to post
Share on other sites
Advertisement
Try to simplify your code. Just apply the cubemap. Also cubemaps need 3d texcoords.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement