Beispiel #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);
        }
Beispiel #2
0
        protected void CreatePools()
        {
            chunkPipelinePool           = new ChunkGenerationPipelinePool(CreateChunkPipeline);
            minDegreesAtCoordBufferPool = new BufferPool(CreateMinDegreeBuffer);

            simpleChunkColliderPool   = new SimpleChunkColliderPool(colliderParent);
            displayerPool             = new MeshDisplayerPool(transform);
            interactableDisplayerPool = new InteractableMeshDisplayPool(transform);
        }