Home Technical Talk

Normal Mapping double sided polygon

polycounter lvl 11
Offline / Send Message
jocose polycounter lvl 11
I'm wondering if there is anything to watch out for when normal mapping a double sided polygon, like for palm tree leaves, cloth, or something like that. Are there any special considerations when baking and working with double sided polygons or is it pretty straight forward?

Replies

  • DarthNater
    Options
    Offline / Send Message
    DarthNater polycounter lvl 10
    I haven't really done that a lot but I believe both sides are identical to each other.
  • Ben Apuna
    Options
    Offline / Send Message
    This doesn't turn out too well in UDK. I've had normal map lighting get flipped in the old UT3, though it was my fault because I was welding some planes togther like this:

    Double_Sided_01.gif

    I think you might be better off making back to back polygons especially if you lightmap an object. That way the polygons in shadow get real shadows provided they have unique lightmap UVs.

    You can also have unique sides on the texture if you can afford it, bottom sides of leaves usually look different than the tops.

    I think by default most engines backface cull automatically so it's not really adding as much overhead as double sided rendering, though I might be wrong about that.
  • Eric Chadwick
    Options
    Offline / Send Message
    I have sometimes gotten incorrect vertex normals on the automatically-created backfaces, so the lighting was off.
  • EarthQuake
    Options
    Offline / Send Message
    Generally you need to manually duplicate and flip the faces yourself, that will ensure that you get proper lighting on both sides. You can simply turn off culling, but then one side is lit incorrectly, however there may be a shader fix for that as well.
  • jocose
    Options
    Offline / Send Message
    jocose polycounter lvl 11
    Interesting, thanks for the responses everyone.

    I think I will probably just manually flip the polygons, like EQ & Ben suggested, that seams to be the smartest way of going about it because if back face culling is turned on then there is no way your going to see the other side and you wont get any z-buffer issues either. Also eliminates the possibility of having shader hiccups because of the way the engine is handling things.
  • Whargoul
    Options
    Offline / Send Message
    Whargoul polycounter lvl 18
    Normal *= side

    Where side is the shader semantic for front/backface. Works perfectly in all my tests.
  • jocose
    Options
    Offline / Send Message
    jocose polycounter lvl 11
    Yeah actually I did a test in the source engine and it worked fine, still worried there might be a problem though. It seams like the kind of thing that could get screwy depending on how the shader handles things.
Sign In or Register to comment.