Home > Back-end >  Is there a way to save an output texture to be used as input for the next iteration of that pixel in
Is there a way to save an output texture to be used as input for the next iteration of that pixel in

Time:07-22

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.

  • Related