Skip to content

Instantly share code, notes, and snippets.

The depth test

What is it for

When any geometry gets rendered (remember that even for simply drawing textures you need a geometry to "hold" the texture) it gets drawn on top of what's already been rendered. There are a lot of cases in which this behavior is fine or even desirable, ie. 2D rendering. On the other hand, there are cases in which this behavior might not be what you are looking for, usually when drawing three dimensional objects. For example, you want to draw two spheres that are partially overlapping. Each sphere is a different geometry, so one will get drawn before the other. When the depth test is disabled, one sphere will get drawn on top of the other regardless of its depth - its position in the Z axis-, making it look spatially incorrect. To get the spatially correct looking render what we want to happen is to have drawn only the pixels of the overlapping geometries that have the lowest depth. in order to achieve this is that we use depth testing.

To enable the depth test call

ofEn

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 26, 2024 12:21
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname