Sign in to follow this  

skybox

This topic is 4747 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

ive looked all over here in the forums and google and havent founda decent skybox tutorial. However i have managed to make my own but its rly wierd when it doesnt render something when im far away especially the corners... how do i solve this? ive read something about disabling the z-buffer.. how do i do this someone have an example?

Share this post


Link to post
Share on other sites
Sounds like you didn't turn off lighting and/or z-buffering before rendering it.

If you didn't turn off lighting then the corners could be so far away from a light source that they are black. And if you don't turn off z-buffering than your corners could be outside of your far-plane, in which case they won't render.

Share this post


Link to post
Share on other sites
"A bit weird" is not very descriptive, but obviously you should disable fog and lighting when rendering a skybox. Disabling depth-writing is a good idea (see glDepthMask); and depth testing serves no purpose either (glDisable(GL_DEPTH_TEST)). And render the skybox before everything else.

I posted a more detailed answer to a similar question yesterday, so look through my history if you're interested.

Share this post


Link to post
Share on other sites
Quote:
Original post by MARS_999
Not sure but what are your near and far planes set to? The volume of area of the view area might be to small and when you rotate the view its clipping the edges...


To elaborate on this point, with depth writing disabled, there's no need to use a stupidly large skybox, so it's only necessary to make sure it's large enough to clear the near clip plane.

Share this post


Link to post
Share on other sites
It looks like you're hitting the far clipping plane. It also sounds like you're moving the skybox with the camera. You should always leave the skybox centered on the camera. The terrain moves relative to the skybox, this is what makes it a skybox. Once you've fixed that all you need to do is change the scale of your skybox. Since it doesn't move the scale is unimportant, except that it must never be clipped by the near and far clipping planes. So pick a value halfway between the two. Then disable depth writing when rendering the sky box (since it doesn't have depth - it's treated as being infinitely far away) by using glDepthMast(GL_FALSE); (and the opposite when you render your terrain to reenable depth writing).

Enigma

Share this post


Link to post
Share on other sites
I agree with WeakSod, i really liked the tutorial at http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg2.htm#TextureMapping it was very helpful and easy to reference to help me create mine.

-THACO

Share this post


Link to post
Share on other sites

This topic is 4747 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this