If I perform
#define SCREEN_SIZE 512
glEnable(GL_DEPTH_TEST);
glViewport(0, 0, SCREEN_SIZE, SCREEN_SIZE);
Does this make my depth buffer size SCREEN_SIZE x SCREEN_SIZE?
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.
No. The depth buffer is part of the window frame buffer. Usually such a window framebuffer consists of
All these planes have the same size, namely the size of the window on which the OpenGL context has been created on. The viewport just defines the subset of the window that will be mapped the [-1, 1] range of normalized device coordinates, i.e. it selects a part of the framebuffer which will be used as projection target. The viewport doesn’t even need to clip things “outside” the viewport range. If you need this, you must combine it with a scissor test.