Corona Layered Material: Normal Map Combine

How are normal maps being combined in Corona Layered Material, e.g. overlay?

I have a Corona Layered Material representing a single texture set of a cellar door. The surface contains wooden and metal elements. In Corona, this material is implemented with a Corona Layered Material consisting of a dielectric (Base) and metal layer (Layer 1). Does the normal map of the base layer need to be piped into the metal layer, OR is the normal map of the base layer the “correct” representation of the bump?




From what I recall bump/displacement only works in the base layer, so you have to overlay all maps there. Unless that got fixed…

Displacement yes,..but also bump? I thought bump has to be propagated to every layer.

I just got some weird results here with the 27.01 V6 build. Will look into this.

I should note, autobump is disabled in the posted images, legacy displacement (2.5D displacement is disabled). Corona version 5.

@steyin, Yes I have heard the same thing, that displacement only affects the base layer, but I have not heard the same about normal / bump. I was under the same impression as what @Juraj described, but maybe @Maru has identified something in the build that is affecting bump performance(?)

@maru did you end up identifying an issue in the build?

My take on this, is that order of bump seems to be based on mask intensity and type, there is a bump overlay/overlap from base layer but I would investigate this further, since displacement works strange for me in v5.



Returning to the 1st post:
If I understand it right (do I?) - there is only one normal map involved in this setup - right? It’s like a “global” normal map for the whole door object. There is no separate normal map for the wood and for the metal?

If so, then I would say the normal map has to be plugged into the layer1 material and that’s all.

I did some simple tests:

  • Create material A with convex bump (bubbles)
  • Create material B with concave bump (the same bubbles, but inverted)
  • Create a layered material which will mix material A and B

The expected would be that setting layer to 50% should result in no bump at all, right? Because it should negate the other bump (the concave bubbles should negate the convex bubbles, or vice versa). But it doesn’t work like that. It looks like it renders something like 50% visible convex bump and 50% visible concave bump on top of each other. This results in having something like fully spherical bubbles visible on the surface. :smiley:

Another thing:
Let’s say that we remove any bump from the layer1 material. The expected would be that there should be no bump visible in the resulting layered material at all, right? Because there is a layer1 material without bump on top of the base material which has bump. It doesn’t work like that. Instead, we are getting some strange tiny bubbles.

I will now report this to our dev team, because right now I am not sure what is right and what is wrong. :smiley:
I would be great to learn about some common use cases of layered mtl with bump - that would help us find the issues and come up with correct solutions.

Update: it’s the same in V5 and V6.

Starter task:
(Internal ID=453249334)





layered-bump.zip (1.89 MB)

I’m providing some renders under the three conditions described in the original post, but with an additional image rendered in Marmoset Toolbag for comparison. In MT, realtime light calculations are determined by the normal map, whereas the displacement map only displaces vertices without affecting light calculations, so you may see some displacement artifacts in the Corona render but not the MT render - there are artifacts in the map itself that are invisible in MT, but not Corona.

The images are meant to emphasize the light response to the normal map - try to ignore differences in color management.

It’s not entirely clear whether the ‘normal (base)’ or ‘normal (Layer_1)’ is more veridical(?)

w6i9Kke.gif

YJj1yGL.gif

@Maru I’ve uploaded the texture set to the private uploader for your convenience, you can see the screen grab posted above for the shader connections.

As far as i can tell, your layered material is composed of wood and metallic materials with distinct mask separating both materials. By not plugging normal map into either base or layer1, you just simply disabling normals details from wood or metal. Frankly, i don’t understand what you’re trying achieve here?

@Romullus, I submitted the texture set to the private uploader if you’d like to take a look for yourself. The question the post is asking is whether it is more “correct” for the normal map to be plugged into the Base Material, Layer 1, or both the Base Material and Layer 1 for a Corona Layered Material. As you can see, the surface response of the material is different under all three of those conditions, but which is the correct method?

The texture set represents both a dielectric and metal surface, i.e. there are not separate textures representing the metal and wood surfaces, the surface is represented by a a single texture set - that is why the texture set is parsed into a Corona Layered Material with two sub-materials: a dielectric and a metal.

Importantly, in the above comparison post, the normal map IS plugged in to either the Base Material or Layer 1, i.e. the post is illustrating the visual difference. Disabling normals from either the Base Material Layer 1 is not depicted.

Romullus won’t be able to see it on the private uploader, as he isn’t a member of the Corona Team (just an incredibly useful, helpful, and invaluable forum member).

PS - and we wouldn’t be able to share it with anyone outside of the Corona team, which is why it is called a Private Uploader after all :smiley:

Oh, Tom, my bad - I forget about this, although it does say so on Romullus’ handle :man_facepalming:

@Romullus, I can send the textures to you, personally, if you’d like to take a look. Otherwise the provided images should give some indication of what I’m trying to achieve.

But of course it is different… and that is expected outcome. If you unplug normal map from wood material, then wood will be rendered without micro details. In your case, the only correct way is to plug normal map into both materials. There’s no other option. It seems that for some reason, you simply overthinking the “issue” :]

That’s right, it is expected that there should be a difference between the three possibilities, however, it is not clear based on the rendered image that plugging the normal map into both the Base Material and Layer 1 is the correct setup; insofar as it does not match the rendered output from Marmoset as well as either the case of when the normal map is plugged into only the Base Material or only Layer 1.

There seems to be some conflicting answers based on the information that is provided on the forum, but my impression was that the logic of how displacement maps behave in a Corona Layered Material (i.e. displacement only affect base material) would extend to normal maps as well.

Hi. This made me curious, so I made some simple test with Corona 5, and based on that it’s clear that bump and normal maps doesn’t work the same way as displacement maps.

If your use two different materials and a black & white mask, it’s easy to see, that bump and normal maps follow the materials as expected, whereas displacement maps unfortunately only works in the base layer.

When the mask is greyscale however, there might be some differences in how the maps blend (like in Marus example). Can’t say for sure, since I haven’t tested this in dept.

Thank you for sharing your findings @PROH, this is precisely why I am posting; because the metalness mask I am using is a greyscale image, not a quantized black and white image.

maybe difference what you may see in marmoset because you need to invert channel on normal map and forgetting this what gives difference in corona?
Also there is topic in bug section how bump rendering different on Intel CPU in corona this also may be the case.