Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: glDrawArrays - Multiple Textures

  1. #1
    Newbie Newbie
    Join Date
    Jun 2013

    glDrawArrays - Multiple Textures

    Hi you all out there,

    Im sitting over a problem that will probably be quite easy for you advanced coders. Im using glDrawArrays and Ive got a buffer that holds the texture coordinates and the vertices. All this does is drawing a cube on my screen. Everything works fine, but now I wanted to attach multiple textures to the cube, so the left side can have an other texture than on the right side, for example. Since I put all vertices and texture coordinates in one single buffer I wonder if theres the possibility of using multiple texture with only one call to glDrawArrays. Is it possible to put texture ids into that buffer, too?

    Thank you for any help,

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    You can supply more than one set of UV values and more that one texture for drawing. Are you using shaders or basic OpenGL - it makes a difference how hard/easy this is to do. It is easy with a shader - if the U/V value is < 0.5 select a pixel from the left texture else select from the right texture.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts