Store value in material across frames

Hi, I’m trying to create a datamoshing-like post process material and have managed to pretty much get the effect I’m looking for, but I have to store a value across frames in my material. I’m reading from the velocity buffer, but I would like to add this value to the value from the last frame.

I’m aware I can pass this data off to a blueprint and then read it from there, but I was wondering if it can be done completely in the material. Any help is appreciated.