Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Rain; What is the most efficent way?
Topic Started: Sep 30 2007, 11:40 AM (576 Views)
Linkin
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Yea.. what would be the most efficent way to do rain in a game? i could do it with a partical emmiter, ive also heard it could be done with a shader?
My game is set in the vietnamise jungle so there will be lots of rain.

Thanks
-DS
Posted Image
Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
The most efficient way would be to create a object with a couple of hundred particle rain drops and make the object follow the player so that the rain is at the player's location all the time without the need of filling the whole room with rain particles which would be pretty performance costly.
Offline Profile Quote Post Goto Top
 
$pecter
Member Avatar
Elite Member
[ *  *  *  * ]
I don't think you understand how a shader works, you could just draw raindrops in front of the view, but I don't think this is what you want.
However, the particle method is much more doable. I was just working on rain the other day and came up with this

CREATE
Code:
 

texture=28;//load a rain texture and put it here, this is the texture for the particles
CreateParticleSystem();//create system
SetParticleOrigin(0,0,0,0,3000,3000,1);   //Large origin (3000x3000), this was fitted to my room so you may want to change this
SetParticleCount(10,15,12.5*100);//Particle count, max amount is average a number of particles created times particle life
SetParticleLifetime(100,100);//life
SetParticleVelocity(-80,45,-200.5,-80,225,-300.5);   //Speed variables
SetParticleAcceleration(-80,45,-30.2,-80,225,-30.4);  //Acceleration variables
SetParticleSize(12,15,14,27);//Size
SetInitialParticleColor(155,155,155,55,155,155,155,55);//transparent gray colour
SetFinalParticleColor(155,155,155,55,155,155,155,55);//transparent gray colour


STEP
Code:
 

x=camera.x;//situate at camera
y=camera.y;//situate at camera
z=camera.z+200;//situate above camera
ParticleSystemStep(1);//step with a speed of one, make this higher to speed the system up
Offline Profile Quote Post Goto Top
 
LaserLemon
Member Avatar
Sir
[ *  *  *  *  *  * ]
Okay, I see someone alse has already replied, but here's the code I compiled, you can pick ur favourite :P

CREATE

Code:
 
CreateParticleSystem()

SetParticleCount(100,200,300)
SetParticleLifetime(10,20)
SetParticleOrigin(0,0,0,0,100,100,100)
SetParticleVelocity(80,0,10,90,0,30)
SetParticleAcceleration(80,0,3,90,0,3)
SetInitialCenterRepulsion(0,0,0)
SetInitialParticleColor(0,0,50,150,0,0,80,100)
SetFinalParticleColor(0,0,50,150,0,0,80,100)
SetParticleSize(0.2,0.2,0.2,0.2)


STEP

Code:
 
ParticleSystemStep(1)
Posted Image

Formerly known as FaTaL_N00B.
Offline Profile Quote Post Goto Top
 
harkathmaker
Member Avatar
Persistent Enquirer
[ *  *  *  *  * ]
Can't particles only be rectangular in shape? Raindrops are usually kinda like streaks... is there a way to achieve this? :huh:
Offline Profile Quote Post Goto Top
 
skarik
Member Avatar
kitten eating scum
[ *  *  *  *  *  * ]
Posted Image
^RECTANGULAR! :P
^_^
Blog|EHS
Offline Profile Quote Post Goto Top
 
harkathmaker
Member Avatar
Persistent Enquirer
[ *  *  *  *  * ]
?!?!?!?! :huh: :blink: :wacko:
Particle?
Offline Profile Quote Post Goto Top
 
harkathmaker
Member Avatar
Persistent Enquirer
[ *  *  *  *  * ]
Quote:
 
Can't particles only be rectangular in shape?


Gah! I meant square... was that picture a particle though?
Offline Profile Quote Post Goto Top
 
$pecter
Member Avatar
Elite Member
[ *  *  *  * ]
png with alpha ;)
Offline Profile Quote Post Goto Top
 
zelda4evr
Member Avatar
Forum God
[ *  *  *  *  *  * ]
how do you make pngs have alpha?

Posted Image
Offline Profile Quote Post Goto Top
 
Zedman3d
Member Avatar
Forum God
[ *  *  *  *  *  * ]
This topic is funny.
Quote:
 
Eanbro: My problem with C++ is that not everything is included to start making projects with it.
Quote:
 
Dr.B: Your problem with C++ is that you want it to be like Game Maker...
Offline Profile Quote Post Goto Top
 
$pecter
Member Avatar
Elite Member
[ *  *  *  * ]
Zedman3d
Oct 1 2007, 04:36 AM
This topic is funny.

So are jokes, but on topic...

zelda4evr, to make an png with alpha you need Photoshop, The GIMP or some similar program.
A simple method to make these transparent pngs is to:
1. Make your image with white areas where you want to be transparent (the whiter the more transparent, black is solid)
2. Duplicate the image into a new channel for the first layer and invert it
3. Make all areas you don't want to be transparent black (in the mask)
3. Save as png with transparency
Offline Profile Quote Post Goto Top
 
Linkin
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Ok thanks guys, ill go with the partical emmiter
Posted Image
Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Offline Profile Quote Post Goto Top
 
Linkin
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Is there any way to make the particals only rotate around there Y axis?
Posted Image
Want something done in Photoshop, make a request Here

Formerly known as DS-Development.
Offline Profile Quote Post Goto Top
 
$pecter
Member Avatar
Elite Member
[ *  *  *  * ]
Dark Sigma
 
Is there any way to make the particals only rotate around there Y axis?

I don't think particles can rotate, from what I can see they're just a billboard that always faces you.

Offline Profile Quote Post Goto Top
 
Go to Next Page
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply