So I cannot make the text renderable to work when it’s added on the fly. It seems that after the scene was registered, you cannot add more text renderables.
This doesn’t have any affect at all. When inspecting a scene after adding text renderables, I noticed that scene._renderables is not changing, no new text renderable is added. I’m quite confused if this is a bug, or intentional.
Okay, this somehow proves my point. But I guess to be able to add a new text renderable on the fly I have to re-register the scene. I was just surprised I don’t need the same thing when adding new meshes.
This is not intentional; it’s a gap in the current runtime scene-mutation support. addTextRenderable() currently queues work that is processed by registerScene(). Once the scene is registered, calling registerScene() again is a no-op. Meshes already have a dedicated incremental runtime-build path, but 3D text renderables do not yet.
As a temporary workaround, unregister and re-register the scene:
Use registerSceneWithShadowSupport() instead if that is how the scene was originally registered.
If you only need to change the contents of existing text, add the renderable before registration and call updateTextData() at runtime; those changes are uploaded automatically.
Thanks for reporting this—we should treat runtime addition of a new TextRenderable as a bug to fix.