#ECS - Baking Need help - Generated entities with duplicated materials.

1 messages · Page 1 of 1 (latest)

fleet sail
#

First of all , I do have a repo reproducing the issue :

https://github.com/Touhma/ECS-Conversion-Bug-Repro

Here is the context :
I'm looking for a way to convert prefab at runtime to instantiate building entities & multiples meshes with layers of stuff on it.
In the repo : Sphereprefab & OtherSphereprefab both with their own materials
Both Prefabs are present in a subscene : "conversion"
When Checking the entity hierachy we can see that it's indeed converting

What I would expect would be to have :
1st entity with the shape of the sphere & the material associated & same for the 2nd entity

But What i get is that both generated entities end up with both materials & meshes In their respective MeshRenderArray

CF : the screenshots

The only workaround that I found so far is to put each prefab in separate subscene and then the instatiation of the entity is correct.

In my case i'm gonna need more than 2 prefabs so I hardly immagine myself making a subscene for each prefab that I need to convert.

What Do I not understand here ? is this a bug ?

Thanks for you help !

fleet sail
#

ECS - Baking Need help - Generated entities with duplicated materials.

stiff sail
#

Don't mind it

#

It is onlu used to resolve asset dependencies during subscene loading

#

And during unloading

#

For rendering RenderMeshInfo is used

#

Which contains indices of registered meshes and materials in BatchRendererGroup of graphics system

fleet sail
#

@stiff sail where did you find that information ?

stiff sail
#

at least he clarified

#

that RenderMeshArray is smth not to rely on in runtime

#

as I tried to obtain mesh from entity in runtime