Jump to content

  • Log In with Google      Sign In   
  • Create Account

implementing skybox in a chunked scene/level


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 cebugdev   Members   -  Reputation: 330

Like
0Likes
Like

Posted 12 January 2012 - 05:00 AM

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.

Sponsor:

#2 Triad_prague   Members   -  Reputation: 140

Like
2Likes
Like

Posted 12 January 2012 - 06:30 AM

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...

#3 turch   Members   -  Reputation: 590

Like
0Likes
Like

Posted 12 January 2012 - 08:03 AM

You can set the skybox to always be centered on the player's location, so that it will move with them.

#4 mhagain   Crossbones+   -  Reputation: 8277

Like
0Likes
Like

Posted 14 January 2012 - 10:52 AM

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.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#5 cebugdev   Members   -  Reputation: 330

Like
0Likes
Like

Posted 16 January 2012 - 12:28 AM

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 turch have suggested, or will it only stays on one place (0,0,0)?

#6 doeme   Members   -  Reputation: 718

Like
0Likes
Like

Posted 16 January 2012 - 04:53 AM

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 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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS