예제 #1
0
        protected override void SetWorld()
        {
            // Setup generators
            chunkGenerator = (ChunkGenerator)System.Activator.CreateInstance(generatorType);
            GeometryIndependentPass.SetWorld(this);

            GenerateTestStructure();
            //worldGeneratingCoroutine = StartCoroutine(WorldUpdateCoroutine());
        }
예제 #2
0
        private void Awake()
        {
            GeometryIndependentPass.cs_generation           = cs_generation;
            GeometryIndependentPass.cs_generation_batchsize = cs_generation_batchsize;
            GeometryIndependentPass.Init();

            Material      chunkMat = globalSettings.renderSetup.ChunkMaterial;
            ComputeShader cs_chunkMeshPopulator = globalSettings.renderSetup.associatedCS;

            chunkMat.SetTexture("_MainTexArr", globalSettings.blockRegistryTable.BlockTexArray);
            chunkMat.SetTexture("_BlockLUT", globalSettings.blockRegistryTable.BlockLUT);

            ChunkRenderer_GPUComputeMesh.cs_chunkMeshPopulator = cs_chunkMeshPopulator;
            ChunkRenderer_GPUComputeMesh.chunkMat = chunkMat;
            ChunkRenderer_CPUOptimMesh.chunkMat   = chunkMat;
        }
예제 #3
0
파일: World.cs 프로젝트: takaaptech/Voxelis
        protected virtual void SetWorld()
        {
            // Do world sketch
            SketchWorld();

            if (isMainWorld)
            {
                GeometryIndependentPass.SetWorld(this);
            }

            // Setup generators
            chunkGenerator = (ChunkGenerator)System.Activator.CreateInstance(generatorType);

            for (int i = 0; i < 0; i++)
            //for (int i = 0; i < 64; i++)
            {
                Vector2Int pos = new Vector2Int(UnityEngine.Random.Range(-800, 800), UnityEngine.Random.Range(-800, 800));
                CreateStructure(new BoundsInt(pos.x, 5, pos.y, 96, 96, 96), new TestTree());
            }
            //CreateStructure(new BoundsInt(-122, 32, 225, 140, 120, 140), new TestTree());
            //CreateStructure(new BoundsInt(56, 10, 371, 140, 120, 140), new TestTree());
            //CreateStructure(new BoundsInt(143, 0, 177, 140, 120, 140), new TestTree());
        }
예제 #4
0
 // Update is called once per frame
 void Update()
 {
     CustomJobs.CustomJob.UpdateAllJobs();
     GeometryIndependentPass.Update();
 }
예제 #5
0
 private void ClearAllImmediate()
 {
     GeometryIndependentPass.Destroy();
 }
예제 #6
0
 public void Destroy()
 {
     GeometryIndependentPass.Destroy();
 }