For example, let's assume I'm rendering cascaded shadow mapping, but for whatever reason, instead of one of the typical approach, I do the following:Render the lowest resolution shadowmapCopy part of the shadowmap to the next shadowmap, covering a smaller area(and thus more dense)Compute a stencil mask based on different points' distance from camera, e.g. more detail on edges, and on points closer to the camera, reusing the old shadowmap elsewhere.Render the next, higher-density shadowmap with the aforementioned stencil.What performance can I realistically expect from that? If only 50% of the pixels(or should I say fragments here?) pass the stencil test, do I save 50% of the rendering time, less, none?If this is a poor example, my fallback question scenario is a static scene, where the previous frame's result is reprojected, with an error accumulator in alpha, and a stencil mask is computed based on misses or too high error rates(e.g. position of the previous frame's reprojected pixel is too far from the new target pixel).
How much processing power does stenciling actually save?
optimisation;stencil test;stencil buffer