We’re trying to apply a MeshStandardMaterial (working in the main scene) accross multiple additional scenes, but when we assign the material to objects in another scene, they’re been rendered black and we don’t know why. Console ist ok, the material is assigned correctly (same uuid + x).
You can’t share them, the first renderer rendering will allocate resources (the program) for it’s own context, though, you could use just one renderer and just canvases for the other and render the renderer.domElement on them.
still no success, but it could be that we misunderstood your proposal
you could use just one renderer and just canvases for the other and render the renderer.domElement on them.
May be I should explain more what we are trying to achieve:
We have 2 scenes. Scene 1 contains complex, partially (sometimes) animated geometry. Scene 2 contains multiple objects with very simple animated (sometimes) geometry
Both scenes should share the same environment for reflections etc.
We want to layer the two scenes: Scene 1 (opaque) as background. Scene 2 (transparent) as overlay
Why? Performance: in case the geometry in Scene 1 (complex) is not being animated we don’t wan’t to re-render it (expensive) while Geometry in Scene 2 (simple) is being animated (cheap).
Our first try was to create two separate renderers for each scene, render to two different canvases while using the material already created for the first scene including the environment map etc., but this doesn’t function.
We could create two separate renderers, create the environment the same way two times and render to two different canvases (opaque and transparent), but some other solutions reusing the material and already created environment-map would be more elegant of course (if possible, but it seems it’s not).
We’ve searched for some kind of “layered” rendering option, but this doesn’t seem to be possible?
We’re currently considering rendering Scene 1 to a texture as canvas-background or something similar…
An update on progress:
We got awesome performance increase (we are developing “mobile first”) by rendering Scene 1 containing complex model / animation into a renderTarget.texture and applying it to a plane placed inside Scene 2 as background.