PDA

View Full Version : Textures not appearing on some NVidia cards



trbenning
10-21-2004, 07:54 AM
Are there any known issues with NVidia cards and openGL textures? I've developed an opengl activex control in VB6 that displays terrain data and allows for draping a topographical image over the surface. The problem is that on some cards (the one I'm using is an NVidia GeForce 4200 Go (Dell Mobile)), the textures show up completely gray. Additionally, when the user rotates or zooms the scene, I generate a 2D texture of the scene so that it can be displayed while a wireframe box rotates with the mouse movement (to keep from having to render the entire scene during navigation). This texture is only displayed on some graphics cards as well, and on others (like my NVidia) the background is just white.

Is there anything I can do to show the textures properly on all graphics cards? I can provide sample code if needed.

Silkut
10-21-2004, 08:37 AM
yes you can display a piece of code, pliz :)
you can check http://nehe.gamedev.net there is some good tex loader in Cpp and other languages like VB

trbenning
10-22-2004, 10:16 AM
This is the code that displays the 2D "snapshot" texture. glGetError returns 1282 when glEnd is called (if that helps).

I should also add that the textures do show up properly if I turn my hardware acceleration to zero or the next lowest level.

glColorMaterial faceFront, cmmAmbientAndDiffuse
glEnable glcColorMaterial
glEnable glcTexture2D
glTexEnvf tetTextureEnv, tenTextureEnvMode, tepModulate
glTexEnvf tetTextureEnv, tenTextureEnvMode, tepDecal

'bind the frame buffer snapshot
glBindTexture glTexture2D, TEX_FB

'draw a quad onto which the texture (FB) is to be draped

glBegin bmQuads

glTexCoord2f 0, 0
glVertex3f -mintWidth / 2, -mintHeight / 2, -mdblZmax
glTexCoord2f 0, 1
glVertex3f -mintWidth / 2, mintHeight / 2, -mdblZmax
glTexCoord2f 1, 1
glVertex3f mintWidth / 2, mintHeight / 2, -mdblZmax
glTexCoord2f 1, 0
glVertex3f mintWidth / 2, -mintHeight / 2, -mdblZmax

glEnd

glDisable glcTexture2D
glDisable glcColorMaterial

ZbuffeR
10-22-2004, 01:06 PM
If you look at the gl.h header, you will see that this error code means GL_INVALID_OPERATION.
That is the operation is not allowed in the current state.
Are you sure it is only the glEnd that triggers this error ?
Nothing seems wrong in the code you provide, even if I do not understand what are 'bmQuads',tetTextureEnv, tenTextureEnvMode, tepDecal, etc.

Are you sure you specify a power of two texture ? correct format ?

gbiv
10-25-2004, 01:58 AM
I may be wrong but aren't those coord CW? Shouldn't they be CCW?