Example #1
0
        private void Start()
        {
            simpleChunkColliderPool   = new SimpleChunkColliderPool(colliderParent);
            displayerPool             = new MeshDisplayerPool(transform);
            interactableDisplayerPool = new InteractableMeshDisplayPool(transform);
            CreateAllBuffersWithSizes(32);

            TriangulationTableStaticData.BuildLookUpTables();

            InitializeDensityGenerator();

            ApplyShaderProperties(marshShader);
            ApplyShaderProperties(rebuildShader);
            noiseEditShader.SetBuffer(0, "points", pointsBuffer);

            watch.Start();
            buildAroundSqrDistance = (long)buildAroundDistance * buildAroundDistance;
            startPos = player.position;

            IMarchingCubeChunk chunk = FindNonEmptyChunkAround(player.position);

            maxSqrChunkDistance = buildAroundDistance * buildAroundDistance;

            BuildRelevantChunksParallelBlockingAround(chunk);
        }
Example #2
0
        private void Start()
        {
            neighbourFinder = new AsynchronNeighbourFinder(this);
            ChunkNeighbourTask.chunkGroup = chunkGroup;

            mainCam = Camera.main;
            noiseData.ApplyNoiseBiomData();

            CreatePools();


            ChunkGPUDataRequest.AssignEmptyMinDegreeBuffer(CreateEmptyMinDegreeBuffer());
            chunkGPURequest = new ChunkGPUDataRequest(chunkPipelinePool, storageGroup, minDegreesAtCoordBufferPool);

            TriangulationTableStaticData.BuildLookUpTables();


            watch.Start();
            buildAroundSqrDistance = (long)buildAroundDistance * buildAroundDistance;
            startPos = StartPos;


            //CompressedMarchingCubeChunk chunk = FindNonEmptyChunkAround(player.position);
            //maxSqrChunkDistance = buildAroundDistance * buildAroundDistance;
            //BuildRelevantChunksParallelBlockingAround(chunk);

            CreatePlanetWithAsyncGPU();
            //CreatePlanetFromMeshData();

            //BuildRelevantChunksParallelWithAsyncGpuAround(chunk);

            //int amount = 5;
            //for (int x = -amount; x <= amount; x++)
            //{
            //    for (int y = -amount; y <= amount; y++)
            //    {
            //        CreateChunkWithAsyncGPUReadbackParallel(startPos + new Vector3(32 * x, -DEFAULT_CHUNK_SIZE, 32 * y));
            //    }
            //}

            //FindNonEmptyChunkAroundAsync(startPos, (chunk) =>
            //{
            //    maxSqrChunkDistance = buildAroundDistance * buildAroundDistance;

            //    BuildRelevantChunksParallelWithAsyncGpuAround(chunk);
            //});
        }