Advice to apply decal on translucent surface.

Hello community,
I know that deferred decal can’t be applied on a translucent surface. An alternative would be to tweak the opacity input inside the material, or use a mesh decal directly in my surface geometry.
But is there any workaround if I want to add a bullet impact on a glass sphere?

Buuuuuuump!

hum… a Glass Sphere would shatter if impacted by a bullet…
In fact, most glass would.

As far as rendering a decal on translucent, you would have to mask out the spot or apply a mesh on top of it that has transparency and a mask. depending on the game’s art style this can either look good or look awful.

I would sooner mask the material correctly to handle decals then spawn a plane at the normal impact, but if you are in a bind you can try that.

maybe Help You

Do you have a project you did this in you could upload it to somewhere.
Your solution is not working on my end. I’m sure I am just misunderstanding somthing.

So, the problem is that the decal needs to render into the G buffer, which needs to have the underlying render targets, including depth. The decal projects onto the depth in the depth buffer.
But, translucent objects can’t have depth, because you should still see things behind them! (And other translucent things in front should still let these through.)
So, the best way would be to make each translucent material know about decals, and add a texture overlay for the decal in question, in the shader. This is a lot of work to set up, but it will work in the end.
If that’s not good enough for you, the next step would be to generate a card (quad) to put the decal material on, and place the quad in the world where you want it. Of course, if you do this where there will also be a non-transparent surface, that won’t work perfectly, so you’ll need some way to tell which of the two options (regular decal, or manual quad) to use.