Remix.run Logo
swiftcoder 38 minutes ago

Reverse painters algorithm is still painters algorithm. You trade off the cost of a full screen clear before the frame, in return for eliminating overdraw

knome 30 minutes ago | parent [-]

You could avoid a full screen clear by using the y-buffer to draw in sky segments after rendering terrain.

swiftcoder 28 minutes ago | parent [-]

You still need to have some sort of mask to tell you which pixels have not yet been written this frame

knome 12 minutes ago | parent [-]

that's what the y-buffer is that the article mentions in the front-to-back rendering section.

it tracks how tall each columns write is so you can use it to only write the diff between it and the voxel behind it, skipping writing anything at all if the voxel behind is shorter than the current height.

So once you're done rendering front-to-back, you've got a y-buffer of highest-writes you can slap your blue sky across from highest-to-screentop on each line, avoiding the need to clear by write the sky to the full screen before starting the render.