Talk:Petit Computer 3/@comment-5106053-20140808002331/@comment-5334617-20140808144413

Right... each time you write (a nontransparent colour) to a pixel, you have two z values: what's already there (or infinity if nothing is there), and the 'current' z value. If what's already there will obscure the current drawing, the current drawing should not go on top (so do nothing). If what's already there will be obscured by the current drawing, then show the current drawing instead. There is no point in preserving colour information that has no effect on the image, it would just waste memory, so those values are simply discarded.

As to how the eye and brain combine two 2D images, one from each retina, into a 3D model of the world... that's a very interesting and quite involved topic, but it is different from the topic of how computer programs generate stereoscopic images, so perhaps doesn't belong on this particular wiki page.