How can I use the previous frame out as this frame's input texture

Hi, i’m implement some temporal effects using babylon.js. ‘temporal’ mean I need the framebuffer of previous frame as the input texture to this frames. I know that in the same frame we can use the framebuffer of previous pass as the input texture to the next shading pass. But how can i use the framebuffer data between frames, thanks!

1 Like

Hello you have to use a postProcess for that: the PassPostProcess

This PP will do nothing but capture the current frame: https://www.babylonjs-playground.com/#18QHZC#2

You can then use the postprocess like a texture (with postProcess.inputTexture)

1 Like

Will this method copy the data back to cpu for reuse? Or it is on gpu.

All in the GPU