Opengl polygons

In OpenGL, you can only draw inverse polygons, only front polygons, or both. If you render a polygonal mesh of a triangle, clear the frame buffer, but not the depth buffer, and then only render backward polygons again. What do you expect to see?

I think the following answer that gave me is incorrect:

You should see the back of the triangles. The first rendering step will cause the depth buffer to have the depth values ​​of the triangles that the front facing. The second visual pass you make the back of the triangles, therefore, those that have the greatest depth value. Each triangle that is rasterized will have its own depth value compared to the current value depth for that pixel. Since the depth of the buffer is set to the entire nearest value depth (small values), but differing at the most deaf depth of the value (large values) the reverse side of the triangles will be displayed. "

But I think the answer is:

Since the depth buffer is not cleared and still contains the depth values ​​of the front triangles, it throws back triangles and displays nothing.

Which answer is correct?

+3
2

! , , ( ), , GL_LESS GL_LEQUAL, , , , .

, GL_GREATER GL_GEQUAL , , .

+1

, .

, . ( , - ), . :

alt text

0

Source: https://habr.com/ru/post/1780768/


All Articles