Home Technical Talk

Overlaying normals in UT3 material editor?

polycounter lvl 10
Offline / Send Message
crazyfingers polycounter lvl 10
In photoshop you can pretty easily combine normals by simplying doing an "overlay" on one of the layers.

Anyone know any cool tricks for overlaying one normal map onto another in the UT3 material editor?

Replies

  • carlo_c
    Options
    Offline / Send Message
    I use the add node to overlay a detail normal on top of my normal map. I'm not sure if this is the best way or not, but it works for me. You can then just scale the detail normal with the UV input.
  • divi
    Options
    Offline / Send Message
    divi polycounter lvl 12
    the way epic did it in GoW for the detail normals is to multiply the normal map you want to overlay with a constant3 with R1, G1, B0 (normal in A, constant3 in B) and then use an Add with the base normal in A and the overlay in B. they also tiled the detail normal with a TextureCoordinate node, but that's probably not mandatory.
  • crazyfingers
    Options
    Offline / Send Message
    crazyfingers polycounter lvl 10
    rock on guys, sounds simple enough. So i'll just zap away the blue channel of the additive normal and add it into the original.
  • Ryan Clark
    Options
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    Hey guys,

    I'm gonna throw in a word of dissent here, and a shameless plug ;)

    Despite rumors to the contrary, it is not possible to blend normal maps decently using 2D image tricks. Lots of people do it, but it looks awful.

    Those methods never create an accurate result, and they usually throw away a lot of detail. The additive method is probably better than the overlay method, but nether is ideal.


    Here is a quick example to show what I'm talking about:

    Source Normal Map A:
    Input%20A.png



    Source Normal Map B:

    Input%20B.png




    A & B combined using a Photoshop overlay (2D), with blue channel darkened 50%.
    Some details are lost. Others are oriented wrong:

    Photoshop%20Overlay.png




    A & B combined using CrazyBump's mixer (3D).
    Details are preserved and oriented correctly:

    CrazyBump%20Blend.png



    At first glance, the two results look similar. But when you actually render them, the difference is drastic. The overlayed details just look flat.


    3D combination (CrazyBump Mixer)

    CrazyBump%20Blend%20Preview.jpg



    2D Combination (Photoshop Overlay):

    PhotoshopOverlay_Preview.jpg
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Well sure, just make sure that crazybump's mixer can work in realtime and scale its effects with distance of the in game camera and you're golden.

    You are very correct with what you've said, but the benefit of being able to have a few generic material type detail maps which all can tile at a different frequency than the main normal map, and at a different frequency per material is a significant benefit. Unreal's additive technique may work well for it as it doesn't hold pixel values to being only 0-1 in its material system, so as long as the normal map addition occurs before renormalization and application the results should be close to what you've posted. :)
  • Ryan Clark
    Options
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    @Vailias: I hear ya; sometimes versatility is more important than a bit of image quality. In realtime applications, you gotta do what you gotta do!

    Apologies for rambling off-topic... I was only really addressing CrazyFinger's first sentence about the hated overlay trick.

    Just for the sake of completeness, I've added a quick test of the additive method; it's definitely a lot nicer than the PS overlay trick.

    Three%20Techniques.jpg
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    What operations do you exactly do there, Ryan? I'm curious if they would work within a shader as well, since it would seem pretty extreme if you can only do it with C++ (except if it adds too many instructions for a shader).
    Or is it all secret ;) ?
  • SHEPEIRO
    Options
    Offline / Send Message
    SHEPEIRO polycounter lvl 17
    This may be a slight side note BUT can achieve the same results in PS this is how i do it ( i do it here to keep the PS files totally usable, ie no external tomfooolery)



    duplicate the overlay layer put both these layers in a group,

    go into one layers effects menu turn off the BLUE channel and change the filter type to OVERLAY,

    go into the duplicate layers effects menu and remove the RED and GREEN channel and turn the filter type to MULTIPLY

    use a mask or opacity strength on the group to remove what you dont need and duplicate the group to double it stregth.


    this should give you an accurate PS way of using overlays, also Xoliul might help you with your shader work
  • Ryan Clark
    Options
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    Hey Shepeiro!

    This is the result I got from the steps you describe. Is this correct?

    shep_overlay_attempt.png


    ShepAttemptPreview.jpg


    This doesn't look right to me. The details aren't oriented correctly.

    Seriously, you can't do this type of operation in photoshop. It doesn't matter how many layers you use. Photoshop is a powerful program, but it's not much good for vector math.

    You can use 2D blending to make a normal map that looks OK to the naked eye. But it won't look right when you render it.
  • SHEPEIRO
    Options
    Offline / Send Message
    SHEPEIRO polycounter lvl 17
    OH yeah your right, thanks for pointing that out, I had gone about it looking at how i would expect the 2d maths to work, not the vector so yes, bad technique, not quite right
  • Axcel
    Options
    Offline / Send Message
    Axcel polycounter lvl 14
    Wow. That's seem to be much better then overlay in photoshop!

    I only don't understand why in CrazyBump in 3DMixer in default is displacement ON (with depth 50) and what it's doing.

    So CrazyBump mix normal maps better then PS in ANY case?
    What if I just want make normal map stronger? Also CB is better?
  • PredatorGSR
    Options
    Offline / Send Message
    PredatorGSR polycounter lvl 14
    Ryan, can you explain how Crazybump does it differently? In layman artist terms :P?
Sign In or Register to comment.