Stop rain/snow from falling through pieces of environment?

Feedback on past, current, and future development.
Chris
Posts: 1597
Joined: 04 Sep 2011, 08:33

Re: Stop rain/snow from falling through pieces of environmen

Post by Chris »

CMAugust wrote:A top-down projection doesn't sound like it can account for particles blowing sideways, for one thing.
The projection can be tilted if the particles are falling at an angle. It wouldn't work too good when it's at flatter angles (particles would get blocked by things on the ground near the edges of the loaded cells, and very rarely appear around the player), but it should be fine as long as it's mostly downward-facing.

In the case of Skyrim SE, it's also possible they're using DX11 ComputeShaders (OpenCL for us) to have GPU-accelerated particles with collision detection.
CMAugust
Posts: 278
Joined: 10 Jan 2016, 00:13

Re: Stop rain/snow from falling through pieces of environmen

Post by CMAugust »

Thats interesting; thanks for the added clarity. Is a GPU-accelerated particle solution via OpenCL also worth a look-in? I don't know if it's considered overkill for OpenMW, but next to Scrawl's ambitions for water post-1.0 it doesn't sound too far-fetched.
Chris
Posts: 1597
Joined: 04 Sep 2011, 08:33

Re: Stop rain/snow from falling through pieces of environmen

Post by Chris »

CMAugust wrote:Thats interesting; thanks for the added clarity. Is a GPU-accelerated particle solution via OpenCL also worth a look-in? I don't know if it's considered overkill for OpenMW, but next to Scrawl's ambitions for water post-1.0 it doesn't sound too far-fetched.
At some point, perhaps. The main issue is that Morrowind uses fairly large "clumps" of raindrops, dust, and snowflakes per particle, so you'd end up seeing a bunch of them blink out of existence when the particle it's connected to is killed. You'd also get those clumps getting through smaller areas because the particle ended up making it through, bringing the whole texture with it. I don't know how Skyrim SE handles that though, whether it just uses more but smaller particles or if it exhibits these drawbacks, as I've never taken a close look at it.

The depth map approach allows for finer detail when particles have relatively large texture faces, and it also works with alpha-tested textured surfaces -- e.g. a flat quad that has a texture with a hole in it, can allow precipitation through the hole since that part of the texture isn't rendered in the depth map, while physical collisions would see a flat surface where you can see a hole.
CMAugust
Posts: 278
Joined: 10 Jan 2016, 00:13

Re: Stop rain/snow from falling through pieces of environmen

Post by CMAugust »

Perhaps Skyrim SE isn't so different after all. It is possible to see the occasional raindrop falling through holes and gaps in the ceiling (the same is true of Fallout 4), as you describe. Unless the individual particles are just really really small.
User avatar
Pherim
Posts: 140
Joined: 27 Aug 2014, 15:37

Re: Stop rain/snow from falling through pieces of environmen

Post by Pherim »

CMAugust wrote:Perhaps Skyrim SE isn't so different after all. It is possible to see the occasional raindrop falling through holes and gaps in the ceiling (the same is true of Fallout 4), as you describe. Unless the individual particles are just really really small.
As far as I know (can't check right now) it does use much smaller rain particles so yes, the detection is more accurate than in Morrowind with MCP. So all we need is replace the rain in Morrowind with more and smaller particles. The original Morrowind has an ini setting for the maximum number of raindrops, so it would seem all that needs to be done is make a thinner rain mesh and increase the number in the ini... :roll: great, now I have to check that. :D

edit: yes, it's possible, no problem. Resizing the rain mesh diameter to half the original value already significantly reduces clipping. Of course, I only made this very quickly in NifSkope, which also made the individual raindrops thinner. But with a properly edited mesh this should work nicely. The same goes for snow, I guess.
User avatar
jayhova4x4
Posts: 11
Joined: 12 Jul 2017, 06:41
Location: Houston, Texas
Contact:

Re: Stop rain/snow from falling through pieces of environment?

Post by jayhova4x4 »

The most jarring example of where weather does not collide with objects is inside the canton tunnels in Vivec. Seeing rain inside the tunnels destroys immersion. My $0.02
User avatar
wazabear
Posts: 44
Joined: 13 May 2020, 19:31
Gitlab profile: https://gitlab.com/glassmancody.info

Re: Stop rain/snow from falling through pieces of environment?

Post by wazabear »

Took a gander at this using the top-down orthographic depth camera approach. Results were pretty good, there are some small issues I need to iron out. Of course this meant I had to switch to shaders for the weather particles. I managed to get it running, but it became immediately evident OSG might be doing something not so smart by default as my performance tanked. This definitely shouldn't happen. Anyways, it was just a quick look to see how this approach would fair and it convinced me to actually implement this with a followup MR.

One immediate issue is emitter volume. If you're looking through a long tunnel, for example, you won't see any rain on the other side as the volume for particle emitter is not large enough to cover the entire span. You don't notice this without occlusion because you always have particles in your face!

My recordings weren't picking up the rain very well so I just switched to something that clearly shows the occlusion at work. Here are a few sneak-peaks.

animated:
https://streamable.com/pdl59v

large scale:
https://streamable.com/olzp5g

alpha tested:
https://streamable.com/j2d2c1

I should also note this works independent of particle system / weather. We don't have a proper wind simulation in place, so occlusion depth camera is hard-coded as a top-down orthographic projection.
Fade away and radiate
CMAugust
Posts: 278
Joined: 10 Jan 2016, 00:13

Re: Stop rain/snow from falling through pieces of environment?

Post by CMAugust »

This is really, really cool.
User avatar
wazabear
Posts: 44
Joined: 13 May 2020, 19:31
Gitlab profile: https://gitlab.com/glassmancody.info

Re: Stop rain/snow from falling through pieces of environment?

Post by wazabear »

Yes it's cool but it means that particles need to span your entire view distance now, which is a major problem actually. As is, you'll have really weird scenarios where particles are occluded but you see no particles in distance. Areas with thick spots of trees are a common scenario. This is because there literally aren't any particles that far away. Accounting for this by increasing emitter volume isn't a scalable solution, so a blocker for this is some kind of modern particle system handler. AnyOldName3 suggested something along the lines of a compute shader nodekit, and while it wouldn't offer the largest range of support I think it's the way forward. Unless there are some smarter ways to deal with this issue, this will have to wait until such a system is implemented I think.

The solution can't just be for rain either, it would have to supplement our other nif-based weather effects.
Fade away and radiate
Post Reply