Page 1 of 2

Blending multiple normal maps

PostPosted: Thu Jan 18, 2018 11:15 pm
by CosmicSeizure
Hi,

i am creating blended shader for our PBR workflow, but i got stuck on a part where i am trying to blend more normal maps together. It has something to do with input/output nodes.

I do regular blending of two first normal maps through "Blend Normals" node, i want to take the result of this blending and blend it again with additional normal map, but before i do that, i want to do scaling on it again ( adjust intensity ).
The output can not be put to new Texture Sampler, because its not "Sampler2D" data, so i am stuck with this XYZ data, which i need to do scaling operation on, just like on regular "Texture Sampler" node on Normal map.
Nodes like "Multiply" and "Scale and Offset" just mess up things.

Attaching image. Main issue seems to be with the "Normals Intensity 1" node and its calculation, its flipping normals etc.

Thanks for any help.

Luke

Re: Blending multiple normal maps

PostPosted: Fri Jan 19, 2018 12:03 pm
by Amplify_Borba
Hello Luke, thank you for getting in touch!

CosmicSeizure wrote:i am creating blended shader for our PBR workflow, but i got stuck on a part where i am trying to blend more normal maps together. It has something to do with input/output nodes.


In order to scale the normal maps outside of the sampler, you must leave the normal's Z out of the multiplication operation, please refer to the following screenshot for a possible way of achieving your intended operation:

BlendNormals.jpg
BlendNormals.jpg (243.65 KiB) Viewed 4180 times


Do note that if you choose to unpack the normals manually, the process will differ from what is shown above.

CosmicSeizure wrote:The output can not be put to new Texture Sampler, because its not "Sampler2D" data, so i am stuck with this XYZ data, which i need to do scaling operation on, just like on regular "Texture Sampler" node on Normal map.


Regarding the Texture Sample, its Tex port accepts only a Texture Object, which allows the use of it's texture UV parameters in the material inspector.

Please let me know if this helps and if you have any further questions, thanks!

Re: Blending multiple normal maps

PostPosted: Wed Sep 19, 2018 12:32 pm
by pdrummond
How would I blend normal maps using a mask? I've tried the Lerp function as that allows me to plug in a mask, but the blend between the two normal maps is very hard. It loses a lot of detail that is preserved when using the blend normals function.

Thanks.

Re: Blending multiple normal maps

PostPosted: Wed Sep 19, 2018 12:51 pm
by pdrummond
Here's a screenshot to illustrate what I mean. The top shows the results of the standard normal blend function. I want to preserve details in this way.

The bottom shows a lerp blend between the two normal maps. The mask is working but the new normal map is replacing the details from the original, rather than blending.

Any help is much appreciated.

Image

Re: Blending multiple normal maps

PostPosted: Wed Sep 19, 2018 1:05 pm
by pdrummond
I have a rough and ready solution which uses a Texture Sampler node defaulting to bump. I first lerp my detail normal to this, applying the mask. I then do a standard normal blend between the results and my main normal map. I'm probably making some stupid mistake so any suggestions will be welcomed.

Re: Blending multiple normal maps

PostPosted: Wed Sep 19, 2018 1:09 pm
by Amplify_Borba
Hello!

You can lerp normal maps, just be sure that the end result is normalized.

There's also the possibility of using a Layered Blend node for this effect as well.

Please let me know if this helps, thanks!

Re: Blending multiple normal maps

PostPosted: Wed Sep 19, 2018 1:15 pm
by pdrummond
I'll try using normalize. Will this work with the output of a layered blend mode?

Thank you.

Re: Blending multiple normal maps

PostPosted: Wed Sep 19, 2018 1:42 pm
by Amplify_Borba
No problem! Yes, it should work in the same manner, although its output will always depends on the data it receives.

Re: Blending multiple normal maps

PostPosted: Wed Sep 19, 2018 6:02 pm
by pdrummond
I couldn't get the normal maps to blend correctly with lerp, but I found a workaround. Thanks for your help. I now have the beginnings of a reasonable skin shader.

Image

Re: Blending multiple normal maps

PostPosted: Thu Sep 20, 2018 7:50 am
by Amplify_Borba
Thank you for letting us know that you've found a workaround, the final result looks pretty good!

If you don't mind hinting at how you've solved this situation, it could be helpful for other members of the community who might struggle with the same problem.

Please let us know if you have any further questions, we'll be happy to assist, thanks!