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?
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.
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.
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.
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.
glDepthMask(GL_FALSE);
DrawSkyBox();
glDepthMask(GL_TRUE);
DrawEverythingElse();
Have you tried doing it this way?
DrawSkyBox();
glDepthMask(GL_TRUE);
DrawEverythingElse();
Have you tried doing it this way?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement