Download

Custom Depth Stencil for particle effects?

Hey, so I have custom stencil channels for my objects and got it working fine, but I can’t seem to find any way to define stencils on particle effects?

I know you can set it if it’s placed or in a blueprint, but these are spawned at runtime.

You would have to modify it before it is spawned.

Whatever reference of the particle effect is being passed in before you display it on screen should have a BP method to enable you to change the stencil number.

As I recall, the stencil changes require you to set the mesh to dirty for them to actually be reflected. So it’s really only possible via C++.
Maybe it’s changed since it’s been a year or so. And maybe it was just never that way for niagara since it’s newer.

What are you trying to do? Maybe custom stencil isn’t the best way?

I have various outlines on various actors in my game, using stencils to seperate them for various effects in my post process material. However, one of my particle effects spawns on the destruction of an enemy, so it’s never actually placed. If it’s possible to do via C++ that should be viable though, as I do have a reference to the effect in question on spawn.