Simple rain effect shader

Posted By: MasterQ32

Simple rain effect shader - 03/14/13 12:58

Hey guys,
i developed a rain shader yesterday and i want to share the technique with you wink
Here is a little tech-demo with the shader and setup code.
Have fun with it!

Download here!


The rain itself is a simple effect. The system renderns some cylinder shapes around the camera and uses triplanar texture mapping for the rain texture. Now this texture gets blended additive to the screen. Looks pretty good and eats a lot less power than particles

Greets!
Felix
Posted By: lostzac

Re: Simple rain effect shader - 03/14/13 13:02

Thanks a lot for this, could this also be transformed to handle snow as well ? It would be a lot of help to my rpg weather system
Posted By: MasterQ32

Re: Simple rain effect shader - 03/14/13 13:21

i think it could work (and as i also need some good snow effect i will try to port it for snow also)
Posted By: lostzac

Re: Simple rain effect shader - 03/14/13 13:26

That would be great...Again thanks for this
Posted By: sivan

Re: Simple rain effect shader - 03/14/13 13:53

in theory it could be also used for a fog effect, like the one using sprites moving around the camera.
Posted By: Redoine

Re: Simple rain effect shader - 03/14/13 14:32

Thank you
Posted By: sivan

Re: Simple rain effect shader - 03/14/13 15:31

I can see some horizontal flickering lines, probably the cylinder borders.
Posted By: Hummel

Re: Simple rain effect shader - 03/14/13 16:02

Looks good, but blending the rain additively isn't the best idea.
Blending it the 'default' way should provide better quality and since the pixels differ only in their opacity and not in color the rendering order doesn't matter (shouldn't be a prob to render them ordered if necessary, though). wink
Posted By: HeelX

Re: Simple rain effect shader - 03/14/13 17:29

Beside the horizontal artifacts, it is pretty convincing, even if I mute the demo wink
Posted By: MasterQ32

Re: Simple rain effect shader - 03/15/13 13:08

I found a simple workaround for fixing the noise/artifacts laugh
Use 0.0125 for the rain scaling instead of 0.125
it's not completly gone but much better.

I am currently working on some kind of rain blocker to let rain only fall onto the top level and not below
Posted By: PadMalcom

Re: Simple rain effect shader - 03/15/13 13:10

Hm you could trace upwards and then start/stop rain?
Posted By: MasterQ32

Re: Simple rain effect shader - 03/15/13 14:13

i am working on some kind of "shadow mapping" for the rain
© 2024 lite-C Forums