Jump to content

  • Log In with Google      Sign In   
  • Create Account

rain


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 the dodger uk   Members   -  Reputation: 148

Like
0Likes
Like

Posted 13 April 2013 - 11:32 AM

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



Sponsor:

#2 phil_t   Crossbones+   -  Reputation: 4093

Like
0Likes
Like

Posted 13 April 2013 - 11:58 AM

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").



#3 the dodger uk   Members   -  Reputation: 148

Like
0Likes
Like

Posted 13 April 2013 - 01:40 PM

thank you , will have a look at that 



#4 Norman Barrows   Crossbones+   -  Reputation: 2308

Like
0Likes
Like

Posted 13 April 2013 - 07:59 PM

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

 

 


#5 Frenetic Pony   Members   -  Reputation: 1396

Like
0Likes
Like

Posted 13 April 2013 - 11:23 PM

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.



#6 Hodgman   Moderators   -  Reputation: 31799

Like
2Likes
Like

Posted 14 April 2013 - 01:50 AM

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.

#7 kalle_h   Members   -  Reputation: 1565

Like
2Likes
Like

Posted 14 April 2013 - 04:59 AM



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.

Edited by kalle_h, 14 April 2013 - 05:00 AM.


#8 Frenetic Pony   Members   -  Reputation: 1396

Like
0Likes
Like

Posted 15 April 2013 - 03:58 PM

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.



#9 french_hustler   Members   -  Reputation: 384

Like
0Likes
Like

Posted 18 April 2013 - 02:43 PM



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!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS