I got a problem with the Canvas Render Target 2D I need paint in the ground but adding all the time to the texture, the problem when I add and update the old texture is gone and I need keep the old changes and the new ones, someone knows how to do this ?
To walk you through the spaghetti, a dynamic instances of the material RMLayers is created.
Two instances of MatRT are created to draw LatLongMat and DistGrid.
A new instance of MatRT is created to draw the dynamic instance of RMlayers, with the MatRTs that draw LatLongMat and DistGrid passed as texture parameters.
An instance of MatRT is created to draw NextStep.
A dynamic instance of the material LayerCombiner is created. The MatRTs that draw RMLayers and Nextstep are set as texture parameters.
The MatRT that draws RMLayers is updated every few ticks with a dummy camera position.
What I’m using it for is a bit heavy, but a lot lighter than the alternative. It can be used to ray march, without having to update the rayfield at all distances at the same time, and distant rayfields can be rendered at lower resolutions. I haven’t added the asynchronous rendering yet, cause I still have some texture seam glitches to work out, but this only adds 2-4ms to my frame. Most of that is due to the instruction count on my materials, not the render targets.
Would it be possible to use this approach and render to a texture instead of a new dynamic material, so that it can be used in a previously made material? I’m trying to figure out how to grab multiple actor locations in a scene, and update and add to a mask similarly to what is being done here.
[MENTION=474005]Austin P.[/MENTION] 4.13 has DrawMaterialToRenderTarget which draws to a render target asset. This can be used like a texture in a non-dynamic material.