# OpenGL OpenGL ignores glTexCoordPointer

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

## Recommended Posts

This suddenly started to happen and I have no clue what's going on. I've got a VBO with texture coordinates ( mixed with others ). Using it for rendering and depth testing works. Now I want to use it for some other shadow caster and render it using depth ( something which is proven to work! ). Still OpenGL insists on delivering for each and every vertex (0,0) as the texture coordinates. I'm using the exact same code as I did for the other place:
glClientActiveTextureARB( GL_TEXTURE0_ARB );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
glBindBufferARB( GL_ARRAY_BUFFER_ARB, vboModel );
glTexCoordPointer( 2, GL_FLOAT, VBO_PNTC_STRIDE, ( const GLvoid * )VBO_PNTC_TEXCOORD );
Still though OpenGL plainly ignores this. How can this be? Exists there some utterly strange and unholy OpenGL State that can magically force it to ignore texture coordinates? I'm really out of ideas since I can see no error, not even the slightest, in this code. EDIT: VBO_PNTC_ are just the stride and offset variables. Nothing fancy here and it worked at the other place so this is not the problem

##### Share on other sites
The last parameter for glTexCoordPointer() should be NULL or 0 since the glBindBuffer() already took care of telling OpenGL where the data is. You'll still need the offset in glTexCoordPointer() since it sounds like you're using an interleaved array.

##### Share on other sites
@V-Man: Nice try but I'm developing on Linux.

Looks like I found the problem. The object in question had been a wire fence with the appropriate alpha texture ( mask style, not full alpha ). As it looks like the sun shadow texture with 1024 ( on the lower spec machine ) caused troubles. The texture got indeed sampled ( why I got (0,0) texture coordinates is beyond me ) but simply got skipped hence I got no shadow at all. Why though it worked when I used the vertex coordinates as texture coordinates ( sort of pseudo-planar projection for testing ) is also beyond me. Bumping up the texture resoution to 2048 or 4096 allows the shadow to be seen ( although, well, it's rather noisy ). Looks like PCF performs very bad in this situation ( I should not be astonished since I've seen nothing good from PCF so far... except being slow :/ ) too. Maybe I find a better way to smooth the shadows, let's see.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 14
• 12
• 9
• 12
• 9
• ### Forum Statistics

• Total Topics
631435
• Total Posts
3000059
×