Home Technical Talk

Retrieve normal maps difference

polycounter
Offline / Send Message
Davision3D polycounter
This might be rather simple but I can't figure this out. I have 2 normal maps where the only difference is that one has more cracks. Now I want to somehow make a normal map out of these which is only the cracks, the cracks on flat.

The first thing that pops to mind is to just use difference in the Photoshop layer options but that doesn't do the trick. I'm kinda lost here, maybe it is not even possible after all?




Replies

  • Scruples
    Options
    Offline / Send Message
    Scruples polycounter lvl 10
    It's definitely possible, but I'm sure there's a better way than the Janky way I did it.

    Copy and paste your red and green channels from your two normal maps into different layers. Blend the two red channels using Subtract, and put them in a group. you'll notice you only get the + side of your red channel, that's why you now have to duplicate the group and invert the Red channels, this will give you the negative side of the red channel. I tried combining the channels with a screen @ 50% opacity, and for some reason instead of middle grey being 128 it was @ 108, I dunno, repeat for the Green channel.

  • JedTheKrampus
    Options
    Offline / Send Message
    JedTheKrampus polycounter lvl 8
    Here's the result I got from Krita.



    I got this by taking one of the normal maps, inverting the red and green channels with two filter layers set to Copy Red blending mode and Copy Green blending mode respectively, then putting the other normal map on top of it in Combine Normal Maps blending mode. You can take a look at the .kra here: https://dl.dropboxusercontent.com/u/15437561/krita_normalmap_difference.kra

    Because it uses reoriented normal map blending to combine the normal maps, this method gives superior results to the Photoshop way. If you have another utility lying around somewhere that also does reoriented blending (surely there's a PS plugin for it around somewhere) you could do it with that, although it would be a little more destructive.

    Edit: if it's not swizzled the right way and looks wrong and stuff you can switch them and the result is a different.
  • Davision3D
    Options
    Offline / Send Message
    Davision3D polycounter
    Thanks! Also a good reason to check out Krita.
  • huffer
    Options
    Offline / Send Message
    huffer interpolator
    Why exactly do you need only the cracks on flat color, if you don't mind me asking?
  • Davision3D
    Options
    Offline / Send Message
    Davision3D polycounter
    huffer said:
    Why exactly do you need only the cracks on flat color, if you don't mind me asking?
    I'm experimenting with blending in things by vertex colors in UE4. Here is a work in progress:
     

  • beefaroni
    Options
    Offline / Send Message
    beefaroni sublime tool
    Woah that's looking cool. Do you have a showcase thread for this yet?
  • Bek
    Options
    Offline / Send Message
    Bek interpolator
  • Xenobite
    Options
    Offline / Send Message
    Xenobite polycounter lvl 5

    did the same thing but in Adobe AfterFX


    Important! - Project MUST be in 32 bit mode

    so...

    first we substract version without cracks from version with cracks (layers 2 and 3)

    and then add top layer which is "flat" normal color

    you can use similar workflow to extract bounced lighting, caustics and shadows from 3d renders

    32 bit mode is important as it will allow you to use values below 0 (negative values)

    by substracting "non cracked" texture from "cracked" you get differences in images in values from -1 to +1
    and then on top we ADD the bland flat normal texture so you get real differences between cracked and non cracked texture (isolated cracks) applied to the "flat" tetxure


    @Scruples - you didnt get expected value from Screen as it is using different blending formula:
    invert ((inverted textureA) * (inverted textureB))
    instead of simple A+B
    ;)

  • RN
    Options
    Offline / Send Message
    RN sublime tool
    That's very interesting.
    Another approach, if you're certain that every pixel in the textures except the cracks match, is to write a simple GIMP Python-Fu script to compare each pixel in two layers and make a third layer with the pixels that don't match (based on one of the layers, like the topmost one for example).
  • cptSwing
    Options
    Offline / Send Message
    cptSwing polycounter lvl 11
    A belated thank you for the tip @Xenobite , saved me quite some time today.
Sign In or Register to comment.