Jump to content
  • Advertisement
Sign in to follow this  
RPTD

OpenGL OpenGL ignores glTexCoordPointer

This topic is 3792 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

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!