Ejemplo n.º 1
0
        void Dispatch(bool emit)
        {
            Profiler.BeginSample("Dispatch loop");
            PartEmitter.UpdateParticleBursts();

            BindParticles();

            if (emit)
            {
                PartEmitter.UpdatePlayEvent();
            }

            if (!NoSimulation)
            {
                //Dispatch the update kernel.
                SetPariclesToKernel(ComputeShader, UpdateAllKernel);

                Profiler.BeginSample("Main update");
                ComputeShader.Dispatch(UpdateAllKernel, DispatchCount, 1, 1);
                Profiler.EndSample();

                ColliderManager.Dispatch();
                ForceManager.Dispatch();
            }


            Profiler.EndSample();
        }
        void Dispatch(bool emit)
        {
            Profiler.BeginSample("Simulation loop");
            Emitter.UpdateForDispatch();

            BindParticles();

            if (emit)
            {
                Emitter.UpdatePlayEvent(m_prevSystemTime);
                m_prevSystemTime = SystemTime;
            }

            if (!NoSimulation)
            {
                Profiler.BeginSample("Pre Extenions update");
                if (OnPreSimulationCallback != null)
                {
                    OnPreSimulationCallback();
                }
                Profiler.EndSample();

                Profiler.BeginSample("Main update");
                DispatchExtensionKernel(ComputeShader, UpdateAllKernel);
                Profiler.EndSample();

                Profiler.BeginSample("Post Extenions update");
                if (OnPostSimulationCallback != null)
                {
                    OnPostSimulationCallback();
                }
                Profiler.EndSample();

                ColliderManager.Dispatch();
                ForceManager.Dispatch();
            }

            Profiler.EndSample();
        }