I'd like to make a paint program and am trying to figure out an efficient way to lay down brush strokes. Basically, I need to create one image to be the canvas, and then repeatedly draw the brush head over it following the path the user modes the pen in.
I'm having trouble figuring out how to do this in Godot. In OpenGL it would be straight forward - create an offscreen buffer, and for each point of my brush stroke and draw a quad which bounds the brush head. Then when I'm done, the offscreen buffer will have the complete stroke. This would also let me do things like change the scale, rotation and opacity of the brush head along the path of the stroke. I could also not be restricted to just alpha blending by writing a custom shader to mix the brush with the background. I could also set a data type of the buffer.
I'm trying to find the equivalent in Godot. SubViewport gives you an offscreen buffer, but you can't pick the data format and rather than drawing geometry to it immediately you need to create node, add it to the subviewport and then wait on the Godot engine to draw everything in a separate thread. Is there a way to composite more directly like the OpenGL example I gave, or do I have to try and work around this with SubViewports?