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:
- simulate the next step
- write to one RT
- switch to displaying this RT with a parameter from the blueprint
- clear the other RT
- write the current state of the material in the other RT
- 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?