API

Function setThinInstanceCullBoundsPad

  • Set an extra WORLD-SPACE radius added to every instance's GPU-culling sphere.

    The culler derives each instance's sphere from the prototype's authored vertex bounds, so a vertex shader that DISPLACES geometry beyond them — terrain-following height offsets, tall wind sway, growth animations — can move a visible instance outside its sphere and pop it at the screen edge. The usual workaround is disabling culling for the whole mesh; padding the sphere by the maximum shader displacement instead keeps culling both correct and enabled.

    The pad is in world units, applied after per-instance scaling. 0 restores the exact authored bounds. Takes effect on the next culled pass (the culler reads it when writing its per-pass params), so it can be changed live.

    Parameters

    • mesh: Mesh
    • pad: number

    Returns void