I’m trying to use Godot’s Subvewport to do some fast rendering to buffers. I have a 3D scene set up that it uses a shader to render a quad. This quad contains data I want to use. I’m setting parameters on the shader first and then calling subviewport.get_viewport().get_texture().get_image() to get the image buffer containing my data.
This all seems to be done in a different thread, though, so is there any way to make sure that after I’ve updated my ShaderMaterial’s parameters that the quad has been redrawn before I call get_texture() to get the buffer image?
Thanks for the explanation, that helps clarify what’s going on behind the scenes. I was wondering, do you know if there’s a clean way to ensure at least one full frame has passed before grabbing the image? Like, would using await get_tree().process_frame (or a couple of them in a row) work reliably in this case? Or is there a better pattern to follow when working with SubViewports and shaders this way?