0
votes

at the moment, I am rendering a camera to a texture and put the texture on a plane mesh. This works, in the scene the texture was recorded from.

When putting the same mesh into a different scene, which is running in a div, the mesh shows up, without texture. Same, when I put the texture on a mesh, which is created in the div- scene.

The mesh seems to have a texture, because it is black and not red, as initialized. When leaving away the texture, it does show up in red.

When I put the mesh into both scenes, which is the main scene and the div-scene, the mesh only shows in the main scene, the camera takes its shots from, regardless which one addad first into "its" scene.

Please be so kind and tell me, how I can use this texture, in a different scene.

Thanks in advance.

2

2 Answers

0
votes

I don't quite understand what are you doing. But you can save your image as a canvas and create new texture from it.

0
votes

So I've asked a similar question before finding your question and a friendly user by the name of ther answered my question. (I wasn't able to upvote him yet but as someone who answered a question I believe he deserves some)

THREE.js Render target texture will not draw in a different scene

In summary, the solution was to use the same renderer to render the scenes along with the camera you'd like to view through.