void Awake() { windField = GetComponent <ComputeWindField>(); getWindCompute = Resources.Load <ComputeShader>("GetWindAtPosition"); getWindKernelSinglePos = getWindCompute.FindKernel("GetWindAtPosition"); getWindKernelPosArray = getWindCompute.FindKernel("GetWindAtPositions"); }
void Start() { windField = GetComponent <ComputeWindField>(); Vector3Int windFieldNumCells = windField.GetNumCells(); windField1DBuffer = new ComputeBuffer(windFieldNumCells.x * windFieldNumCells.y * windFieldNumCells.z, bufferStride); kernel = windFieldTo1DCompute.FindKernel("WindFieldTo1DBuffer"); groupSizes = new uint[3]; windFieldTo1DCompute.GetKernelThreadGroupSizes(kernel, out groupSizes[0], out groupSizes[1], out groupSizes[2]); }