Summary
In this chapter, we explored the technique of ray marching and discovered how to apply it to the rendering of simple shapes or more advanced effects, such as clouds.
We first talked about the theory behind ray marching and focused on the importance of SDFs for defining arbitrarily complex surfaces.
Then, we saw how to implement a basic ray marching algorithm in Unity to render either a sphere or several random shapes. We also took this opportunity to reuse the compute shaders we introduced in Chapter 7, and we discussed how this technique allows us to create an infinity of procedural scenes quickly and easily.
Finally, we dived into a famous application of ray marching: the rendering of volumetrics such as clouds. We made our own skybox shader that creates a blue sky filled with clouds and used ray marching to give the clouds more volume. We then simulated light absorption and transmittance using color gradients and clever visual tricks.
This concludes our overview...