In my previous post, I introduced the idea of L-systems and how I used them to generate foliage procedurally. I quickly ran into performance issues, which I was able to address somewhat with frustum culling. In this post, I’ll explain how I further optimized the scene by using DirectX 12’s new mesh shader pipeline. I’ll also touch on my use of a Z-prepass, which mitigated some overdraw issues, especially with a large number of trees and leaves.