[Niagara 4.25] Particle Decals Mini Tutorial

That is WICKED :smiley:

1 Like

deferred decal was too heavy, so, for translucent, additive material. awesome!

1 Like

https://www.youtube.com/watch?v=jyzg3tNjcis

Works like a charm! Thanks Niels :sparkles:

2 Likes

I discovered a small issue in the material.

We need a saturate node here before the sine to avoid repetition in the z-mask
image

I changed the original post, but if you followed the tutorial before I recomend fixing this.Otherwise you will notice weird problems near steep edges etc.

in this way to create decals how to set something like character do not affected by decal ?

1 Like

The material in its current form cannot exclude actors. You could probably extend it to allow for exclusion using depth stencils, but in cases where a specific actor should not be projected on, standard decals should probably be used.

For anyone wondering how to resolve the decal smear (to a degree) I asked my coworker for an assist and wanted to share the knowledge.

I was getting the left hand result with the above and wanted the right hand.

This addition to the bottom portion of the material will get you the right hand version

Add this to the bottom portion of the material and multiply it by everything previously going into opacity. So your new material should look like this:

Hope it helps someone :smiley:

23 Likes

Hi, just wanted to acknowledge the reply here.

This will probably not work for people using the forward renderer (mobile, vr, etc), you can use the z mask of the shape to adjust fadeout and limit decal stretching in that case.

This method also doesn’t work if you rotate the decal over another axis than the z-axis. You can transform the world normals to local space to solve that!

Thank you Shannon for this valuable addition! :fire:

1 Like

Oh good to know, thanks for the info. I’m finding it really hard to tell what will and won’t work for VR/mobile actually. Is there a guild/rule of thumb/ anything that’s helpful in discerning what will and wont work? Also, is there another implementation that WOULD work for mobile that doesn’t have the smearing?

It IS really hard to know what works and won’t :smiley:
Both VR systems and Mobile don’t have that much runtime memory to work with, so deffered rendering would be a huge hit on that (if it works at all). That rule might not hold very long though with the speed at which they change…

If you don’t have the g-buffer available your best bet I think, is to limit the thickness of your decal.
You could also try tri-plannar projection based on the differentials, but that will probably give you hard edges.

I think the derivatives might still work? I think this method here might be more expensive shader wise, but could work?

----->

1 Like

You’d have to use the partial derivatives of the WorldPositionBehindTranslucency (if that is even possible)
right now you are recalculating and using the normals of the source mesh, so a simple vertex normal node would give you the same result.

1 Like

Hi, i’m new in unreal engine i try step by step follow your instruction and found out my WorldPositionBehindTranslucency node is different… any idea how to fix this?


BTW many thanks for great tutorial

Oh, maybe you have a different version of the engine.

Does the material not work with this node?

Thanks for the fast reply, it seems like my version is bit different (currently, 4.22.3) the niagara looks a lot different also no emitter state, maybe my version isn’t great for niagara :frowning:

1 Like

Ah, yes, Niagara hasn’t been super stable until 4.24.

If it is possible however, I would suggest updating all the way to 4.26 as niagara is a lot more stable and easier to use, as well as having most of the features that where available in cascade implemented.

Hey, thank you for your tutorial!
Is it also possible to blend these material “decals” on meshes with transparent materials?

Both deffered decals and these material decals are unable to render on transparent materials.

  1. These decals are rendered during the seperate translucency pass (same as transparent materials) so there is no way to guarantee the nececary data is available for blending.
  2. Transparent/Additive materials do not write their depth to a buffer, and as such it impossible to reconstruct their worldspace positions.

It might be possible to hack this in very specific situations. Using render targets, you can render a seperate depth buffer in which these objects only render their depth. Then in the decal material, you would use only the smalles depth between pixel depth and this depth buffer.

It’s funny to me no one posted the result of what you said. Derivatives of WPBT function look pretty cool when fed into Tobasco’s idea. I wish I could mix it with some kind of self shadowing. I like the effect on high detail / displacment-ed geometry. Although, I wonder if we get the same effect using just a spotlight.

1 Like

Is it possible to change the axis from which to blend, currently its the up, or Z axis. Is it possible to rotate the object and have it project the texture on a vertical surface, and not to have stretching on a horizontal one?