GAMES IN PROGRESS
Latest Videos
Home
/
Indie Game Developers
/
Re: cOg Mission
/
How my Shaders Combine Indirect Rendering and Per-Instance Properties from Burst-Compiled Jobs

How my Shaders Combine Indirect Rendering and Per-Instance Properties from Burst-Compiled Jobs

5 min
We conclude the rendering miniseries by digging into the shader code to see what we need to do to have our shaders consume all of this data and render everything correctly. We will focus on the parts of the shaders that use the indirect data and apply the per-instance specifications, rather than the entirety of the shaders, since I’m sure you have other plans for today as well! In the last video we saw how we use Graphics.RenderMeshIndirect to send the draw calls to the GPU after the data has been prepared in burst-compiled Jobs. Included in this data are three buffers that are important to our shaders that accompany this call. The first two buffers provide the shader with the index and transformation matrix of each object to be rendered. We fill the buffers with the matrices in view as previously determined, and their indices, and then send them to the material of the render parameters. In order for the shader of the material to have access to this data, we need to perform some indirect rendering setup in the shader. Our third and final buffer contains the instance properties. As we’ve seen during the last video, this buffer is also sent to the material of the render parameters. This is the story of implementing what I've learned into a gridless, interactive, world-building sandbox game called Minor Deity. Minor Deity on Steam: https://store.steampowered.com/app/3876240/Minor_Deity/ Minor Deity Discord Server: https://discord.gg/2NEb4HxwhF 00:00 Intro 00:42 Indirect Rendering 03:03 Per-Instance Properties 04:33 Outro