You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want a declarative way to render multiple scenes. Browsers have a limit on the number of webgl contexts. Additionally, things can't be shared between webgl contexts. Textures have to be uploaded twice, shaders compiled twice, etc. So having multiple contexts also has performance implications.
The recommended way to render multiple scenes and to effectively have multiple "canvases" is to use the "scissor test" feature to tell the renderer what area of the canvas to render to.
TresCanvas manages the canvas itself, and renders the scenes
a new TresScene component would let you declare a scene, and it's children would be the 3d objects/cameras/etc in the scene, like how we use TresCanvas today. It would render an empty div to act as the "viewport". The viewport defines the area of the canvas that will be rendered to.
I suppose I could put different objects on different layers and treat those layers as different "scenes", and then manually render those to textures, and then draw those textures to other canvases. Unfortunately for my situation, I think it'll get messy rather quickly.
This discussion was converted from issue #1083 on March 10, 2026 06:48.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Description
I want a declarative way to render multiple scenes. Browsers have a limit on the number of webgl contexts. Additionally, things can't be shared between webgl contexts. Textures have to be uploaded twice, shaders compiled twice, etc. So having multiple contexts also has performance implications.
The recommended way to render multiple scenes and to effectively have multiple "canvases" is to use the "scissor test" feature to tell the renderer what area of the canvas to render to.
The technique is fully described here: https://threejs.org/manual/#en/multiple-scenes
Suggested solution
Here's how I think it should work:
TresCanvasmanages the canvas itself, and renders the scenesTresScenecomponent would let you declare a scene, and it's children would be the 3d objects/cameras/etc in the scene, like how we useTresCanvastoday. It would render an empty div to act as the "viewport". The viewport defines the area of the canvas that will be rendered to.Alternative
I suppose I could put different objects on different layers and treat those layers as different "scenes", and then manually render those to textures, and then draw those textures to other canvases. Unfortunately for my situation, I think it'll get messy rather quickly.
Additional context
See also: https://threejs.org/manual/#en/multiple-scenes
Validations
All reactions