I'm thinking of writing a pixel shader for Windows Terminal and I'd love to add phosphor persistence. For that, I'd need to save a couple previous results of the shader output and keep them across multiple pixel calls. Is there a way to declare a texture map that is preserved across multiple frames in time?
CodePudding user response:
Save the result of each shader call outside of the shader at the end of each frame and send it to the shader in a Texture2D on the next call. Sample the texture to find the previous pixel value. Nothing is preserved within the shader inbetween frames.