Method CalculatePointGrid
CalculatePointGrid(Vector4, Vector2, out Vector2)
Computes the grid layout for a uniform set of points covering the given world bounds at the given spacing.
public static Vector2Int CalculatePointGrid(Vector4 worldBounds, Vector2 spacing, out Vector2 lowerLeftPoint)
Parameters
worldBoundsVector4The world bounds of the biome as x, y origin and z, w size.
spacingVector2The distance between adjacent points in world meters along each axis.
lowerLeftPointVector2Receives the world position of the lower left grid point, snapped to the spacing.
Returns
- Vector2Int
The number of grid points along the x and y axes, each rounded up to a multiple of eight.
Remarks
This is the pure sizing step shared by the Points node and any node that needs to allocate a matching position buffer before dispatching GeneratePoints(ComputeBuffer, Vector4, Vector2, Vector2, Vector2Int). The instance count is the product of the two returned axes.