Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Hybrid Renderer doesn't update batch bounds unless entity in batch has moved

Discussion in 'Graphics for ECS' started by flagredomega, Jun 22, 2022.

  1. flagredomega

    flagredomega

    Joined:
    Oct 12, 2017
    Posts:
    12
    Hybrid Renderer only calls UpdateBatchBounds() if one of the entities in that batch has had its LocalToWorld updated that frame.

    This means that updating an entity's RenderBounds doesn't have any effect until an entity in the same batch moves.

    A workaround is to add this after each update to RenderBounds:
    Code (CSharp):
    1. var localToWorld = EntityManager.GetComponentData<LocalToWorld>(job.Entity);
    2. EntityManager.SetComponentData(job.Entity, localToWorld);