Home Technical Talk

Tangent Vs World Normal Map?

polycounter lvl 8
Offline / Send Message
dogzer polycounter lvl 8
I'm using topogun to bake normals, and I don't want to be so sloppy when baking normals anymore.

There's something in particular that I'd like to know how to solve.

I've noticed when baking world space normals, a cube gets baked nicely.

But when I bake tangent space normals, which is what I need for Unity, I get the averaging problem thing, which I don't know how to solve in topogun.

Anyone knows how to solve this? Is there a way to create normal maps that are as good as world space, in the form of tangent-space so I can use them in Unity?
thanks!

normalmap.jpgnormalmap2.jpg

Replies

  • m4dcow
    Offline / Send Message
    m4dcow interpolator
    Well Worldspace normals aren't widely supported in game engines, not in UDK or Unity, I'm not sure about CE3 personally.

    But in that example you show, you have the UV shells seperated but all the edges softened/in the same smoothing group. If you harden those edges each shell will look like the center shell in the worldspace normal map, and should work alot better.
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    Tangent space normals are a comparison between your high and low poly's normals. so the Normals of both directly effect the result. The gradients are correct and should be present. the thing is Unity doesn't do normal maps the same way as topogun (neither is wrong, and this mismatch is a very common problem, its a math thing)

    What you need to do is use a baker that supports Unitys way of doing tangent space maps.

    http://www.polycount.com/forum/showthread.php?t=95484
    unityTangentSpace.png

    using that plugin with XN should get you results comparable to world space normals

    The reason worldspace normals are not commonly used is that they explicitly set the normals of an object in relation to the world. Regardless of the orientation of the object the normals will always face in the same world direction and your shading will go all wacky. This makes them largely useless for what you want.

    also you need to add padding to your normals or there will be seams all over the place
  • Racer445
    Offline / Send Message
    Racer445 polycounter lvl 12
    just a note: when using the maps in object space, the objects can rotate and still maintain proper shading: http://wiki.polycount.com/NormalMap?highlight=%28%5CbCategoryTexturing%5Cb%29#Object-space_normal_map
  • dogzer
    Offline / Send Message
    dogzer polycounter lvl 8
    Thanks! It gives great normal baking!
  • Bek
    Offline / Send Message
    Bek interpolator
    From reading the wiki linked by Racer445 it would seem tangent space normal maps would be used most of the time (which they are..), but the limitations of Object Space do not seem that horrible to me? I'm sure there would be some circumstances where using an Object Space map would be better than tangent? I'm no expert at this thing but it's curious that you never seem to see Object Space maps in use?

    Actually, what game engines support Object (or even world) space normal maps?
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    the limitations of Object Space do not seem that horrible to me?
    With a synced workflow they loose 90% of their advantage over tangent space normals, and they're harder to work with.
  • Warheart
    Offline / Send Message
    Warheart polycounter lvl 17
    object/world space normal maps also do not work with deforming models so characters or props with skinned moving parts or props/vehicles that use blendshapes for damage deformation etc. have to use tangent space normals.
  • r_fletch_r
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    Object space maps can be made to work with deformable meshes. 8 Monkey labs did it in darkest of days
    I'd say non bone deformed meshes would indeed be problematic though
  • EarthQuake
    r_fletch_r wrote: »
    With a synced workflow they loose 90% of their advantage over tangent space normals, and they're harder to work with.

    Yeah more like 99% of the advantage. =P
    r_fletch_r wrote: »
    Object space maps can be made to work with deformable meshes. 8 Monkey labs did it in darkest of days
    I'd say non bone deformed meshes would indeed be problematic though

    Correct, there was also a Battlefield(BF:Vietnam?) game that used OS maps exclusively for character meshes.... Just throwing that out there before someone pops in and says "oh but you can't use it for soft deformation".

    You can animate object space maps just as well as you can tangent space, your shader needs to take the deformation into account. Which may be a little more expensive, but you save by not needing to store normals, bi-normals or tangents.

    You can also mirror object space assets too, just need to have a shader smart enough to do it, which can be as simple as offsetting your mirrored geometry 1 unit to the left to "tag" it as mirrored.

    All that said, its really not commonly used, and synced up tangent space normals are much, MUCH better.

    OS Pros:
    1. 100% accurate shading in all situations
    2. No need to store normals etc(frees up memory)
    3. Uses less geometry than broken TS(common) workflows
    4. Can handle compression better(less gradients)
    5. No "resolution based" artifacts like synced up tangent workflow gives you(no enough resolution to account for thin triangles/gradients).

    OS Cons:
    1. Mixing/Adding painted bump detail is difficult
    2. No mirroring without a shader that accounts for it, even then mirroring is more work in setup. Texture re-use in general is more complicated.
    3. Rotating props must be done in a game engine that keeps track of transformation, otherwise you need to rebake if you rotate your model. Limits the ability of using a 3d program as a level editor.
    4. Can't replace tiling tangent space textures. Only suitable for unique props really.
  • Millenia
    Offline / Send Message
    Millenia polycount sponsor
    Skyrim also uses object space normals for character models. Armour/weapons are in tangent space though.
  • EarthQuake
    Millenia wrote: »
    Skyrim also uses object space normals for character models. Armour/weapons are in tangent space though.

    Which is really, really strange and backwards.

    Organics that are generally soft and mushy can handle broken tangent space more easily, while precise hard surface work suffers more from broken tangents(steeper angles accentuating smoothing errors etc).
  • Millenia
    Offline / Send Message
    Millenia polycount sponsor
    I think they did it to avoid seams between the head and the body. I haven't experimented with object space in that game, but if you can use them for custom models it would be pretty cool :D
  • cw
    Offline / Send Message
    cw polycounter lvl 17
    Millenia wrote: »
    I think they did it to avoid seams between the head and the body. I haven't experimented with object space in that game, but if you can use them for custom models it would be pretty cool :D

    Seams between head and body are fixable using TS maps and edited vertex normals, but maybe it was somehow simpler for their engine limitations to use OS maps.

    Strange choice though, if it was a choice. :)
  • Bek
    Offline / Send Message
    Bek interpolator
    Could someone elaborate on what is meant by "synced up tangent space normals" ?
  • cryrid
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    synced up in short: baker uses same data for encode as real-time shader to decode normal map. Sadly that is not sooo often the case..
    http://pixeljetstream.blogspot.de/2012/06/tangent-space-can-cost-extra-money.html
Sign In or Register to comment.