private void OnRenderObject() { if (quadDataBuffer != null) { int[] quadargs = BufferTools.GetArgs(quadDataBuffer[READ], quadArgBuffer); material.SetPass(0); material.SetBuffer("_Data", quadDataBuffer[READ]); Graphics.DrawProceduralIndirect(MeshTopology.Points, quadArgBuffer, 0); } }
void DoFillingVoxelGrid() { int[] args = BufferTools.GetArgs(triangleIntersectionBuffer[READ], triangleIntersectionARGSBuffer); //Debug.Log("numintersections: " + args[0]); vertPosToCubeAgeCompute.SetInt("IntersectionCount", args[0]); vertPosToCubeAgeCompute.SetBuffer(secondKernel, "RTriangleVertexes", triVertPosBuffers[READ]); vertPosToCubeAgeCompute.SetBuffer(secondKernel, "RAIntersections", triangleIntersectionBuffer[READ]); vertPosToCubeAgeCompute.SetBuffer(secondKernel, "WVoxelAgeBuffer", filledVoxelGridBuffer[WRITE]); vertPosToCubeAgeCompute.Dispatch(secondKernel, (int)(DanceBoxManager.inst.voxelDimensions.x * DanceBoxManager.inst.voxelDimensions.y), 1, 1); //if (debug) // BufferTools.DebugComputeRaw<float>(filledVoxelGridBuffer[READ], " SHOULD HAVE TOTALINTERSECTION COUNTS IN ALL TINGS", (int)DanceBoxManager.inst.voxelDimensions.x); }