Rework backbuffer and offscreen rendering code
Please rework the code that allows users to save screenshots and animations. This is a cleanup of the hacky implementation from #18446 (closed). This should just work, not need to run with an environmental variable.