Double Sided Polygons [OpenGL]
ImLeftFooted

How do I put textures on both sides of a polygon in OpenGL? Can I?

I'm doing this for iPhone so technically I'm using OpenGL ES 1.1 and whatever extensions are supported on it.

StevenVI

glDisable(GL_CULL_FACE);

Or are you looking to have a different texture on the back? In that case, use another polygon.

Elverion

I assume you want to use two different textures (one for each side), so disabling backface culling won't work. I believe the only way to do it would be to actually use two polygons. You probably could get away with switching the texture based on perspective (with backface culling turned off), but that would probably require more work and more processing than just using two polygons.

ImLeftFooted

Yes I meant different textures. Cookies except I forgot to set the thread type :P.

Billybob

Putting both textures into one texture and then using a vertex shader to modify the texcoords based on perspective would work too.

Hard Rock
Billybob said:

using a vertex shader to modify the texcoords based on perspective would work too

He said he's using OpenGL ES 1.1

Thread #602018. Printed from Allegro.cc