Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Why does setting a non-zero Bound.center move meshes?

Discussion in 'General Graphics' started by b0nes123, Apr 6, 2021.

  1. b0nes123

    b0nes123

    Joined:
    Nov 6, 2019
    Posts:
    4
    Hi all, I've been playing around with Graphics.DrawMeshInstancedProcedural, but I've ran into an issue with the Bounds parameter. Whenever I set the Bounds.center to any non-constant amount, the mesh is moved by a corresponding amount. To illustrate this, here are 64 chunks rendered with GraphicsDrawMeshInstancedProcedural.

    bounds no mid.PNG

    Each quad is rendered with its own separate call of the Graphics.DrawMeshInstancedProcedural method, and each Bound.center is set to zero. However, when I set the Bound.center to the midpoint of each chunk this happens:

    Bounds.PNG

    Since, as I understand it, the Bounds parameter is only telling the GPU if the mesh should be rendered not where the mesh should be rendered, why does Bounds have any effect on the position of the mesh being rendered?
     
    Last edited: Apr 6, 2021
unityunity