Weird problem rendering multiple objects
Stephan Rose <[email protected]> Thu, 18 Sep 2008 18:20:35 -0800
| Newsgroups | gmane.games.devel.opengl |
|---|---|
| Organization | Fat City Network Services, San Diego, California |
| Message-ID | <[email protected]> |
I'm having a really weird bizarre problem rendering two objects. Both objects use completely different textures, shaders, vertex buffer and index buffer. If I render only object A, everything is correct. If I render only object B, everything is correct. If I render A and B, object A takes on the appearance of Object B and vice versa. That is, Object A is rendered with Object B's textures and shaders and vice versa and I have absolutely no idea why. However, vertex and index buffers are not affected in this way, each object still uses the correct mesh. I can "fix" this by reloading the vertex/index data into my vertex and index buffers prior to drawing each object. If I do that, then the correct shaders and textures are applied (doesn't matter if I do it before or after setting the render states for the object). Buffers are created with GL_STATIC_DRAW. Thanks, Stephan ----- FAQ and OpenGL Resources at: http://www.geocities.com/SiliconValley/Hills/9956/OpenGL -- Author: Stephan Rose INET: [email protected] Fat City Hosting, San Diego, California -- http://www.fatcity.com --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [email protected] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).