when using Opengl to draw scene graph, I saw there is always a glClear(GL_DEPTH_BUFFER_BIT), what’s the purpose for this?
when using Opengl to draw scene graph, I saw there is always a glClear(GL_DEPTH_BUFFER_BIT),
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It clears the depth buffer. The depth buffer is the part of the frame buffer, that makes primitives being occluded by other primitives in front of them. Without clearing the depth buffer, you’d draw into the depth structure of the previous drawing.