Example #1
0
 void Start()
 {
     voxelAgeBuffer[READ]  = new ComputeBuffer(DanceBoxManager.inst.totalVoxels, DanceBoxManager.inst.sizeOfVoxelData, ComputeBufferType.Default);
     voxelAgeBuffer[WRITE] = new ComputeBuffer(DanceBoxManager.inst.totalVoxels, DanceBoxManager.inst.sizeOfVoxelData, ComputeBufferType.Default);
     voxelAgeRecipient     = voxelAgeRecipientObject.GetComponent <IWantVoxelAges>();
     voxelAgeGenerator.SetVector("_Dimensions", DanceBoxManager.inst.voxelDimensions4);
 }
        void Start()
        {
            filledVoxelGridBuffer[READ]    = new ComputeBuffer(DanceBoxManager.inst.totalVoxels, DanceBoxManager.inst.sizeOfVoxelData, ComputeBufferType.Default);
            filledVoxelGridBuffer[WRITE]   = new ComputeBuffer(DanceBoxManager.inst.totalVoxels, DanceBoxManager.inst.sizeOfVoxelData, ComputeBufferType.Default);
            triangleIntersectionARGSBuffer = new ComputeBuffer(4, sizeof(int), ComputeBufferType.IndirectArguments);
            rawVertexPositionARGSBuffer    = new ComputeBuffer(4, sizeof(int), ComputeBufferType.IndirectArguments);

            voxelAgeRecipient = voxelAgeRecipientObject.GetComponent <IWantVoxelAges>();
            vertPosToCubeAgeCompute.SetVector("_Dimensions", DanceBoxManager.inst.voxelDimensions4);
        }
Example #3
0
        void Start()
        {
            for (int i = 0; i < voxelAgeBuffer.Length; i++)
            {
                voxelAgeBuffer[i] = new ComputeBuffer(DanceBoxManager.inst.totalVoxels, DanceBoxManager.inst.sizeOfVoxelData, ComputeBufferType.Default);
            }

            cubeAgeSimulationShader.SetVector("_Dimensions", DanceBoxManager.inst.voxelDimensions4);
            cubeAgeSimulationShader.SetVector("_InvDimensions", DanceBoxManager.inst.inverseVoxelDimensions4);
            voxelAgeRecipient = voxelAgeRecipientObject.GetComponent <IWantVoxelAges>();
        }
Example #4
0
        void Start()
        {
            filledVoxelGridBuffer[READ]  = new ComputeBuffer(DanceBoxManager.inst.totalVoxels, DanceBoxManager.inst.sizeOfVoxelData, ComputeBufferType.Default);
            filledVoxelGridBuffer[WRITE] = new ComputeBuffer(DanceBoxManager.inst.totalVoxels, DanceBoxManager.inst.sizeOfVoxelData, ComputeBufferType.Default);

            penDownVoxelBuffer[WRITE] = new ComputeBuffer(DanceBoxManager.inst.totalVoxels, sizeof(float), ComputeBufferType.Default);
            penDownVoxelBuffer[READ]  = new ComputeBuffer(DanceBoxManager.inst.totalVoxels, sizeof(float), ComputeBufferType.Default);

            triangleIntersectionARGSBuffer = new ComputeBuffer(4, sizeof(int), ComputeBufferType.IndirectArguments);
            int[] argdata = new int[] { 0, 1, 0, 0 };
            triangleIntersectionARGSBuffer.SetData(argdata);

            voxelAgeRecipient = voxelAgeRecipientObject.GetComponent <IWantVoxelAges>();
            vertPosToCubeAgeCompute.SetVector("_Dimensions", DanceBoxManager.inst.voxelDimensions4);
            vertPosToCubeAgeCompute.SetVector("_InvDimensions", DanceBoxManager.inst.inverseVoxelDimensions4);
        }