Usually, when we render a geometry, we want to mimic the way we see the world--objects further away are smaller, objects closer to us are larger and they cover the objects behind them (obscure our view). In modern 3D graphics, this last effect (objects further away being obscured by objects being nearer) is achieved through a depth test. The way in which a depth test is performed, is specified through a depth and stencil state of a graphics pipeline.
Specifying a pipeline depth and stencil state
How to do it...
- Create a variable of type VkPipelineDepthStencilStateCreateInfo named depth_and_stencil_state_create_info. Use the following values to initialize its members:
- VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO value for sType
- nullptr value for pNext...