“Render Target won’t accumulate when using Draw Material to Render Target (fog of war test)”

Hi everyone,

I’m currently trying to use a Render Target to create a sort of cumulative texture (basically for a fog of war system). Before setting up parameters and moving on to the important part, I wanted to test if the basic logic worked.

So I built a material that uses the Render Target multiplied by some coordinates that define where another circle should appear. This material is then used as a “brush” for a Draw Material to Render Target on the same Render Target that I’m multiplying.

The process I’m trying to achieve is:

  1. Clear Render Target 2D on the Render Target at BeginPlay.

  2. Create an instance of the Brush Material.

  3. Start a loop:

    • Set random coordinates in the Blueprint with Set Vector Parameter Value.

    • Call Draw Material to Render Target on the same Render Target.

The expected result is that the Render Target should keep the previous state (circles already drawn) and add a new circle each pass, multiplying the result over and over until the screen eventually goes black after ~0.5 second intervals.

The problem: it doesn’t work. Instead, it just appears completely black right away.

Alright, I found a solution. I didn’t really want to resort to this, but at least it works this way. I still don’t quite understand why I have to swap between two textures instead of just modifying the same one directly.