Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Particle-based Clouds/Rain

Agaillon Gateaux
Registered User
Join date: 1 Jul 2005
Posts: 65
08-03-2005 10:29
Hey all,

I'm still somewhat new to the world of scripting, but I'm quite interested in using particles to create clouds and rain. I've seen it done in-game, and it looks great, but I'm a little stuck. In terms of the cloud itself, is the best way to create it via a texture? Also, I assume that using PATTERN_DROP is the best way to actually place the cloud itself, but is there a way to make it create the particles at a set distance from the emitter instead of at the emitter itself?

Sorry for the newbie questions, but I definitely appreciate any guidance anyone could give. Thanks in advance!

Agaillon
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
08-03-2005 12:55
I made something that works like this (see screenshots). Can simulate summer clouds, rain, snow, storms with lightnings that hit AVs :D, meteorite falls and fireworks.

There also are little clouds made of particles that you wear, they follow you around and keep raining on you, for those bad mood days ;)

PATTERN_DROP is actually a bad idea, since the particles can only be 4m x 4m at most they would pile up all at the same place, not providing any good effect. Instead I use PATTERN_ANGLE with very low burst speeds so the particles stay together but spread around in a rugged circle shape.

To make the particles appear at a distance, you can try using the PATTERN_CONE_ANGLE setting, with a small angle (0.0 beginning, 0.2 ending, for example) and a large radius: the particles would form a flattened bowl far from the object. Then you can apply some very small acceleration to model the particles' ensemble.

Don't set them to follow the wind, instead get the wind direction and pass a fraction of that in the acceleration vector for the particles, or else your clouds will get teared down and won't look very good (again, because of the small max particle size).
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
Agaillon Gateaux
Registered User
Join date: 1 Jul 2005
Posts: 65
08-03-2005 13:36
From: Jesrad Seraph
I made something that works like this (see screenshots). Can simulate summer clouds, rain, snow, storms with lightnings that hit AVs :D, meteorite falls and fireworks.

There also are little clouds made of particles that you wear, they follow you around and keep raining on you, for those bad mood days ;)

PATTERN_DROP is actually a bad idea, since the particles can only be 4m x 4m at most they would pile up all at the same place, not providing any good effect. Instead I use PATTERN_ANGLE with very low burst speeds so the particles stay together but spread around in a rugged circle shape.

To make the particles appear at a distance, you can try using the PATTERN_CONE_ANGLE setting, with a small angle (0.0 beginning, 0.2 ending, for example) and a large radius: the particles would form a flattened bowl far from the object. Then you can apply some very small acceleration to model the particles' ensemble.

Don't set them to follow the wind, instead get the wind direction and pass a fraction of that in the acceleration vector for the particles, or else your clouds will get teared down and won't look very good (again, because of the small max particle size).


Jerad, that's absolutely amazing looking, and very similiar to the exact idea I'm looking to go with. Thank you for your words of wisdom. :) I can't wait to get in and try it that way!
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
08-04-2005 03:41
Here is how it works: there is one central object and script that configures the weather through a touch-menu, then rezzes cloud objects (10x10x10 invisible cubes) and tells them where to go and what effects to produce, according to configuration.

I use large cubes like this because otherwise they are hidden as soon as they are 64m away, along with any particle they'd emit. And often you'll want your clouds 100m to 200m high. These are non-physical, invisible and phantom to avoid any trouble to passers-by.

Secondly, these objects are all temponrez to avoid eating other people's prim allotments, and die within minutes (or tens of seconds depending on configuration). To cover a full sim in dark clouds you need about 100 of these. They are continuously rezzed to reach a dynamic equilibrium between resources used and resulting effects. It can scale from 16x16 parcel to a full sim by sending the clouds further or closer, and sending more or less of them to augment or reduce the coverage, and the clouds can stay longer or shorter depending, also, on the coverage and size of clouds you want. Also, this way when you change the wheather it happens gradually ;)

And lastly I tried reducing the number of particles used as much as I could by trial and error, until I could get a seamless cloud with the least particles practical (once again fighting with the maximum particle size allowed). If you make your own system you'll have to take a lot of time on this I'm afraid.
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
Agaillon Gateaux
Registered User
Join date: 1 Jul 2005
Posts: 65
08-04-2005 08:21
Jesrad,

I'd love to discuss this with you further in regards to my specific project. I went and looked at your cloud system at your store (which is all very nice, by the way) and it's almost exactly what I'm looking for. Would you be available to be hired to work on a somewhat modified version of your existing code?

I see that you have private messages turned off. Could you possibly send me an email at [email]agaillon.gateaux@gmail.com[/email]? I unfortunately will not be available to log into the game for another 9 hours or so (I'm at work.)

Thanks again!

Agaillon
Jesrad Seraph
Nonsense
Join date: 11 Dec 2004
Posts: 1,463
08-04-2005 11:13
My IM are not turned off :o I'm just logged out at the moment. Yes, I am available to work on complex scripts for real cash or on simple scripts for a some L$.

[Edit] Oh, and you absolutely have to see it working in world !
_____________________
Either Man can enjoy universal freedom, or Man cannot. If it is possible then everyone can act freely if they don't stop anyone else from doing same. If it is not possible, then conflict will arise anyway so punch those that try to stop you. In conclusion the only strategy that wins in all cases is that of doing what you want against all adversity, as long as you respect that right in others.
Agaillon Gateaux
Registered User
Join date: 1 Jul 2005
Posts: 65
08-04-2005 11:17
From: Jesrad Seraph
My IM are not turned off :o I'm just logged out at the moment. Yes, I am available to work on complex scripts for real cash or on simple scripts for a some L$.


Sorry, I meant via the messageboards. I don't have the ability to log in right now to send IMs. I'll be in-game around 6:00 tonight (in-game time.) I'll toss you an IM then with my ideas and we'll go from there. :)

Thanks,

Agaillon