Decal on translucent Object

Hey,

i try to get a decal projection on a Glass or translucent object. I´ve searched a lot, and found some older posts about this. Seems years ago it didnt work…

Is this the same today or is it fixed now and there is any trick or tipp how i can handel it?
I´m want a sticker porjection on a Glass Hlafwall.

Thanks
Cheers

1 Like

The issue is that decals require depth to project onto which translucent meshes do not render. You could work around this by having a second copy of the mesh that is “hidden in main pass” and set the material on that mesh to be opaque. It should render depths and give something to project onto but I haven’t tried it yet.

Still nothing?

Tried. Not working

bah, any solution to this yet?

The workaround suggested does work, we use it all the time. The mesh needs a duplicate and it needs to have an oqaque material. It needs to be set to hidden in main pass.

ok thanks, no luck so far but will keep trying.

Yeah i cant get this working at all, frustrating knowing that it works for you guys!

Any other settings we might need to change for this to work?

Well my custom depth visualization just looks like unlit mode so i guess it has something to do with that. No idea how to enable custom depth properly.

I can’t seem to get your suggested workaround to work.

I’m trying to get bullet hole decals to show up on glass meshes on hit events. I duplicated the glass mesh and duplicated it’s material, setting the duplicates material to opaque. I then turned off collision on the translucent glass mesh, and unchecked Render in Main Pass on opaque glass mesh, then rebuilt the lighting. Still not showing up. The impact sounds and particle fx are correctly showing for the glass physical material, but the bullet hole decals not.

Is there something I’m missing?

Hey guys,

Sincere apologies as I apparently gave some bad advice. I was incorrectly remembering how this works. Setting ‘render in main pass’ to be false does not allow writing to regular depth, but it does allow rendering to Custom Depth.

Regular decals will not work with it, but you can use a box mesh and use something similar to “Worldposition behind translucency” but using CustomDepth to replace scene depth. Then you can do you own decal projection in a material.

1 Like

No worries,

Not being able to get this to work actually led me to a much better solution for what i was doing.

Cheers!

Hey guys,

Sincere apologies as I apparently gave some bad advice. I was incorrectly remembering how this works. Setting ‘render in main pass’ to be false does not allow writing to regular depth, but it does allow rendering to Custom Depth.

Regular decals will not work with it, but you can use a box mesh and use something similar to “Worldposition behind translucency” but using CustomDepth to replace scene depth. Then you can do you own decal projection in a material.
[/QUOTE]

Hey.
Could you give more details on that solution ?
I’m actually working on a Water Material, derived from the “Water Plane” free asset, the Ocean one but added Transluceny to it.
I’m trying to add some “wake” behind a ship that would move on the water, and the Decals sounds the easiest way to do it, but as mentionned not working on transperent surfaces.

How can I do the “ghost opaque” mesh solution ?

If its just a water plane, I would just use a plane on the water, and if the water has some displacement, copy the displacement/wave logic into the ‘wake’ material and make sure it just has the same offset.

Heya ! please enlighten us on that better solution! My life depends on it, jk jk!

2 Likes

Would love to hear about your solution as I am facing a similar situation now, thanks!

Hope this helps someone else out!

Problem:

In my situation, I needed an icon to display on a button. When the button was highlighted, I needed the icon to remain visible. I was using decals to display this icon, but was running into the same problem of it disappearing when the button became translucent.

Solution:

To start with my Material, I changed its “Material Domain” from “Deferred Decal” to “Surface” and set its “Blend Mode” to “Translucent”.

I then created a plane slightly above the button and set my icon material to the plane. When I would swap between materials on the button, my icon would remain displayed.

Hey guys,

Sincere apologies as I apparently gave some bad advice. I was incorrectly remembering how this works. Setting ‘render in main pass’ to be false does not allow writing to regular depth, but it does allow rendering to Custom Depth.

Regular decals will not work with it, but you can use a box mesh and use something similar to “Worldposition behind translucency” but using CustomDepth to replace scene depth. Then you can do you own decal projection in a material.
[/QUOTE]

Hello,

Please give more details on your solution.
thanks.

Hi, I’ve tried this and it doesn’t work for me, in fact the “Decal” even gives me an error. Could you put images showing it? or someone who has managed to reproduce the effect can explain with images how he has achieved it?

With respect to the decal, I actually replaced that component with a “StaticMeshComponent” component.

Setting the “Static Mesh” to the plane and the “Material” to the one I mentioned to in the previous post. The icon is then set in the material itself as a Param2D node:

Once set as a parameter, you can either edit it as a material instance or create a dynamic material in your BP to edit at runtime.