How do you make sure objects get rendered in the correct order if they overlap in the viewport? What if an object is only partially obscured by another one? When attempting to render a given pixel, we need a system in place that allows us to check whether a pixel has already been drawn at the same position and determine whether it is in front of or behind the one we are currently drawing. This requires us to store additional data every time we draw a pixel. We can’t just store the color of the pixel; we also need to store ...
7. The Depth Buffer
Get Building Quality Shaders for Unity®: Using Shader Graphs and HLSL Shaders now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.