I'm trying to create a simple drawing program where I allocate an off screen image and then draw a trail of small circles on it as the user clicks and drags a mouse across it. I'm having trouble finding a good way to do this in Godot.
Viewports looked promising, but they are cleared and redrawn each frame and only draw the child nodes placed on top of them. I need an image buffer that retains state each frame and only changes when I explicitly draw to it in response to a UI event.
The other method I can see would be to create an ImageTexture and then grab the Image from get_data() and update it one pixel at a time using Image.set_pixel(). This strikes me like it would b every slow and it doesn't allow me to use advanced features like shaders.
I checked out the GDPaint demo, but it doesn't use an offscreen buffer. It just creates a queue of drawing events and redraws everything each frame. This solution won't work for me as I need to store everything in a texture. (It will also take longer and longer to render as the user continues to draw).
Is there a good way to do this?