Members - Reputation: 122
Posted 23 September 2001 - 01:09 AM
Posted 23 September 2001 - 10:28 AM
Posted 24 September 2001 - 09:21 AM
> How do I do that?
glEnable(GL_DEPTH_TEST); // Enable depth testing
glDepthFunc(GL_LESS); // type of depth testing
// ... render your opaque objects here ...
glDepthMask(GL_FALSE); // Disable depth buffer writes
// --- render translucent objects ...
glDepthMask(GL_TRUE); // Enable depth writes
> I didn''t know you could disable writing to the depth buffer... they will still need drawn properly compared to other objects though?
Sure, it''s a standard trick used to render transparent objects. They will be correctly depth buffered against the opaque ones (since the depth test is still active), but they won''t mess the zbuffer values anymore, since you made the zbuffer read-only.