Depth Testing in OS X Metal

Published 2016-09-17
In order to have depth testing the depthStencilPixelFormat must be set on the MTKView and the MTLRenderPipelineDescriptor. This is in addition to having a MTLDepthStencilDescriptor. In this video you can see the cube disappearing into the ground whereas without depth testing it would always appear above the ground even if it were far below it.

Source code at github.com/btipling/blockens-perspective

All Comments (1)