PDA

View Full Version : using textures with quad strips



Martin_unique
01-07-2003, 06:26 AM
Hello,
I have a set of rectangles with adjacent vertical edges (all rectangles are the same size), and I'd like to use quad strips to render those. However I need to map each rectangle with a possibly different texture, can I still use quad strips for that or do I need to specify a separate rectangle (4 vertices) for each texture ? I wanted to put all this into a vertex array (with mode=GL_QUAD_STRIP), but I don't know how to put the two together. I would appreciate if someone could explain how to go about it.
Regards,
Martin

V-man
01-07-2003, 07:40 PM
It's always 1 texture per primitive.
You can join textures with your own code and upload that to GL. That would give the illusion of each rectangle having a unique texture.

jwatte
01-07-2003, 07:46 PM
You can tile the textures into one large texture sheet.

If that's not an option, then you can play tricks with texturing units to map up to (number of texture units) textures at the same time, by having a small, transparent area in each texture. However, the performance penalty of doing that is pretty severe.

I suggest you sort by texture, and render all quads using a specific texture using a QUADS list, which will use the vertex cache where it can.