It’s probably best to put a little introduction before I start to pick your brains. My name is Elvar Orn Unnthorsson and I am a Bsc student in Reykjavik University here in Iceland. I am currently working on a project where I’m trying to create rain in a virtual environment. I tampered a little bit with Panda last semester where I created a simple world that had clouds, fog and miasma, created with the built in particle system and fog, and the user could change colors and position of those phenomenons in runtime.
This time I’m aiming a little bit higher.
My goal this time around is to create rain which includes numerous raindrops that can vary in size, shape, position etc. and on top of that be affected by things like wind (that would affect raindrops that it collides with). I would like this to be designed so (hopefully in the future) that this could be used by more engines that Panda3D.
What I looking for are suggestions of approaches I can use to accomplish my goals. I’m quite certain I need to use shaders which as of now I do not have any experience with but am interested in learning and using.
How should I create this rain? Should I use c++ or Python? Are there any tutorials or information that may be helpful? ect…
Hopefully I’ve explained this well enough for you to help me out.
Im not sure how much I can help out with your project but I’ll see what I can do. For what language you should use I recommend Python. I thought that C++ was a bit to complicated and found that Python was easy to use easy to learn. Also the manual says:
I am not sure how you would create the rain but but for how the rain works I think I can give some advice for things that would be needed.
Hey hobbit. Thanks for the info!
I’m wondering if it is wise to connect all the drops to the physics engine. Wouldn’t that be far to heavy to process when the raindrops reach some thousands?
I had not seen that, thanks!
Right now I’m basically stuck on what way it is best to create and maintain all the drops in my scene. Should I use a simple .egg file for each drop, attach a shader to it and keep 'em in a list? Should the drops be created in shaders (if so how?) ?
What do you guys consider the cheapest and (hopefully) most flexible way to create all the raindrops needed for my scene?
Wow, if you want to simulate rain by creating each rain drop individually, you’re up to a challenge.
If you are going to do that in a way that will be alterable, it would be best to use a geometry shader for that, I think - this gives you full control over how the rain moves.
If you are not going to use geometry shaders, though, you could create a vertex cloud consisting of point sprites. Or you could use separate models, but you’ll need to use the rigid boxy combiner then.
Hopefully I’m not setting some unrealistic goals for this project hehe
Geometry shaders seem to be what I’m looking for although I’m having trouble finding info/articles/examples/tutorials on how to use and abuse them.
I found a great article about rain that published in may of this year. In it they defined a rain zone that specifies where is should be raining and then a container which includes the raindrops. (Picture)
In that article they used vertex, geometry and pixel shaders in two passes (Picture)
This looks a very interesting approach I’m willing to explore further but that obviosly requires that I can get my hands on some info about geometry shaders.
Do you know where I can find info that can help me? I’ve tried googling and looked on the Nvidia site but was unsuccessful (maybe I’m just a bad at searching)
The rain in your screenshots look quite interesting. Is there any chance I could see the source for it?