I think I may have misunderstood how the sharedcomponent thing works, I assumed it is per entity, but it seems to be per chunk instead? I would need the RenderMesh component to be unique per entity, but the mesh pointer inside shared, is this a thing or I have to be sure that the RenderMesh in a chunk are actually sharing the same mesh pointer too?
I can see it, but then isn’t there any way at the moment to be able to change meshes continuously without performance impact?
I can’t understand why the RenderMesh struct must be shared at all. I understand it needs to support the hybrid architecture to hold references, but the references should be shared not the component itself
I think I start to understand how they work. If it’s true that the shared components are hashed, it shouldn’t move the entity if the hash is the same. I have only two “different” (has different hash) components there, so I am not sure why it’s so slow.
I don’t think there is check to see if the old component data is the same as the new one,
it’s just a thought, but maybe you could make a check in your code to see if the new mesh is not the same as the old one, and if it’s not the same, then execute “SetSharedComponent” ?
yep that can work too, but if I understood correctly how it works, since the hashed shared components create a new archetype, I could just query the entities with that shared component.
If this is possible, I would solve my problem too. Is there a way to return all the entities that share the same shared entity component? I will need to ask something like give me all the entities that share the RenderMesh component with the hash X