Search Unity

Question BatchRendererGroup properties override approach

Discussion in 'Graphics for ECS' started by Opeth001, Apr 11, 2021.

  1. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,117
    Hello Everyone,

    I'm trying to learn how BatchRendererGroup passes properties to the Shader when drawing a batch.

    from what I understood (please correct me if I'm wrong)

    BatchRendererGroup uses a large global compute buffer that contains 128 Shader Properties per instance even though it uses a single Shader Property.

    My question is:

    EG: let's say we have 10 spheres and 10 squares that survived the frustum culling, Normally 2 draw calls will be requested.

    How does BatchRendererGroup pass these properties to the shader using a single global compute buffer ?
    to be more precise how to get the correct Batch/Instance index in Global Compute Buffer from the shader ?

    Thank you in advance!
     
    Last edited: Apr 11, 2021