Depth Test

Painters algorithm is inefficient because " It simply paint the background objects first and then paint the near objects over the top of them. This may use a trivial amount of paint on the canvas (much less be useful for manual painting), but for graphics hardware, this results in repeated writes to the same fragment location, each of which has a performance overhead. Too much overwrite slows down the rasterization process, and we call such renderings fill limited" so in case of GL_DEPTH_TEST we discard the fragments in depth test only, but till then we process the fragments through rasterization and all because rasterization takes place independently for each primitive. so there would be very little performance gain for operations after depth test.

Is that correct? I am assuming here it is not tile-base rendering in which case there is early z-killing at the time of rasteriation.

Hmm, are you describing reasons why the painter’s algorithm is inefficient or reasons why the z-buffer algorithm is inefficient?
Also, this does sound a bit like a homework question…

I am trying to figure out the difference in the performance of painter’s algorithm and z-buffer algorithm. In the first one, pipeline is execute till the end for each fragment while for the second one it is executed till depth test where we discard the values. Is that correct?
If so, I think there wont be much performance gain as compared to early z-killing for which we skip the frag shader too.

You are omitting one step from painter’s algorithm: sorting of polygons by depth.

I almost forgot that one. Thanks for your inputs.