コード例 #1
0
        public void releaseTemporaryBuffers()
        {
            if (null != ShownVoxelCount)
            {
                ShownVoxelCount.Release();
            }
            ShownVoxelCount = null;

            if (null != ShownVoxelOffset)
            {
                ShownVoxelOffset.Release();
            }
            ShownVoxelOffset = null;

            if (null != ShownVoxels)
            {
                ShownVoxels.Release();
            }
            ShownVoxels = null;

            if (null != TotalVoxelCount)
            {
                TotalVoxelCount.Release();
            }
            TotalVoxelCount = null;
        }
コード例 #2
0
        public void callFaceCopyKernel()
        {
            int[] totalfaceblocks = new int[1];

            TotalVoxelCount.GetData(totalfaceblocks);
            totalShownVoxelCount = totalfaceblocks[0];

            if (null != SolidVoxels)
            {
                releaseSolidVoxels();
            }

            SolidVoxels = new ComputeBuffer(totalfaceblocks[0], sizeof(int));

            meshGen.SetBuffer(FaceCopyKernel, "SolidVoxels", SolidVoxels);

            meshGen.Dispatch(FaceCopyKernel, 8, 1, 8);
        }