rain

Started by
7 comments, last by french_hustler 11 years ago

i have been making an engine for a long time now , and now i want to put rain into it , i have seen a lot of tech demos which show you how to do rain , and i understand it .

via geometry shader.

i not want to make the whole enviroment do rain cause that would not be cost effiecent .

and this is my stumbling block at the moment , what the best way to do this

Advertisement

Are you talking about rendering rain drops in the air? Or something else?

2d? 3d?

For rendering rain drops in a 3d engine, generally this could implemented with a "scrolling" cube of particles that is positioned to fill the current view frustum. There is a good article in ShaderX7 about this ("Dynamic Weather Effects").

thank you , will have a look at that

a recent idea i had was just a cone over the camera, say 10 feet across at the bottom, maybe 20 feet tall, with a random rain texture on it. the terminal velocity of rain is high enough that its very difficult to see individual drops in real life. i've done full 3d raindops in the past. then i heard about the trick with the random texture. it works amazingly well. right now i use it on a box around the camera. but i think a cone might give better results when you look up, more of a 3d perspective foreshortening effect.

and don't forget to turn it off when the player wallks under cover!

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

Ugth, notice all those hacks personally, full particle for each raindrop with appropriated deferred lighting, use the normal and depth as a proxy for particle collision to get collision on each one. Then you have a (static) top down shadow map type (highly blurred) and instead of a shadowing a light you apply a texture/light/however you want to do it of tighter specular and darker albedo along with some nice water ripple like textures, which should transition between water running down something to puddling/ground depending on the angle. Oh and appropriate "bounce" particles once the rain hits, and make sure the water running affect takes into account a height map of the normal map (however you want to do that) so it puddles more at the bottom than at the top.

Or maybe that's overkill a little, but it's nice.

There's a completely overkill look at rain effects over on Sebastien Lagarde's blog.

I've previously used a few approaches:
- one where you've got a cube-shaped particle emitter that moves with the camera, spawning billboard sprites that fall under gravity.
- another time I did the same thing but rendered the particles as line primitives, and traced each one individually for collision with the world.
- recently I had to do a cheap rain effect, where I made a full-screen post processing shader that ray-traced a few vertical planes in front of the camera that had a scrolling raindrop texture on them.


At Minigore 2 I did really cheap rain effect using couple hundred simulated particles which was each rendered as mesh that contained around dozen actual raindrops. This keep fillrate quite minimal. That reindrop bunddle Mesh was duplicated to same VBO 20 times so it was possible to render 20 particles with one rendercall. Each particle was frustum culled and tested against y = 0 plane. If collision to ground plane happened watersplash effect was spawned which used quite similar pseudo instancing trick. Particle was re-emitted after collision and emitter cube followed camera. Whole effect used around 10 render call without any dynamic geometry. Rain was added just before release so we didn't have that much time to fine tune the effect. It's actually even use snow flake texture and was vertex colored to hide this fact.

Edit: the effect start from 1m6s. Tried to link straight for it but did't quite nailed it.

There's a completely overkill look at rain effects over on Sebastien Lagarde's blog.

I've previously used a few approaches:
- one where you've got a cube-shaped particle emitter that moves with the camera, spawning billboard sprites that fall under gravity.
- another time I did the same thing but rendered the particles as line primitives, and traced each one individually for collision with the world.
- recently I had to do a cheap rain effect, where I made a full-screen post processing shader that ray-traced a few vertical planes in front of the camera that had a scrolling raindrop texture on them.

That really is a bit overkill blink.png Still, bookmarked it for future reference. Even if I disagree with some of the methods of implementation, in terms of and overview of what you might want to accomplish that's really comprehensive.



At Minigore 2 I did really cheap rain effect using couple hundred simulated particles which was each rendered as mesh that contained around dozen actual raindrops. This keep fillrate quite minimal. That reindrop bunddle Mesh was duplicated to same VBO 20 times so it was possible to render 20 particles with one rendercall. Each particle was frustum culled and tested against y = 0 plane. If collision to ground plane happened watersplash effect was spawned which used quite similar pseudo instancing trick. Particle was re-emitted after collision and emitter cube followed camera. Whole effect used around 10 render call without any dynamic geometry. Rain was added just before release so we didn't have that much time to fine tune the effect. It's actually even use snow flake texture and was vertex colored to hide this fact.

Edit: the effect start from 1m6s. Tried to link straight for it but did't quite nailed it.

That looks really awesome!

This topic is closed to new replies.

Advertisement