-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Hello, NMRIH Devs!
I return after such a long period of time to update you all about the quest to improve the GPU Particle Rain.
From my time digging through the rain_fx.pcf in Left 4 Dead 2, I finally figured out how Valve made it all work, and it's relation to func_precipitation_blocker. It turns out, that using some potentially unique and updated modifiers not present in NMRIH allows them to check for that brush entity, and treat it as a collidable surface.
As these modifiers are not present in NMRIH, I decided to give it a spin and try to make it work nonetheless. After about a week of wrapping my head around the editor and experimenting, I've managed to get it down from a 4-5ms overhead to just 1-2ms overhead on my personal PC when the system is full force. With smart usage of the custom func_precipitation_blocker we have, you can nullify this cost in places that would be unable to view the rain, but is close enough to still trigger it.
I have taken the file to the workshop, and after trialling it throughout my maps under different circumstances, it works well enough without being too heavy on framerate. I'm sure others with lower end machines could review the performance with +showbudget and reveal if it's still too intensive.
One potential path of optimising the particles further MAY be with collision mode "2", as featured in Valve Developer Community - Particle System Constraints, but as the wiki reports it appears to be incorrectly coded and I am unsure if this can be fixed/is already fixed on your end. I believe I am using either "0" or "3" as of right now, or Prevent passing through static part of world. It's been a while since I checked, but I know that this is where I modified the file originally.
Long story short, if this is still performant enough, integrating it into the game would be awesome. And the func_precipitation_blocker is still useful as-is to optimise levels.
A link to the workshop addon I uploaded (if you would like to be able to test it, and see how it works) : Fixed Rain Particle Collision
If there is any feedback, or help or anything I can offer, then please get back to me. I want to see things flourish.
Big Hat Marley