Пример #1
0
 void DoCollisions()
 {
     DoIntersections();
     DoPenDownCalculating();
     DoFillingVoxelGrid();
     voxelAgeRecipient.GiveSwappedVoxelAgeBuffer(filledVoxelGridBuffer[READ]);
 }
 void DoCollisions()
 {
     //DoSorting();
     DoIntersections();
     DoFillingVoxelGrid();
     voxelAgeRecipient.GiveSwappedVoxelAgeBuffer(filledVoxelGridBuffer[READ]);
 }
Пример #3
0
        void Update()
        {
            voxelAgeGenerator.SetBuffer(vgkernal, "WVoxelAgeBuffer", voxelAgeBuffer[WRITE]);
            voxelAgeGenerator.Dispatch(vgkernal, DanceBoxManager.inst.totalVoxels, 1, 1);            // DanceBoxManager.inst.voxelDimX, DanceBoxManager.inst.voxelDimY, DanceBoxManager.inst.voxelDimZ);

            if (debug)
            {
                Debug.Log("Running");
                //BufferTools.DebugCompute<float>(voxelAgeBuffer[READ], "output voxel ages READ", DanceBoxManager.inst.singleDimensionCount);
            }

            voxelAgeRecipient.GiveSwappedVoxelAgeBuffer(voxelAgeBuffer[READ]);
        }
Пример #4
0
        void IWantVoxelAges.GiveSwappedVoxelAgeBuffer(ComputeBuffer voxelAgeStatesREAD)
        {
            BufferTools.Swap(voxelAgeBuffer);
            cubeAgeSimulationShader.SetVector("_Dimensions", DanceBoxManager.inst.voxelDimensions4);
            cubeAgeSimulationShader.SetVector("_InvDimensions", DanceBoxManager.inst.inverseVoxelDimensions4);
            cubeAgeSimulationShader.SetFloat("_DeltaTime", Time.deltaTime * decaySpeed);
            cubeAgeSimulationShader.SetInt("_Gravity", gravity);

            cubeAgeSimulationShader.SetBuffer(caskernal, "ROldCubeAges", voxelAgeBuffer[READ]);
            cubeAgeSimulationShader.SetBuffer(caskernal, "RNewCubeAges", voxelAgeStatesREAD);
            cubeAgeSimulationShader.SetBuffer(caskernal, "WCubeAges", voxelAgeBuffer[WRITE]);

            cubeAgeSimulationShader.Dispatch(caskernal, DanceBoxManager.inst.totalVoxelsThreadGroup, 1, 1);
            voxelAgeRecipient.GiveSwappedVoxelAgeBuffer(voxelAgeBuffer[READ]);
        }
Пример #5
0
        void Update()
        {
            BufferTools.Swap(filledVoxelGridBuffer);

            voxelAgeGenerator.SetBuffer(vgkernal, "WVoxelAgeBuffer", filledVoxelGridBuffer[WRITE]);
            voxelAgeGenerator.Dispatch(vgkernal, DanceBoxManager.inst.totalVoxelsThreadGroup, 1, 1);            // DanceBoxManager.inst.voxelDimX, DanceBoxManager.inst.voxelDimY, DanceBoxManager.inst.voxelDimZ);
            voxelAgeGenerator.SetFloat("_Time", Time.time);
            if (debug)
            {
                Debug.Log("Running");
                BufferTools.DebugComputeGrid <float>(filledVoxelGridBuffer[READ], "output voxel ages READ", DanceBoxManager.inst.singleDimensionCount);
            }

            voxelAgeRecipient.GiveSwappedVoxelAgeBuffer(filledVoxelGridBuffer[READ]);
        }