Implementing shadow mapping using mesh shaders
Now that we have looked at the different ways to render a shadow, we will describe the algorithm and the implementation’s detail used to render many shadow maps at once leveraging the mesh shader power.
Overview
In this section, we will give an overview of the algorithm. What we are trying to achieve is to render shadows using meshlets and mesh shaders, but this will require some compute work to generate commands to actually draw the meshlets.
We will draw shadows coming from point lights, and we will use cubemaps as textures to store the necessary information. We will talk about cubemaps in the following section.
Back to the algorithm, the first step will be to cull mesh instances against lights. This is done in a compute shader and will save a per-light list of visible mesh instances. Mesh instances are used to retrieve associated meshes later on, and per-meshlet culling will be performed using task shaders later on...