Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Why are Entities with a SpriteRenderer component stored in individual chunks?

Discussion in 'Graphics for ECS' started by JonasMummSeal, Aug 17, 2023.

  1. JonasMummSeal

    JonasMummSeal

    Joined:
    Mar 3, 2021
    Posts:
    4
    We're currently using Entities.Graphics v1.0.14 with the SpriteRenderer companion component. Upon inspecting the archetype of our entities, it appears all our entities are stored in individual chunks (see screenshot).
    upload_2023-8-17_15-56-33.png
    Would this be the expected outcome when using the SpriteRenderer? We feel like we got the issue pinned down to being caused by the SpriteRenderer, as removing the SpriteRenderer component moves the entities into chunks of multiple entities.
    Is there any universal way of finding out why multiple entities aren't stored in the same chunk?
     
    JBirn likes this.
  2. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    334
    Typically the answer to this question is a shared component, and in this case I'm guessing it might be the "EditorRenderData" component.

    Since SpriteRenderers are not supported by Entities Graphics at the moment, I think you could probably safely delete this component.

    Since the SpriteRenderer companion component is not itself shared, I think that shouldn't force the Entities into separate chunks by itself.
     
  3. JonasMummSeal

    JonasMummSeal

    Joined:
    Mar 3, 2021
    Posts:
    4
    Thanks for the speedy response! Unfortunately removing the EditorRenderData component (or in fact all shared components) from the archetype didn't resolve the issue. We're also seeing the same behaviour in builds. Are there any other options to check what's going on here?
    upload_2023-8-18_8-37-47.png