Closed georgewsinger closed 4 years ago
I just created a new popups
branch in SimulaVR/Simula to track code experiments.
Right now the branch has added a new GodotRenderTarget
NativeScript type that extends RigidBody2D
(so that we may jam texture updating logic into _draw
command). Right now textures are showing up as black:
and the RenderTarget._draw
function isn't even getting called, but this might get us a step closer.
:heavy_check_mark: I pushed some working popups code. It's got a few bugs, but I'm going to open up new issues for them to keep things organized.
Context. Currently Simula renders each popup as if it were its own unique surface:
Instead what should happen is that these subsurfaces should render flat onto their parent surfaces (as happens on a normal 2D window manager).
Viewports. In order to do this, we will render each parent plus all of its subsurfaces onto a
GodotViewport
before applying its texture onto ourGodotSprite3D
. We've had trouble with this in the past and so I'm here opening up the can of worms again.Attempt 1: Using a GodotViewport to render parent surfaces yields errors. As a first step towards solving this problem we can try to duplicate our current functionality using a
GodotViewport
. Once we get this working it should be relatively straightforward to get subsurfaces rendering properly. Here is some starting code:which yields black textures + the repeated console errors
AFAIK only 2D nodes have
_draw
functions, so I'm not sure how this should be handled with ourGodotSimulaViewSprite
(which inheritsSpatial
). Nevertheless, if we comment out some Godot lines to get around this error:then we get new errors repeated to the console:
Very annoying.