iDevGames Forums
Texture mapping single 3D object with one draw call - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Texture mapping single 3D object with one draw call (/thread-1027.html)



Texture mapping single 3D object with one draw call - jeonghyunhan - Jul 12, 2009 07:17 PM

Hi!
I cannot seem to be able to texture map from one spritesheet with different iamges for different sides of a cube with one draw call.
I can accomplish this using 6 glDrawArrays call for each side and binding different parts of the spritesheet with each call.

Any advice on this would be helpful, thanks.


Texture mapping single 3D object with one draw call - ThemsAllTook - Jul 13, 2009 06:05 AM

Ought to be simple. Use GL_QUADS or GL_TRIANGLES (not one of the types like GL_TRIANGLE_STRIP that shares vertices between primitives), and pass different texture coordinates in your texCoord array for each face you draw.