![]() |
| ||
| OpenGL Wrong Texture Same Shader, Same Mesh I have a really wierd problem using OpenGL. I've verified all my code passes the correct mesh, correct texture, to the correct shader. When I use the same texture with multiple instances of the same mesh and the same shader located at different locations on the screen it shows up properly. When using other shaders and other meshes and other textures the scene appears correct. However when I use same mesh, same shader, but bind alternate textures for rendering my textures get shuffled. There is an object at the position it is suppose to be, but the texture displayed at that location is different. It appears to be mis-binded exactly the same way. My guess I'm missing something to tell the render to wait before processing the next instance and somehow the texture binding gets affected! // Note: I've trimmed the code but |
| ||
| Re: OpenGL Wrong Texture Same Shader, Same Mesh Upon further research I've found it is definitely a persistent binding problem. If I assign a second copy of the same shader and bind the alternate texture to it, there is no problem. So there appears to be a problem when the texture bind function being called a second time for a different texture. Anybody know how to get around this problem. My work around fixed two objects where I used two different textures each, but I have a third object that has 75 selectable textures, and I'm not keen about creating 75 identical shaders even if in a loop! |
| ||
| Re: OpenGL Wrong Texture Same Shader, Same Mesh What happens when you use the same mesh, different textures and no shader? What you're doing looks right to me, assuming that all of your variables and functions are 'correct' with respect to what it is you're doing. |
| ||
| Re: OpenGL Wrong Texture Same Shader, Same Mesh Exactly the same thing. The textures get shuffled! |
| All times are GMT -4. The time now is 11:30 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC