Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

supagu

sky box

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

im wanting to render a sky box, currently i disable depth buffering, and make it so it always passes glDisable(GL_DEPTH_TEST); glDepthFunc(GL_ALWAYS); but if i draw something outside of the sky box it gets cropped, so this isnt the right effect im after. I want the sky box to be rendered, but pushed right back to max depth of the depth buffer. how is this done?

Share this post


Link to post
Share on other sites
Advertisement
disable writing to the depth buffer when rendering the skybox with "glDepthMask(GL_FALSE);" (be sure to turn it back on afterwards). then everything else will appear in front of the skybox, no matter how far away.

Share this post


Link to post
Share on other sites
Or disable depth testing altogether (glDisable(GL_DEPTH_TEST)), render the box, and re-enable it to draw your stuffs. I''m not sure if it''d be slower or faster than krez''s method, though. Probably doesn''t really matter.

Share this post


Link to post
Share on other sites
glDepthMask(GL_FALSE);
results in a white screen o.0

and my current method uses:
glDisable(GL_DEPTH_TEST);
glDepthFunc(GL_ALWAYS);

but this doesnt go all the way back to the end of the depth buffer.

Share this post


Link to post
Share on other sites
yeah i know ;p
when i tried it the first time and ran it i got a white screen and thought "this doesnt work" but the second time i relised i was building in release mode, and when it ran, there were no textures to load

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!