private void InitializeBuffers() { int count = dimensions.GridCellCount(); positionsBuffer = new ComputeBuffer(count, 3 * sizeof(float)); compute.SetBuffer(kernel, Constants.positions, positionsBuffer); preOffsetBuffer = new ComputeBuffer(count, 3 * sizeof(float)); compute.SetBuffer(kernel, Constants.preOffset, preOffsetBuffer); }
void GenerateMesh() { vertexCount = dimensions.GridCellCount(); vertexBuffer = new Vector4[vertexCount]; meshBuffer = new Vector3[vertexCount]; indexBuffer = new int[vertexCount]; PopulateMeshData(); StoreMeshData(); Debug.Log(vertexCount); }