How to set up rain effect for outdoors that doesn't affect indoors?

I have a terrain (either mesh based or landscape) with buildings that contain interior spaces. The project is for mobile VR (Android, forward rendering, no HDR, no PP).

I’d like to set up rain effect (mesh particles, no transparency) that works for the scene (rains outside, doesn’t rain inside) and performs well. Is it possible to achieve? How would I achieve that effect ? (in particular, how do I block particles from coming into the interiors without using particle collisions)


Why without collisions? Niagara supports it and it performs great.

That said 1 possible way, post process based, you simply do no render the rain inside instead of turning it off.
Or a variation thereof (fully PP based rain for instance).

Another, define a “spawn”/“no spawn” area to allow the particle to spawn.
you can pass nearly anything to niagara, including information that alters the spawn shape/size.

Yet another, is you place the particle around the map manually. You get more control this way. If you also customize the spawn shape to be a parameter you create you can literally place pixel perfect rain areas all around.
For Vr you may really want this. And also only enable the spawn if character is X distance from it since I’m sure it takes a toll on performance VR wise.

Thats all I can think of offhand.

This video explains it but uses scene depth mesh settings per default The depth has to be set in the meshes which should omit rain particles. I don’t think that this is very resource intensive since you also should add the rain effect to inside the character, so that it follows. I found this to be the most elegant way to avoid rain indoors.

Nice, thanks. Last time I tried enabling distance fields the project ended up taking up much larger amount of RAM than I wanted it to (and disk size also grew). Will give it a spin one more time.

The project is for mobile SoC (QComm 845 min) and the less physics I have the better for performance.

Can’t do PP at all in mobile VR.

I was thinking if there is a way to have like a grayscale texture of the outdoor level that can be used as mask for where to rain and not to rain, but I have no idea how to do it (if it’s even possible). Plus, Niagara seems to be overly complicated compare to Cascade so I haven’t wrapped my head around it yet.

You aren’t wrong. Its more complex because it allows for way more.

the texture is a great idea. You can drive it like this!!

Thanks, I’ll check it out in depth (skimmed it over right now).

Although I want to have rain particle system to be small and follow player. So the texture would serve as global world aligned mask, so to speak, which will affect particles following player when the particle system overlaps parts of the texture that are “no-rain” areas. The video shows texture driven particle system covering entire scene, which I am sure won’t run well on mobile.

Within a materiel that is:
(WPO->RG - LOC->RG) + (CaptureSize/2 (pushes center point)) / CaptureSize.

You can push LOC via material parameter collection.

You should be able to have a limited area, where the fixed overall texture can shift at runtime with that.

Sorry, you lost me on CaptureSize :o (I don’t really do advanced materials :confused:)

It’s just the size of the capture/image make it a scalar parameter you can change if you ever decide to go from 2k to 4k or similar.

You don’t “have” to make it a real time RT, but I would think it easier.

Simply add a “roof” mesh with a special material that is:
A, invisible from below because no normals/one sided
B, invisible to everything but the owner - and make the RenderCapture the owner for all the actors of that class at begin play.

This will generate a RT that is near instant (configure it to only render the specific mesh) in terms of cost.

As a result you can make a moving umbrella :wink:

I’d be willing to collab on this a bit if you need, I have to make the rain system compatible with .26 volumetric stuff anyway now that we are getting close to the release.

Not sure what you can afford cost wise in VR.
Usually a 2k RT with basic GPU sprites costs about 2ms.

The Video that Luminary posted is something that interests me the most. LOve it

Didn’t know about this, but since a few version ago you can actually load up vectorfields to do exactly what you need.
Niagara 105 - GPU Particles and Collision Events - YouTube at 9;53 or so.