Volumetric clouds occlusion + niagara particles

Hello,

I am trying to create a Niagara rain shaft effect using sprite particles, but I am running into rendering issues when the effect overlaps with Volumetric Clouds.

The setup is roughly this:

  • Volumetric Cloud layer at desired height.
  • Niagara particles spawn from ground level up to around the cloud’s height to represent a vertical rain shaft.
  • The particles use sprite renderers with a rain/rain-streak material.
  • When viewing the effect from above, I would expect the volumetric cloud to occlude/hide the rain particles underneath or inside it.

The problem is that the particle material’s blend mode causes different issues:

  • With Translucent blend mode, the rain sprites render over / hide the volumetric clouds, which is visually incorrect.
  • With Masked blend mode, volumetric clouds correctly hide the particles, but the result looks visually poor. I tried using dithering in the material, but the rain shaft becomes noisy and not good-looking enough.

The ideal result would be: soft-looking rain particles, similar to translucent sprites, but still correctly occluded by volumetric clouds/depth so that clouds can hide the rain shaft when viewed from above or through the cloud volume.

Is there a recommended way to make Niagara sprite particles coexist properly with Volumetric Clouds?

More specifically:

  • Can translucent Niagara particles be made to respect volumetric cloud occlusion?
  • Is there a better material setup than masked + dithering for this case?
  • Should this type of rain shaft be rendered using another approach instead of sprite particles, such as volumetric materials, mesh particles, custom depth, scene depth tricks, or a post-process?
  • Are there any engine settings, material flags, Niagara renderer settings, or known limitations related to translucent particles and Volumetric Clouds?

Any guidance on the correct rendering approach for rain shafts interacting with Volumetric Clouds would be appreciated.

Thank you.

Steps to Reproduce

See screenshots.

Hey there! If you’re looking to get something like this, I wonder if it makes more sense to try and make this as a simple material applied to a cylinder rather than relying on Niagara to create the full volume of this rain effect at a distance. Then maybe as you get closer to these rain columns you fade out the cylinder’s material in favor of the particles themselves.

One big thing to watch out for with translucency is that it, by default, does not output depth. You have to opt into that in the material itself, and this should help block pixel evaluation behind the surface.

Another thing that might be biting you is the Pixel Coverage mode of the sprite renderer. It could be that the engine is looking at the size of your rain particles and going “eh, I don’t think we actually need to render that”.

If we were just talking about translucency, I’d say we could look at Custom Depth tricks but I was having an awful time trying to properly sample the Custom Stencil scene texture within my cloud material. I’m not sure that’s the way to go here.

Thoughts?

Hey thanks for the answer and recommendation. I was initially sampling the clouds data to only spawn niagara particles where there is a cloud but for visual clarity I went with a simple cylindric shape to better display the issue. However the real issue here is the fact that the translucent mode doesn’t output depth as you said so I am still looking for a way to write to the same depth buffer or anything. We have flying objects that require air maneuvers and from several angles and POVs it quite doesn’t cut it to have a rain shaft effect that blocks out quite a lot of the clouds, especially when there are a few but big clouds in the level kind of like in the screenshots I shared. Could you maybe tell me more about the custom depth tricks or would there be any other way if this is not the way to go?

Have you tried enabling “Output Depth and Velocity” on the material itself? That should at least make sure the particle is outputting to the depth prepass. You’ll need to tune the Opacity Clip Mask value, since that’s what the engine will use to determine which values to draw into the depth pass.

As for the custom depth tricks, I couldn’t for the life of me sample the custom depth texture correctly. It would seem like the view that was drawing to custom depth wasn’t matching up with the view used by the volumetric clouds even though I confirmed that Screen Position’s UVs matched up to the viewport itself.

Any chance you’d be able to zip this up into a repro project for me to take a look at? I want to make sure I’ve got everything configured right as I’m having trouble reproducing the kinds of issues you’re seeing here. I can convert the question to private if you’d prefer.

You’d have to ensure that both the volumetric clouds and the directional light are set up to cast cloud shadows. I believe that’s disabled by default as it’s quite expensive.

I have enabled “Output Depth and Velocity” and tried to play with “Opacity Mask Clip Value” but there was no visual changes. They don’t seem to be occluded by the volumetric clouds.

As you can see with a different version of my previous effect and a square shaped local cloud it still hides the cloud and we can also see that the shadows of the cloud are not projected on the particles as well. There are no changes at all using your recommendation, I tried values from 0.0 to 1.0.

Also, this is a new question but is there a way to make the particles receive shadows from the clouds as well since as you can see from the screenshots they are not affected?

With further research and testings I found out that enabling “Apply Cloud Fogging” exactly does what I was looking for. Now the material is correctly occluded by the volumetric clouds.

Now would you have any answer for my last question regarding the shadows not being projected onto the particles?