is there an out-of-the-box technique to render some geometry only in the Hi-Z pass. or otherwise write to the depth buffer to cut down on overdraw when there are lots of opacity masked pixels flying around?
We’re wrestling with large amounts of foliage draw, and the cost driver – on XB1, anyway, which is our min spec – is quad overdraw. Conventionally authored trees (eg, speedtree) are murder on perf because they use opacity masked cards in great profusion – thus, tons of overdraw…
One idea which I’ve been considering is doing an offline analysis of the contents of those masked quad and creating geometry which renders into the depth buffer as if solid, sitting at or just ‘behind’ the entirely opaque portions of the leaf cards.We’d still be rendering a lot redundant pixels up close, but more distant views should benefit from real opaque geometry. Plus i could selectively enlarge the occluders farther from the camera, increasing the effective opacity of the whole tree in lower LODs and cutting down on overdraw even more
How would one go about creating an occlusion only-shader? It doesn’t seem to be possible using the shader graph alone, unless I’m missing something. Would this be doable via a USF?