How to share textures with scene in different engine?

Hi~
I want to achieve a material-viewer like NME do. Once I select one material in main scene or other place, material-vierwer display a sphere or other mesh with the selected material.


I find textures can be only shared with scenes who belong to the same engine. I have a try to use multi-views, it looks like only supporting same-size canvas. I don’t know what is the best way to share materials and textures with scene in different engine.
Looking forward to any helper :grin:

First, I assume you want to move the entire material, and not just the textures. What kind of materials do you want to share?
If you work with standard materials, I guess there are other ways, but why not serialize the material and parse it in the other environment? It might not be 100% realtime, but it can happen quite fast.

2 Likes

Hi, I have a vue page to control material’s property, so I prepare to have a copyFrom function to make materials both in mainScene and material-viewer be changed at same time. I don’t how to deal with texture in copyFrom function when I want to change xxx.albedoTexture a new Texture. Do I have to load it twice and save them twice in memory?

That would be the simplest solution, yes. If you are using binary textures (and not dynamic textures) this is the simplest way to achieve that. I assume the textures are not that large that they can’t be loaded in 2 contexts

1 Like

I have a try to use readPixels to another engine, it is simplest and fast in my pc. Thank you for your helper :grin:

1 Like