0

I've a rectangle with a texture. This shape is a play card.

Like a play card, i want to use a texture for the front face and a different one for the back face.

I've tried with texture combiners (glTexEnvf) but this is not what i need for my task. When rotate the shape, the two texture are mix each other, ant not one over the other.

there is a way to overlap two distinct texture (front and back) in a single shape (square or rectangle)?

Thanks in advance!

Giacomo
  • 1
  • 2
  • Why don't you just draw the quad twice with different textures? One with backface culling and one with frontface culling enabled. – Jonas Bötel Apr 27 '12 at 10:35
  • Yes ok! is as solution... but for rotations and translations i must manage (repeat) two object! You know other solutions? – Giacomo Apr 27 '12 at 10:39

1 Answers1

0

You can do it nice and easy with shaders. In the shader, use the normal transformed to camera coordinates and pick from one of the 2 textures based whether the notmal is pointing towards or away.

CuriousChettai
  • 1,862
  • 1
  • 12
  • 10