protected override void SetWorld() { // Setup generators chunkGenerator = (ChunkGenerator)System.Activator.CreateInstance(generatorType); GeometryIndependentPass.SetWorld(this); GenerateTestStructure(); //worldGeneratingCoroutine = StartCoroutine(WorldUpdateCoroutine()); }
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; }
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()); }
// Update is called once per frame void Update() { CustomJobs.CustomJob.UpdateAllJobs(); GeometryIndependentPass.Update(); }
private void ClearAllImmediate() { GeometryIndependentPass.Destroy(); }
public void Destroy() { GeometryIndependentPass.Destroy(); }