示例#1
0
 public void Step(CellularGrowth cell, float t, float dt)
 {
     current = Mathf.Lerp(current, radius, dt * 10f);
     InteractNodes(interactNodesKer, nodePoolCount);
     Stretch(stretchKer, dt);
     Expand(cell, expandKer, dt);
     UpdateNodes(updateNodesKer, dt);
     Relax(relaxKer, dt);
 }
示例#2
0
        protected void UpdatePredators(Kernel ker, CellularGrowth cell, float t, float dt)
        {
            compute.SetBuffer(ker.Index, "_Predators", predatorsBufferRead);
            compute.SetInt("_PredatorsCount", count);

            compute.SetFloat("_DT", dt);
            compute.SetFloat("_Time", t);
            compute.SetFloat("_Limit", limit);
            compute.SetFloat("_Drag", drag);
            compute.SetVector("_Point", GetMousePoint());
            compute.Dispatch(ker.Index, count / (int)ker.ThreadX + 1, 1, 1);
        }
示例#3
0
        protected void Expand(CellularGrowth cell, Kernel ker, float dt)
        {
            compute.SetBuffer(ker.Index, "_Cells", cell.CellsBuffer);
            compute.SetInt("_CellsCount", cell.CellsBuffer.count);

            compute.SetBuffer(ker.Index, "_Nodes", nodesBufferRead);
            compute.SetBuffer(ker.Index, "_Edges", edgesBuffer);
            compute.SetInt("_EdgesCount", nodesCount);

            compute.SetFloat("_Tension", tension);
            compute.SetFloat("_DT", dt);

            compute.Dispatch(ker.Index, nodesCount / (int)ker.ThreadX + 1, 1, 1);
        }
示例#4
0
 public void Step(CellularGrowth cell, float t, float dt)
 {
     InteractPredators(interactPredatorsKer);
     UpdatePredators(updatePredatorsKer, cell, t, dt);
     // UpdatePoolCount();
 }