Jump to content
  • Advertisement
Sign in to follow this  
kandemor

Sky dome or sky plane?

This topic is 4866 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I want to implement a sky with moving "clouds" (textures) into my game engine. What's the best solution, a SkyDome or a SkyPlane? Where can I find information about their implementation? Thank you very much!

Share this post


Link to post
Share on other sites
Advertisement
If you want your sky to meet the horizon (in fact, it will probably have to extend a good ways below it) you will need a dome, or some kind of enclosing geometry. If you try to make a plane, you will need to make the plane huge and you still won't be able to get it to meet the horizon everywhere. It should be possible to map textures onto a dome such that it looks like an infinite plane; also, the bottom of the dome will probably be more of a haze than definite features like clouds.

The easy and fast (in terms of frame rate) way to get moving clouds is to have some animated scrolling layers. You won't see the clouds changing though, so if you want that you might look into a technique that uses animated noise. Alternatively I guess you could try using a 3d texture and trilinear filtering between slices to get animation, but it probably won't look as good as a well-implemented procedural texture (but, again, will run much faster...)

Share this post


Link to post
Share on other sites
Another option for clouds might be to use a billboard. You can put an animated texture on the billboard if you want. Manual animation is best, either by altering the texture coords or by flipping through different textures.

Also, I prefer a skydome, but I use an entire sphere to I know it wont have any holes on the horrizon. I tile a sky scape onto it, and then use billboards for the floating clouds and sun/lens flare and moon, etc...

When you render the dome, render it first with Z buffer and Z writes both DISABLED, and always render it using the IDENTITY MATRIX which will always keep it centered above you regardless of where you move.

QUAD

Share this post


Link to post
Share on other sites
Quote:
Original post by ganchmaster
The easy and fast (in terms of frame rate) way to get moving clouds is to have some animated scrolling layers. You won't see the clouds changing though, so if you want that you might look into a technique that uses animated noise. Alternatively I guess you could try using a 3d texture and trilinear filtering between slices to get animation, but it probably won't look as good as a well-implemented procedural texture (but, again, will run much faster...)


well, you could combine 3D textures and procedural texture. Using Perlin noise you could fill a volume texture with 256 (for example) Z stages (int values from 0 to 255) of the clouds (X and Y values according to tex resolution).... don´t know for sure, but IIRC Perlin noise has the useful habit to animate smoothly along the z-axis. So you could precompute 256 (or more) 'frames' of a cloud animation, and if you made a tileable Perlin noise, you could 'loop' through that all the time. There should be some tutorials, screens or perhaps even animations of this in action around the web. Try google for "Perlin Noise"

Share this post


Link to post
Share on other sites
True, you can precompute the noise and put it in a 3d texture, but you might have trouble avoiding appearance of tiling in time and space without having a huge texture.

If you have 256 frames as you suggest, and use a 256x256 texture, that's 16MB in a single texture, assuming you have compression at least as good as 8 bpp. 256x256 seems like a minimum to avoid seeing the texture tile in space while not having huge texels on your sky geometry. The neat thing about generating the noise on the fly is that you could have high detail without tiling or excessive memory usage, if I understand the Perlin techniques correctly.

But I haven't tried it, maybe you could find an acceptable texture size. Probably 256 frames is a lot more than you really need.

Share this post


Link to post
Share on other sites
Try a skydome. Not a SPHERE but a real DOME. With a dome you can cause the illusion of sky that stretches away. You can even use some color trick in order to tint the sky depending on the hour. You cna usea a second dome with the clouds.

Luck!
Guimo

Share this post


Link to post
Share on other sites
A sphere goes all the way around, and 50% of the triangles are below the ground and never seen, whereas a dome is only the top viewable 50% that is seen. In most cases this fine, but if off on the horizon you have a large crater like the Grand Canyon or something that causes a large chunk of terrain to be below the horizon, you might get a hole with a dome which only comes as low as the horizon. If you use a sphere, then apply proper culling to only the visible triangles on the sphere, I don’t think you’ll loose too much performance, but you gain the knowledge there won’t be holes. On the other hand if you are certain you’d never run into that situation, then a dome is half the size and half the tris to render, so it is a good solution if it works for your environment.

Guimo brings up a great point on shading the dome (or sphere) based on time of day. I actually do that in my engine, and it’s really easy. By setting the vertex color you can shade the dome (no texturing, just coloring) from various shades of blue in the day time to black in the night time, and provide a nice affect for time changes.


Share this post


Link to post
Share on other sites
Ok, then maybe the best solution is a Dome put lower than the horizon with a first layer only colored and a second layer with the clouds created with Perlin Noise, isn't it?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!