UV flow affects DBuffer Decal Normals

Hello,

UE version is 5.2.1.

Imagine mesh with different parts having different UV flow direction:

It has Surface, Opaque Material with custom Decal response (Decal Response is None, Tangent Space Normal is On).
DBufferB(WorldNormal) is blended with Normal as demonstrated here:

This surface has mesh decal with Material (Deferred Decal, Blend Mode Translucent, Tangent Space Normal if Off), which has it’s own normal map.

The problem is that normals of this decal got kinda inverted exactly on the border of two parts with different UV flow as demonstrated here:


Also I noticed that if I set Tangent Space Normals to Off, problem disappears, but Normals blending doesn’t work:


Which doesn’t suit me because I need normals to be blended.

Does anyone have any ideas on how to fix this ?
Thanks!

If the material sampling the debuffer has tangent space normals (which it usually will) then you need to ensure the decal is supplying or transformed to tangent space from whatever space it is in.
Try adding a transform node from world to tangent space in the receiver material, since it sounds like your decal is using a world space normal.

Thank you very much! It helped!

So now I have another problem. I would appreciate your help!

In receiving material I transformed dbuffer normals from World space to tangent space like this:

And now decals have kinda frame that can be lighter or brighter than receiving material depending on light angle:

Not sure if this is the problem but it looks like you are adding the decal normal to the regular normal, and then using the blend normal node. So you’re essentially blending the normals twice.

That is likely causing some wrongness in the normals, but I don’t think it’s enough to cause all of what you’re seeing there.

There should be no need to add the normals before the blend node.

Also try toggling “tangent space normals” in the decal material settings.

I’m guessing the normal vectors will be wrong if you inspect the normal buffer again. It can be helpful to put an object like a sphere or cylinder next to the surface you are inspecting so you can compare the normals to a real surface facing the same direction.

(post deleted by author)