implementing skybox in a chunked scene/level

Started by
4 comments, last by doeme 12 years, 3 months ago
Hi all,

I have implemented my scene/level using chunked style, arranged as a grid depending on the current location/position of the character.
The chunks LOD varies dpdending on the distance of the chunks from the current chunks. There is also a fog that "hides" those chunks with low LOD. Using this approach I can implement large scene such as a large city similar to popular games. This approach was already implemented and working OK. I think this approach is being used by most commercial games.

However, I need help on the following
1. I am confused on how to display the sky. Since this is a large scene/level displayed as chunks, How can i display the sky then?
Do I need to create a very large skybox to enclosed my scene?

I am also thinking of including a portion of the skybox on each chunk, giving each chunk the ground model and the sky, and the chunk
that represents the edge of the world will also has the "wall".

My question is how is this done by commercial games?

Hope somebody can give advise on what is the best approach to this.
Sory for poor grammar, please ask if the above were not understood,

Thanks in advance.
Advertisement
Hello, IMO you don't need to display a *HUGE* skybox just to show the sky. I only draw a 10 unit size cube with proper texture on it. The cube is drawn first, the faces are facing inside, and I disable depth testing and depth writes when drawing it. Then I turn depth testing and depth writes back on and draw other objects in the scene. It creates illusion of *LARGE* box encompassing all objects in the scene.
the hardest part is the beginning...
You can set the skybox to always be centered on the player's location, so that it will move with them.
You can also draw your skybox as a 10x10x10 cube after the scene by setting your minz and maxz both to 1 in glDepthRange or a D3D viewport. What's really nice about this method (whether you use before or after) is that you don't need to worry about adjusting your far clipping plane to enclose the skybox bounds.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.


Hello, IMO you don't need to display a *HUGE* skybox just to show the sky. I only draw a 10 unit size cube with proper texture on it. The cube is drawn first, the faces are facing inside, and I disable depth testing and depth writes when drawing it. Then I turn depth testing and depth writes back on and draw other objects in the scene. It creates illusion of *LARGE* box encompassing all objects in the scene.


If i a have a 10 unit size cube with texture and render it with the depth testing disable,
what would be the coordinates(transform) of this cube when rendered,

will it always be centered on the player's position as what [color=#284b72]turch have suggested, or will it only stays on one place (0,0,0)?

If i a have a 10 unit size cube with texture and render it with the depth testing disable,
what would be the coordinates(transform) of this cube when rendered,

will it always be centered on the player's position as what [color=#284b72]turch have suggested, or will it only stays on one place (0,0,0)?


Center it around your camera (which often is 0,0,0) and transform it with the inverse of the camera rotation. With the technique described above the box can even be smaller than 10 by 10, just be sure that it fits into your frustrum. Also if you play on a fairly level terrain with no holes in it you might want to omitt the lower part of the skybox/skysphere because it will never be visible.


I am also thinking of including a portion of the skybox on each chunk, giving each chunk the ground model and the sky, and the chunk
that represents the edge of the world will also has the "wall".

Do you want to do this to mask the seam between the skybox and the terrain? For this the easiest solution might be to use fog in the color of the seam to mask this.

This topic is closed to new replies.

Advertisement