I’m currently working on a rhythm game with a 3D playfield and 2D UI. For Completely Normal Reasons™, I’m planning for the UI to be movable and manipulable in a couple different ways, and for ease of making fancier displays I’m looking into using CanvasLayers. I’d like to use a separate CanvasLayer/ViewportTexture for each element, but I’m not sure how well that’d perform. Is there a meaningful performance concern with multiple SubViewports through different ViewportTextures within a scene? Is there some way to do this that’s more efficient? Please let me know!
Why are you against using Control nodes for the UI? Are you trying to achieve a 2D UI “floating” in 3D space? How many ViewportTextures are we talking about? Why not build a test scene and find out for yourself?
Control nodes still need a CanvasLayer. Weirdly aggressive accusation off the bat.
That’s basically my only option. If 2D-space and 3D-space in Godot used even remotely the same coordinate system I wouldn’t have nearly as much of a problem - I want the playfield and the UI to be movable through the same API for charts without having to do all the complex math to convert between coordinate systems.
Probably between five and six, depending on how I decide to lay elements out
The computers I have on-hand are pretty high-spec for development purposes, and I don’t want to make a game that’s only accessible to people with high-spec hardware without realizing it.
You can lower the impact by reducing the update mode and clear mode, for 2D only you can disable 3D rendering, and maybe GUI > disable input (depends on how you want to interact with your UI, but worth it to disable where possible). You mention only having 6 so I wouldn’t sweat it, a frame buffer on it’s own isn’t tough on the system, GPUs are really good at drawing and all that; problems usually arise when one draws the entire 3D world in a framebuffer, almost doubling the frame time.
I want the playfield and the UI to be movable through the same API for charts without having to do all the complex math to convert between coordinate systems.
It’s not that of a complex math though. Using viewport textures on 3D objects works great but you’d still need to check performance for your specific use case. I wouldn’t worry too much if it’s only 6 though. If you use Control nodes you can always sync 2D and 3D positions by unprojecting through your camera.