Home Technical Talk

Double-sided polygons

polycounter lvl 18
Offline / Send Message
TomDunne polycounter lvl 18
I was talking with someone today about using double-sided polygons in games, and he tells me that it's possible to give different mapping coordinates and textures to each side of a polygon. For example, you could have a rectangular plane with, say, an American flag texture painted on the 'normal' side, and on the reverse side you could map to a different, unique texture - a Canadian flag for instance. The end result would be a single plane (two triangles) which shows an American flag if viewed from the front and a Canadian flag when seen from the back.

Is this possible? If so, in what games/engines?

Replies

  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Er, I've never known that to be possible. You'd need 2 planes (4 triangles) for that to work. If there is some game engine that does this, it'd have to create 2 more triangles at rendertime to display the "backface" texture, I'm pretty sure that's the case. I don't think you can apply 2 different textures to 1 triangle.....
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    not possible to my knowledge, the best you can get is two different colors for each side of a tris, but not textures.
    anything else is just software workarounds that create the backside tris as needed, which imo is perfectly fine. based on my opengl experience
  • Illusions
    Offline / Send Message
    Illusions polycounter lvl 18
    Its entirely possible in 3D Studio Max, using the double-sided texture material, but, not that I know of in games...if it is, its probably a special shader, or engine specific feature...
  • SilentMobius
    Offline / Send Message
    SilentMobius polycounter lvl 18
    Well backface culling (not rendering faces that are facing away from the camera) is totally optional so there's nothing to stop you rendering the same texture on the inside of the face.

    Now you could pass the camera co-ords to whatever shader you were applying any use that to decide which texture to render depending on which side faces the camera. I coded something similar in dx8. A shader that when applied would show the textured tri when perpendicular to the camera but would fade to 100% transparancy when paralell to the camera viewplane (to make tree branch polys fade out nicely as you ceased to face them.)

    So, in raw dx8+ you can do thins, but I don't know how heavy the shader actualy was as I didn't know how to check those things at the time.
  • malcolm
    Offline / Send Message
    malcolm polycount sponsor
    I've never seen this supported in any game yet, we render all polygons as double sided in game but you can only apply one mapping to them, just like in the Maya viewport.
  • tubboy
    Offline / Send Message
    tubboy polycounter lvl 18
    Me either. But it would be handy though.
Sign In or Register to comment.