Skip to main content
gamedev.net
🔒 Locked

Need help for programming a weather engine

Started by digital_phantom Apr 7, 2005 at 12:30 AM 5 replies 1.2k views
Original Post
digital_phantom
digital_phantom
Hey everyone, I plan on programming a full weather system for a 3D game. Basically I want rain, snow, and wind. That's not all I want a complete cloud system too that can foam grow and then rain is able to fall from those areas. I want the weather for the game to be spreaded out by a calender system. What I need to know is if anyone has already done this or tried to, any help will be needed. I also need help on how to do the clouds. I've read before about rendering clouds as imposters, but these are simple billboards, I want clouds able to foam together and then have a huge area which rain falls from. If anyone wants to do a joint project with me on this, I would appreciate it.
s_p_oneil
s_p_oneil
How hard that is depends on how much realism you want, and on the size of your game world. Accurate climate/weather modeling requires a super-computer. Fortunately realism and accuracy don't quite go hand in hand here. The main question is whether you want to have a semi-realistic simulation or whether you want to fake it. Or you may want to have some realistic equations with some things faked. If you want realism, here are some links you might find useful:

http://climateprediction.net/science/cl-intro.php (look at the other pages here as well)
http://www.acad.carleton.edu/curricular/GEOL/DaveSTELLA/entrance.htm (look at the climate system and Daisyworld)
http://www.essc.psu.edu/genesis/geninfo.html (this one may be good for running on PC-level hardware)
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470857501.html (in case you want to buy a book)

How hard it is to render clouds also depends on what you want. Is the camera always on the ground, or can it fly through the clouds? If it's the former, you can probably get away with billboards. If it's the latter, you'll probably need some sort of volumetric rendering system for the clouds. If the camera can go into space around a planet, you're in for a really tough time (I'm still looking for a solution to that).

Sean
digital_phantom
digital_phantom
A few years ago I made a tech-demo for a iso strategy rpg game I planned on making, one of the things I added to the battle scenes was that there was a day/night, and a schedule if it should rain in a day and when it should and how many times, and if it is suppose to snow.

Ever since I made that tech-demo, I have been interested in a weather engine.
If anyone has ever played games like Shenmue, or Fable. You know how realistic those games are? Well it is my dream to create a game like that and have everything going super realistic, like the weather engine.

But for now, all I want to make is a tech-demo, having everything almost as realistic as it can go. And then after that I can convert parts of it for use in a game.

It would really be helpful if I can get a project with several people going on about this, for non-profit and only knowledge reasons.

And by the way, what exactly is "volumetric rendering system" and how you do it? I've never heard of it before. Any information on that?

Thanks in advance.
s_p_oneil
s_p_oneil
Volumetric rendering is a term used for rendering translucent objects that require you to render practically every 3D point in a volume to get it to look right. These usually have something to do with particles suspended in gases and liquids (or in space, like a nebula).

When rendering clouds from a camera that stays on the ground, you can usually blend them into your sky dome or use a few large billboards to draw the clouds. However, if you're working on a flight sim where the camera can fly through the clouds, that would look so bad that you wouldn't even consider it. To properly render clouds from any camera angle and position, you need to render every cloud particle suspended in the 3D space you're drawing, and that will quickly bring any system to its knees. Decent lighting calculations are just as complicated (if not more so).

If you really want to build a semi-realistic climate/weather model, I would suggest you choose one of two paths. The first would be to start with something simple like Daisyworld, where it is quick and easy to play around with and validate results, and then add to it. The second would be to search the Internet for an existing climate/weather model that you can port into your own application.

I wanted to play around with something like this a few years back, but I was busy with programming on the graphics side of things, and I never got around to it. Now I don't have much time for either.

EDIT: I almost forgot. There are various techniques for handling volumetric rendering. You should be able to find out about most of them using Google. Also, I recommend starting with something like Daisyworld. You will learn more, it will be more fun, and you'll have complete control over everything.
digital_phantom
digital_phantom
Thanks on the information so far.

Okay, so far I've decided since my first version of the engine will be based with the view only on the ground, I have decided to use a cloud box, or various layers of cloud textures covering the sky.

But now, I've been looking at 'Simple Clouds Part 1' article on here, and I've translated the code used for perlin noise to a tech-demo project. And I like it, well somewhat, but I don't like how it isn't very much customizable. And the outcome it creates isn't what I consider to be too great for my cloud textures.

What I would think what would be great, instead of using perlin noise to create a cloud texture, instead use some version of it to create a random single cloud instead of a covering, and able to change the look of the cloud by choose the cloud formation (or type), and the random engine would go to work from there.
But my knowledge does not go this far, does anyone have any idea where to start on this idea or have I just gotten myself to a dead end with this idea?

Thanks in advance.
s_p_oneil
s_p_oneil
Look at http://www.vterrain.org/Atmosphere/Clouds/index.html, and in particular, look at this link from that page: http://web.ics.purdue.edu/~schpokj/research/purpl/clouds/. The PDF explains how you can use ellipsoids (which can be made to fit within a rectangular bounding box) to model the basic cloud shapes, and use noise to generate the detail. Various parameters can be tweaked along with the shape of the box to give different appearances for different types of clouds.

digital_phantom
digital_phantom
thanks so far, I've looked at all that and there is useful information, just not any source code or anything I want.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.