Question about cloud layers/animating skyboxs.

Started by
3 comments, last by Fingers_ 17 years, 6 months ago
Hello, I have a question about implementing cloud layers and animating skyboxs in a real time application. I am wanting to extend the functionality of my simple cubic skybox to allow as many features as possible. In particular I am wanting to allow an animated cloud layer and possibly the inclusion of sky born objects such as birds/butterflies etc. As far as implementation goes, my initial thought was to have an extended plane located above the user. Then, you could render cloud textures/objects onto the plane texture. The clouds would scroll based on some wind direction and velocity which could be set and altered at any time. The birds/butterflies would simply have some sort of simple A.I.. I have some concerns though. 1) The plane would be rectangular so the edges may possibly be seen. The objects would pop out of place when they reached the borders. 1.1) Possible solution: fade the clouds out as they reach some arbitrary distance away from the center of the plane. therefore there would be no borders, only a maximum distance. I am hoping this would simulate the horizon line. 2) The cloud plane would obviously have to be realistic so some method would need to be performed to give the illusion that the cloud layer extends to infinity. There would need to be a realistic horizon line. Could some form of cloud imposter/billboard be used to help the horizon line? Please, if anybody has some experience in doing something like this and if I could get some advice on the topic I would appreciate it. I just don't want to implement something when there could be better ways to implement it or if the illusion is not going to work realistically. Oh, if anybody has some advice as to better ways to do this or ANY input at all I would love to hear it. Thank you, Jeremy Roberts
Advertisement
Well, I've never dealt with this before, but why not use a half sphere, with the horizon textured onto its edges. And then you dynamically draw the clouds and all onto that, and they just get clipped when they reach the 'horizon'. Oh, and I think the sphere should be a little bit smaller than the skybox. (or you could just not have a box, depending on your project, although Im pretty sure you'll still need one)
I use a sky sphere instead of a skybox for my 3d engine. It looks the same and is more intuitive (no adjusting to avoid corners, for instance). You still leave off things like lighting and can simply create your sky sphere with minimal faces.

To implement your effects, simply have the sky sphere at radius x and the sky effects sphere at radius x - y. Then you can just rotate the actual mesh instead of the uv coords. Heck you could even make multiple spheres and do multiple effects or have some clouds moving fast and some slow.

Btw, if you are using particle effects for the clouds instead of textures, it would be simpler in my opinion to just make them face the camera and swing them around the camera at radius x - y (the same as above, just place them at that distance, don't have a seperate sphere with that radius). You could set up cloud layers by simply have clouds at different radii. For instance, if you wanted 5 layers, set the minimum "altitude" (read radius) and simply place the other four layers evenly between that and your sky sphere radius. Using this method would make your effects "stick" to your sky sphere. If your sky goes all the way down to the horizon, the clouds do too, lol.

Good luck dood!
- Enosch
I've previously tried implementing clouds via the plane layer you mentioned and it looked okay but not terribly realistic. Firstly because it looked very flat and failed to give any sort of depth to the cloud layer.

A couple more planes might have added the illusion of depth but I suppose a couple of sky dome/sphere for cloud rendering will do the trick equally well.

I might add that UV scrolling works nicely enough in either cases.
"There is no dark side of the moon." - Pink Floyd
There's been some pretty good results by other forumites with a flat cloud plane and advanced shaders... See Yann L's reply in this thread. As long as the camera will never need to go through the clouds, a flat plane can look just fine if you light and texture it well. You'll want to fade it out towards the horizon so it merges with the color of the sky. Lots of games use this technique.

If you're looking for information on real volumetric clouds, there's a thread about it here. The idea boils down to clusters of alpha-blended particles that make up the cloud (possibly rendered into an imposter when you're far away). This allows you to fly through the clouds etc.

You don't need to worry about objects like birds reaching the "borders" of your skybox or sphere. Just render the sky without writing to the Z-buffer so it's effectively at an infinite distance.

This topic is closed to new replies.

Advertisement