Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Rain... so many different ways to do it...

Author
Message
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 7th Feb 2004 03:12
Im wondering whats the 'best' way to make rain/weather? Ive seen dozens of tutorials here on the boards, and some of them seem really bad. Others seem decent, but they use a individual poly for each rainddrop (that seems like overkill to me).

So, what is the 'best' way to make good looking professional rain? How do the big game devs do it?

All you need is zeal
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 7th Feb 2004 03:40 Edited at: 7th Feb 2004 03:40
isn't the smallest unit of measure for a 3d object that is rendered at least 1 poly? If so, how is that overkill? Just wondering.
I'd like to know the answer to the original question as well.

-RUST-
"What the... Mooooooooooo!"
hexGEAR
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: Naytonia
Posted: 7th Feb 2004 03:46
to get a really good effect you still have to use objects, you could use one-sided triangles, only 3 vertices and the lowest you can go that's still visible, then play around with it till you get the least number of rain objects that gives an adequate effect.

Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 7th Feb 2004 03:46 Edited at: 7th Feb 2004 03:47
Quote: "isn't the smallest unit of measure for a 3d object that is rendered at least 1 poly? If so, how is that overkill?"


Well if you have a thousand raindrops on screen...


"Computers are useless they can only give you answers."
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 7th Feb 2004 04:13
right, but what I mean is how can a single rain drop be anything less than 1 poly?

-RUST-
"What the... Mooooooooooo!"
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 7th Feb 2004 04:32
Ive heard of different methods like using scrolling textures, and other original ideas. Thats what im looking for. I dont think big games use a individual poly for every individual raindrop. I could be wrong I guess...

All you need is zeal
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 7th Feb 2004 04:46 Edited at: 7th Feb 2004 04:46
Quote: "right, but what I mean is how can a single rain drop be anything less than 1 poly?"


It can't but you'd have to control every single raindrop seperately and if you have a thousand raindrops, that's 1000 polys, managing every one of those objects individually. With a well thought-out array this can be made easier but it's unnescessary. What Zeal is asking for is the easiest way to do rain, personally, I'd use a repeating, scrolling texture which would be 1 poly and 1 object to manage - but that's just me.


"Computers are useless they can only give you answers."
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 7th Feb 2004 04:54
ok I see what you mean, I was just curious. I am no 3d guru, btw.

-RUST-
"What the... Mooooooooooo!"
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 7th Feb 2004 05:17 Edited at: 7th Feb 2004 05:20
Exeat but a single plain with a scrolling texture usually looks like crap. The rain always seems to be falling at one point near your feet, and god help you if you look up or down. Also because you have to stick the plain on the screen, you never feel like your actually moving through the rain, it always seems to be falling just infront of you. Ive yet to see a REALLY good looking rain demo using JUST a scrolling textrue.

*edit* one more problem with scrolling textures, there is no way to do any kind of rain 'zoning'. Meaning rain will be falling indoors, under cover of trees, bridges, ect...

It seems like the only way to do realistic looking rain is to make each drop a individual object, but like I said, that seems a tad extreme. There has to be a better, more efficient way.

All you need is zeal
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 7th Feb 2004 05:39
*shrug* Don't ask me, I've never done it, that's just the place I'd start. Of course, I was thinking of something like the rain in Diablo II where it would work fine but then again, that's basically a 2D game anyway.


"Computers are useless they can only give you answers."
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 7th Feb 2004 07:00
How about a hybrid? Have the rain fall in small sheets of animated textures. You can have a fair amount of streamers each with dozens of drops or streaks. You can also place the streamers to give more volume and still react to indoor/outdoor transitions.
--
TAZ

Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 7th Feb 2004 07:44
Ive thought about that but have yet to see a good example in action. seems like youd be able to detect the different 'billboards' if you turned your head/camera.

All you need is zeal
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 7th Feb 2004 07:47
Well maybe you should try to give it a go yourself then


"Computers are useless they can only give you answers."
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 7th Feb 2004 07:55
Im not sure exactly where to start with billboard rain. I mean, if you placed sevral plains infront of the camera, when you moved/rotated your view, youd have to move/rotate the plains too, otherwise youd be able to detect the different sheets fo rain.

All you need is zeal
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 7th Feb 2004 08:42
sonds like you've answered your own question.

i would imagine setting the object to camera orientation command (can't remember the exact command name) would be your friend here.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia Ti4200 AGP 8x 128MB
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 7th Feb 2004 08:57
Have you tried using a skysphere type effect?

Apply the rain texture to a sphere, then each loop reposition the sphere so that it is always the same distance from you character then scroll the texture. Just don't rotate it when the character rotates.

You could use several spheres at different distances from the camera to give a sense of depth.

This is only an idea, it is not something I have tried - you will have to do that yourself but it sounds good to me

Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 7th Feb 2004 09:22
hmm walaber I dont see how I answered my own question. Even if you make the billboards face the camera (easy to do), youll still be able to see the edges. I remember a demo that did this a while back, you could pick out each sheet of rain.

Scraggle, a sphere would look like a sprinkler. Perhaps a cylinder. But again, I remember a demo not too long ago that used cylinders... didnt look all that great

Hasnt anyone ever posted a really good looking rain demo here on the forums? All the 'good' ones ive seen use individual objects for the drops, something id rather not do.

All you need is zeal
Krush
21
Years of Service
User Offline
Joined: 22nd Dec 2003
Location: New York City
Posted: 7th Feb 2004 09:54
Quote: "Well if you have a thousand raindrops on screen..."


I think the particular question here is a little moot, since it is highly unlikey you would have anywhere near that amount of individual raindrops. You should be able to create very realistic rain with less than 100 objects or so.
Teh Go0rfmeister
21
Years of Service
User Offline
Joined: 17th Aug 2003
Location:
Posted: 7th Feb 2004 10:35
then u got the problem of making wind affect the rain direction...

www.tinnedhead.tk watch this space for the first ever calculator to show the working out. also look out for our first game- ww.exor-mk1.tk
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 7th Feb 2004 11:17
Quote: "I think the particular question here is a little moot, since it is highly unlikey you would have anywhere near that amount of individual raindrops. You should be able to create very realistic rain with less than 100 objects or so."


I disagree, I'm not talking about a little drizzle. I don't know about you but down here when it rains it really pours, so much that you can barely see 5 feet ahead of you. If you only want a little bit of rain then go ahead but on the other hand, if you want something like in Vietcong then there would definately be a number closer to 1000.


"Computers are useless they can only give you answers."
Krush
21
Years of Service
User Offline
Joined: 22nd Dec 2003
Location: New York City
Posted: 7th Feb 2004 12:39
Realistically, making a scene with that much rain is just silly, IMO. You want full on realism, I think you're going to have to wait a few years for the tech to catch up. On the other hand, I could understand why you might want to do such a thing, but unless you want to do some hardcore assembler, I think it's impractical at best.
Dave J
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 7th Feb 2004 14:11
That's the whole point I'm getting at, using that method it's too slow but I'm looking for something else that could be much faster and simpler to use.


"Computers are useless they can only give you answers."
Mussi
22
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 7th Feb 2004 14:13
haven't read all your posts, sry for that
you could try to make a couple of planes with some raindrop textures and randomly position them around your camera and rotate them over the y axis so they point to the camera. and then scroll their textures so it looks like it's dropping. just a tought



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
AtomR
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 7th Feb 2004 14:25
IMO if you want to do a pouring rain effect you would have to use a combination of the above suggestions.

Set fog at a small distance, use a couple of layers of cylinders/plains textured with a pouring rain effect(there is a really great one in the Texture Maker) and then use 50 to 100 polygons (maybe using a particle emiter) for the closest rain.

I don't know if you'd say this is overkill but that's how I'd do it

Take care
AtomR
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 8th Feb 2004 08:18
To answer the billboard edge detection question... In DBP you need to make sure the edge texture is 100% transparent. Any trace of color will result in that visible edge defect. I ran into a similar problem making see through hex grids and that was the fix.
--
TAZ

zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 8th Feb 2004 08:20
I've got a ton of stuff going on right now, but my next big game project will feature outdoor missions and rain is an effect that I'd like to model as well.
--
TAZ

Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 8th Feb 2004 11:52
Zircher how would I go about making sure the 'edge texture is 100% transparent'? Not sure what you mean by that. I hope you mean there is a way to fake vertex alpha fading, I need to know how to do that for my sky as well.

All you need is zeal
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 8th Feb 2004 19:14 Edited at: 8th Feb 2004 19:19
I use a PNG texture to set my transparency and just make sure that the edge of the image is always that trasparent color, too easy.

ascii art warning


The majority of the image is 100% transparent and no rain drops are on the edge. If a rain drop touches the edge, DBP will make the edge of the plane visible. As you scroll the texture vertically, the top and bottom edges of the plane will be visible, but this should not be an issue since the player's camera should be somewhere below the top of the rain streamer and above the bottom.
--
TAZ

Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 8th Feb 2004 22:59
Do it like this:



- Isn't too many polys
- Can be contained in areas
- Looks pretty good
- Can't tell that it's plains


Media :



Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 8th Feb 2004 23:45
Hmm I see some potential in that one Chris. I had to change the texture (jpgs dont work well with transparency), but after I did that it looked pretty good. I imagine it would be pretty easy to just keep the camera in the center of that 'box o rain' and re position the plains as you moved around.

My next question - Using scrolling textures, how would you achieve the effect of gradual rain drop increase. Like going from the first few drops at the start of a storm to the full down pour.

All you need is zeal
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 9th Feb 2004 07:34
I suppose you could generate a individual texture for each plain (maybe 32x32 or even less would do) using memblocks. Then calculate how far down the texture is scrolled, and draw a new raindrop at the very 'top' of the object, not the texture.

However seems like the texture would have to be kinda big or the single pixel drop would get stretched too much... and if youre having to generate several large textures using memblocks, youre in for some slowdown...

Anyone have any other ideas?

All you need is zeal
walaber
21
Years of Service
User Offline
Joined: 22nd Oct 2003
Location: Los Angeles, CA
Posted: 9th Feb 2004 08:49
why not just gradually increase the number of plains? for example,

start with just a few rain plains, completely transparent, and then gradually fade them up until they are visible. then continue adding plains like this, until you have heavy rain?

I think if you could get the fading to look right, it would work great.

Go Go Gadget DBPRO!

Athlon XP 2400+ || DDR-SDRAM 1GB || Nvidia Ti4200 AGP 8x 128MB
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 9th Feb 2004 17:46 Edited at: 9th Feb 2004 19:22
Chris, that's close to what I meant. Here's a tweaked version that is transparent texture friendly. It also uses less plains as a result.



Here's the png texture that I used. Transparent with thinner streaks... rain.png

[edit] Grayed the background and updated the code snippet so you can play with fog. Just pull back on the camera to see it in action.
--
TAZ

Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 9th Feb 2004 22:44 Edited at: 9th Feb 2004 22:48
Walber couple reasons why I dont think that would work. One, youd have to start with a simple rain texture (only a few drops), and that would mean youd need LOTS of plains order to turn those few drops into a downpour. Also, I dont think fading in and out would work either, youd still be fading either heavy or light rain in and out, when what you really need is just a progression of more and more drops being added to your texture (looking like they are coming from the sky). Just seems like it would look odd having a full storm fading in out of nowhere.

Anyone have any other ideas? Like I said it seems like it would be possible with memblocks/dynamic textures, but I dunno...

All you need is zeal
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 11th Feb 2004 11:49
Nobody can think of anyway to simulate gradual rain increase? Im liking chris's system more and more, I hope there is a way to do it. Keep in mind alpha fading the object is out, because you cant alpha fade a transparent object (confirmed bug). But not like it matters, alpha fading a full sheet of falling rain wouldnt look right anyway. So there has to be some way to manipulate the texture itself...

All you need is zeal
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 11th Feb 2004 18:26
There are several ways to manipulate textures in DBP. You can either work it as a memblock or use the slow as tar get image command and work with bitmaps. You can also simply have several images of rain (light, medium, and heavy) and work them in as layers.
--
TAZ

bitechu
21
Years of Service
User Offline
Joined: 29th Dec 2003
Location: Massachusetts
Posted: 11th Feb 2004 22:38 Edited at: 11th Feb 2004 22:39
Straight from the DBPro examples...use this .tga don't know if its useable but looks ok.

http://home.comcast.net/~r_monaco/rain.tga

Asus A7N266-C/1.12MB PC2100DDR/AMD XP2100+/Asus Ti4600 128MB
Don Malone
22
Years of Service
User Offline
Joined: 27th Apr 2003
Location: Birmingham, Alabama
Posted: 12th Feb 2004 03:56 Edited at: 12th Feb 2004 03:58
If you are using a textured plain to show rain could you align two textured plains with a slight gap and change the texture on one of the plains to increse the rain fall?

I am a newbie so I am wondering if or why this wont work?

edit: Missed Zirchers post, but can you change the texture on one plain quickly enough to not make it noticeable?

Wasting CPU Cycles since the 286 was a hot machine.
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 12th Feb 2004 05:54
Changing a textures would make rain cease to exist in mid-fall. Better to blend in multiple planes and increase the density.

Don Malone
22
Years of Service
User Offline
Joined: 27th Apr 2003
Location: Birmingham, Alabama
Posted: 12th Feb 2004 13:51
Would you be so kind as to clarify what you mean by density please. Are you talking about adding the plains to the world for density?

Wasting CPU Cycles since the 286 was a hot machine.
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 12th Feb 2004 17:07
Have you tried the code that I posted? I have five planes with rain in them. By adding or subtracting planes you control how much rain is present. Density is the number of rain streaks per frame in this case.
--
TAZ

Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 12th Feb 2004 23:23
Problem is zircher, if you subtract too many plains, it becomes REALLY obvious that the rain is falling in a square area around the camera, you need lots and lots of plains to keep up with the illusion. And I was taking a 60fps hit just using 40 plains (I guess because they have to be big enough to fill the whole screen, dbpro freaks out).

All you need is zeal
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 15th Feb 2004 07:14
Yes well it seems that doing rain with scrolling textures really kills your fps. Sure it looks fine in the demos here, but like I said, when you add several full screen plains to a real game, you get a pretty big fps drop. And you need at least 20ish plains to get a realistic looking effect. So, does anyone have any other ideas on how to do rain? Maybe 500 or so individual triangles is the way to go... I suppose you could check angles and always keep drops infront of the camera.

All you need is zeal
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 15th Feb 2004 16:49 Edited at: 16th Feb 2004 01:40
I'm glad I like turn based games and don't have to fret about FPS as much as everyone else does.

Seriously, since that method is not going to work, your only other choice that I can think of is to roll your own rain particle (triangles) system. The big perk is that you can control the density of particles and have rain speed uo or slow down at will. To make it effective, you have to only rain in front of the camera. Another perk to this method is you do not have to do frustrum culling with the big planes. So, you should get some speed back there.
--
TAZ

Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 16th Feb 2004 00:30
I hope, gonna work on my individual object per raindrop system now. I suppose I can use atanful to calculate the angle between drops and camera, if its outside the camera fov angle ill just wrap the drops around to the other side. Sounds easy in theory, but well see if I can pull it off or not...

All you need is zeal
Mucky Muck Ninja
21
Years of Service
User Offline
Joined: 4th Sep 2003
Location: im not entirely sure
Posted: 17th Feb 2004 04:02
Or, you could have a particle emitter above your character and just have the rain around your character. Im pretty sure you wouldn't be able to tell that there wasn't rain anywhere else. To increase the amount of rain, just increase the frequency for particles.

Am I an Idiot...or is everyone else just really smart?

Login to post a reply

Server time is: 2025-06-26 04:48:20
Your offset time is: 2025-06-26 04:48:20