Home Technical Talk

The correct method to combine/mix/overlay normal maps?

I just found this guide on how to combine normal maps: http://www.moddb.com/groups/udk-developers-group/tutorials/photoshop-combining-normal-maps

And it's completely different from how I've done it although the results don't differ all that much but it's still noticeable. Is there a correct method to combining normal maps in Photshop/any image editing program? Is the guide wrong?

Replies

  • Bartalon
    Options
    Offline / Send Message
    Bartalon polycounter lvl 12
    I just use this because it does all that fancy color channel modifying for me.

    http://www.planetinaction.com/software/ncombiner.htm
  • Farfarer
    Options
    Offline / Send Message
    Doing it in Photoshop is generally a bad idea - it doesn't handle vector maths particularly well.

    I've written a Unity script to combine normal maps using Reoriented Normal Map method as outlined here;
    https://gist.github.com/Farfarer/4761486

    I've also put it into a really simple standalone exe, which I could upload if you like.
  • Demian Wright
    Options
    Offline / Send Message
    Farfarer wrote: »
    I've also put it into a really simple standalone exe, which I could upload if you like.
    I would appreciate that. I just tried ncombiner and that also produces a different result when compared to the others.
  • shogunato
    Options
    Offline / Send Message
    shogunato polycounter lvl 12
    Farfarer wrote: »
    I've also put it into a really simple standalone exe, which I could upload if you like.

    Can we use it without Unity ?

    What do you think of this method ?
    http://vimeo.com/8025133
  • Deadly Nightshade
    Options
    Offline / Send Message
    Deadly Nightshade polycounter lvl 10
    When I posted that tutorial, I used to do that in Photoshop with an action (and prior to that: In CrazyBump). Today I use nDo2.
  • Farfarer
    Options
    Offline / Send Message
    shogunato wrote: »
    Can we use it without Unity ?
    Yeah, it's a really simple Python script that's been built into a standalone executable. Does the same thing the Unity version does but faster (as I can do the entire pixel array in one go using numpy).

    There's no visual component to it - I wrote it in a rush for a specific task - but it combines them fast enough that you should be able to just edit the detail strength and hit combine again.

    At some point I'll get around to writing a proper GUI for it with texture previews and such...

    http://www.farfarer.com/temp/rnm.zip
  • WarrenM
    Options
    Offline / Send Message
    What I usually do is level the blue channel of the overlay to 128, and then set it to Soft Light blending mode. Good enough. :)
  • shogunato
    Options
    Offline / Send Message
    shogunato polycounter lvl 12
    many thanks Farfarer :)
    it is supporting 16bit float ?
  • Farfarer
    Options
    Offline / Send Message
    Ehr, I don't actually know :P It won't save to 16bit, I know that... but I'm not certain if it'll load them.

    It was written in about 2 hours for a specific task - so it's not particularly polished.
  • pasha_sevez
    Options
    Offline / Send Message
    pasha_sevez polycounter lvl 13
    There's a pretty easy and completely correct (from mathematical point of view) method to combine two normal maps in PS. Say, layer A is basic NM, layer B is detail NM. So to put detail from B over A you have to do the following steps:
    1. Clone layer B - B2
    2. Go to blue channel of B2 and fill it with neutral gray.
    3. Set B2 layer blending to Overlay
    4. Select original B and set it to Multiply blending mode.
    5. Select red and green channels of B and fill them with pure white.
    6. Put B and B2 into the new group, use group mask and opacity to adjust blending.

    7 (Optional). If your target engine doesn't perform runtime NM normalization - you have to do in manually using for example Xnromal's plugin. But actually everything always works fine even without normalization.

    This method works flawlessly with any bit depth and doesn't require any standalone utils. Good luck in normal maps compositions ;)

    P.S. Here's an action I use all the time.

    http://l.sevez.net/NM_COMB
  • Demian Wright
    Options
    Offline / Send Message
    Farfarer wrote: »
    Yeah, it's a really simple Python script that's been built into a standalone executable. Does the same thing the Unity version does but faster (as I can do the entire pixel array in one go using numpy).

    http://www.farfarer.com/temp/rnm.zip
    Thanks. This one also produces a slightly different map but it's still close to the rest.
    There's a pretty easy and completely correct (from mathematical point of view) method to combine two normal maps in PS. Say, layer A is basic NM, layer B is detail NM. So to put detail from B over A you have to do the following steps:
    1. Clone layer B - B2
    2. Go to blue channel of B2 and fill it with neutral gray.
    3. Set B2 layer blending to Overlay
    4. Select original B and set it to Multiply blending mode.
    5. Select red and green channels of B and fill them with pure white.
    6. Put B and B2 into the new group, use group mask and opacity to adjust blending.

    7 (Optional). If your target engine doesn't perform runtime NM normalization - you have to do in manually using for example Xnromal's plugin. But actually everything always works fine even without normalization.

    This method works flawlessly with any bit depth and doesn't require any standalone utils. Good luck in normal maps compositions ;)

    P.S. Here's an action I use all the time.

    http://l.sevez.net/NM_COMB
    This is the method I'm currently using.

    I'll do some more Googling and maybe post my results in a new thread.
  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    Typically I just got into my blending options of my overlay and disable the blue channel. Usually turns out fine. I know there's another method of using a 255,255,128 color overlay set to linear burn, with the layer set to linear light at 50% fill (this is nDo2's overlay process), but that takes a bit longer for me to do without an action so i default to the other one. Im not one to really nitpick at the maths.. usually those two turn out fine for me.
  • Farfarer
    Options
    Offline / Send Message
    It all seems a bit mental to me that such care us taken with getting perfectly synced bakes and then the maths is just thrown out when it comes to blending normal maps together.
  • Osires
    Options
    Offline / Send Message
    For those that do care about correctness and not losing detail there is correct way to do this, you can find all the details at http://blog.selfshadow.com/publications/blending-in-detail/. Apologies, it's a bit math/code heavy but it gives you an idea of where all the other methods go wrong and has lots of examples and images.
  • Amsterdam Hilton Hotel
    Options
    Offline / Send Message
    Amsterdam Hilton Hotel insane polycounter
    Farfarer wrote: »
    It all seems a bit mental to me that such care us taken with getting perfectly synced bakes and then the maths is just thrown out when it comes to blending normal maps together.
    everyone works differently but in my work, most of the time, the things i end up adding to normal maps post-bake are tertiary surface noise or very small details like text or scrapes. it's not as important if those things aren't mathematically perfect. they just get the overlay filter in photoshop with the blue channel knocked out and they end up looking fine because they aren't describing any major surface changes. having a non-synched bake on the other hand generally results in very obvious, large visual artifacts.
  • Demian Wright
    Options
    Offline / Send Message
    having a non-synched bake on the other hand generally results in very obvious, large visual artifacts.
    What exactly do you mean by synced normal maps?
  • Fingus
    Options
    Offline / Send Message
    Fingus polycounter lvl 11
    To my understanding synced normal maps mean that the tangent bias that the normal map baker uses matches the one that the game engine uses. Different programs have different ways of how the lowpoly's normals effect the normal map. Very math'y.
  • Steppenwolf
    Options
    Offline / Send Message
    Steppenwolf polycounter lvl 15
    I just use the overlay normal action from ndo 1. One click, quick and easy. Then i make a mask for the top layer with only the details that i want to avoid that the whole normal map is affected. Because even if its not visible with the naked eye it slightly changes everything otherwise.
  • leleuxart
    Options
    Offline / Send Message
    leleuxart polycounter lvl 10
    Like Fingus, most of my overlayed normal maps are tiny noise details that don't really define any large shapes. I just set it to overlay with the Blue channel off, then merge them and normalize with the xNormal plugin.
Sign In or Register to comment.