Texture mapping single 3D object with one draw call

Member
Posts: 75
Joined: 2009.01
Post: #1
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.
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #2
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.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Mapping 2D texture to multiple GL_TRIANGLES ardowz 2 506 Mar 12, 2014 08:56 AM
Last Post: ardowz
  Draw to texture using FBOs - aspect ratio issues Madrayken 2 3,901 Jul 15, 2010 11:47 AM
Last Post: Madrayken
  Changing Uniform Variables for a Single Shader reapz 3 5,206 Jul 15, 2010 01:29 AM
Last Post: dazza
  Texture Mapping: Loading a texture from a .bmp file? ishrock 5 5,749 Dec 13, 2008 09:27 AM
Last Post: ThemsAllTook
  Single buffered window Rasterman 9 5,610 Oct 15, 2007 10:40 AM
Last Post: ThemsAllTook