예제 #1
0
        public void Wrap(Membrane mem, float dt)
        {
            var ker = kernels[KernelType.Wrap];

            compute.SetBuffer(ker.Index, "_Cells", cellsBufferRead);
            compute.SetInt("_CellsCount", cellsCount);

            compute.SetBuffer(ker.Index, "_MembraneNodes", mem.NodesBuffer);
            compute.SetBuffer(ker.Index, "_MembraneEdges", mem.EdgesBuffer);
            compute.SetInt("_MembraneNodesCount", mem.NodesBuffer.count);

            compute.SetFloat("_DT", dt);
            compute.SetFloat("_Tension", mem.Tension);
            compute.Dispatch(ker.Index, cellsCount / (int)ker.ThreadX + 1, 1, 1);
        }
예제 #2
0
        public void Wrap(Membrane mem, float dt)
        {
            var ker = wrapKer;

            compute.SetBuffer(ker.Index, "_Predators", predatorsBufferRead);
            compute.SetInt("_PredatorsCount", count);

            compute.SetBuffer(ker.Index, "_MembraneNodes", mem.NodesBuffer);
            compute.SetBuffer(ker.Index, "_MembraneEdges", mem.EdgesBuffer);
            compute.SetInt("_MembraneNodesCount", mem.NodesBuffer.count);

            compute.SetFloat("_DT", dt);
            compute.SetFloat("_Tension", mem.Tension);
            compute.Dispatch(ker.Index, count / (int)ker.ThreadX + 1, 1, 1);
        }