Hi, I’m relatively new to Godot. I’m trying to port a compute shader that does ray marching on a separate thread, and then use the resulting texture in a material in the engine. The renderer draws progressively, so first at very low resolution, and then successive dispatches fill up higher and higher resolutions until the texture is ready. The rendering times are very unpredictable (fractal iterations, shadows, etc.), so running this in a separate thread is ideal.
Now, it looks like I need separate RenderingDevices for this, but I can’t seem to share the textures between them. It works if I dispatch the compute shader from the main thread from _process(), but this is a lot slower, because it is synced to the monitor FPS. Is there a way to share texture RIDs between threads that I’m unaware of?
Then about the texture. I can render to a Texture2DRD as per example, but ideally I would like to render to a TextureCubemapRD. Unfortunately, this is not available from the pulldown in the editor. Is there a way to work around this? Maybe hack the tscn with a text editor directly?