Decals and Normals

Hey all,

I’ve been playing around with decals lately, and am currently playing with a decal material that uses world coordinates to determine tiling and other effects.

The issue I’m running into is that I can’t seem to find any way to get the normal of the surface the decal is being projected on to.

I can see why VertexNormalWS doesn’t work, but I had assumed PixelNormalWS would have returned the proper normal value.

Is there any way to get details on the normal of the surface the decal is being applied to, from the material?

in advance!

Hello Beowulfe,

In order to assist you I’d like to get a bit more info. Could you upload a screenshot of the material editor graph of the decal material being used, and the decal applied within the viewport?

I think you’re trying to have a decal with a material that is able to have it’s own normal map texture blend with the normals of any surface it’s applied to. Is that correct?

If not could you elaborate further on what effect or result you’re trying to achieve? Thank you for your time and I look forward to helping you resolve this issue!

Hi ,
I’m going to add to this question (seeing as the original asker hasn’t followed up. I’m trying to come up with a method to mask out the parts of decals that are
more or less perpendicular to the surface they are projecting onto (masking out the stretching). I have done this previously in another engine that gave me access to a “destination normal” that I could dot product with the decal’s normal. Is there any way to access the world normals of the background in a decal material?

You can access the world normals via a “SceneTexture” Node. Click on the drop down and from the list you should see world normal. This node is compatible with decals but you wont be able to use the normal output with World Normals just keep that in mind.

Here is a super crude example of what you are talking about where the decal will mask out any normals that aren’t facing straight up in the z-axis. (clamp isn’t really necessary in this example just a habit I have)

Sweet! , Ed. I totally forgot about that node.
On the off chance, are there any material nodes that will give the forward normal direction of a decal? :slight_smile:

None come to mind right off the top of my head. You can use a blueprint actor with a decal component with a dynamic material. Then pass in a vector3 based off the forward vector of the BP.

I would have suggested working with the object orientation node, but that isn’t compatible with decals.

Sorry I can’t give a more in-depth answer. We are very busy at this time.

I just started a thread here about world aligned texture / world aligned normal in decals behaving strange and I’m assuming it’s related to the vertex normal WS nodes used in those functions but I dont understand why a decal can not extract the propper vertex normal on the surface it’s projecting it seems to only care about a z up orientation regardless of what orientation or surface the decal is being projected onto.
Here’s my thread if you feel it’d be more appropriate to discuss there because mine is specifically about having XYZ or even just XY world aligned decals.

Other than BP has there been any other method to rotate the decal facing direction discovered yet since the object orientation nod does not work?