Beispiel #1
0
    public void Emulate()
    {
        if (DataManaging == ManagingMode.CenterPool)
        {
            if (CurN + IncN < MaxN)
            {
                CurN += IncN;
            }
        }

        CS.SetVector("grid_size", isf.GetGridSize());
        CS.SetInts("grids", isf.GetGrids());
        CS.SetFloat("dt", isf.estimate_dt);

        foreach (var part in AllCurrentParticles())
        {
            int kernel = kernelEnumlateParticle[part.kernId];
            CS.SetTexture(kernel, "Velocity", isf.GetVelocity());
            CS.SetBuffer(kernel, "ParticlePostion", part.buf);
            CS.Dispatch(kernel, part.count / part.threads, 1, 1);
        }
    }