Simulation with Material and Render Target does not update properly

I’m trying to write a simulation (Cellular Automaton) in a material custom node. For this, I take an initial state
from a Render Target, perform a step of the simulation in a custom node and write the result to the same Render Target
in the event tick node of a blueprint actor.

The problem is that, because you can only write additive materials to Render Targets, the material just fills up quickly.
If I clear the render target between writes, the simulation ends because I effectively lose the previous state the material
needs.

I tried writing to 2 Render Targets like this:

  1. simulate the next step
  2. write to one RT
  3. switch to displaying this RT with a parameter from the blueprint
  4. clear the other RT
  5. write the current state of the material in the other RT
  6. switch to displaying the other RT and repeat.

This works in that the simulation continues BUT it blurs out and moves slowly to the side. I assume there is a slight delay and I am not actually feeding the current last state of the simulation. How do you go about this? Are there examples of something like this available?

If you do it in the order you typed above then consider this:

4 - you CLEAR the reference (it will return NONE now)
5 - you try to write data from nothing (?)

Or am I wrong here as it may be you clear ref 1 and access ref 2 - it will work as long it’s still valid

Place a IsValid node before you try to write the data to check if it really returns any info, if not - it will simply go through NotValid and there you can just place a PrintString to debug