public static void AddTrees() { if (GlobalVariables.Settings.AccelerationMethod == ComputingAccelerationMethod.None) { TerrainGenerator.AddTrees_SingleThread(); } else { TerrainGenerator.AddTrees_Parallel(); } }
public static void CalculateBlockTypes() { switch (GlobalVariables.Settings.AccelerationMethod) { case ComputingAccelerationMethod.None: { TerrainGenerator.CalculateBlockTypes_SingleThread(); break; } case ComputingAccelerationMethod.PureCSParallelisation: { TerrainGenerator.CalculateBlockTypes_PureCSParallel(); break; } case ComputingAccelerationMethod.UnityJobSystem: { ReadonlyVector3Int[] heights = TerrainGenerator.CalculateHeightsJobSystem(); BlockType[] types = TerrainGenerator.CalculateBlockTypes(heights); TerrainGenerator.DeflattenizeOutput(ref types); break; } case ComputingAccelerationMethod.UnityJobSystemPlusStaticArray: { throw new NotImplementedException(); // new way of calculating unfortunately slower // it uses job system but calculates entire columns // this approach needs static array allocation BlockTypeColumn[] types = TerrainGenerator.CalculateBlockColumn(); break; } case ComputingAccelerationMethod.ComputeShader: { throw new NotImplementedException(); break; } case ComputingAccelerationMethod.ECS: { TerrainGenerator.CreateEntities(); break; } } }
public static void CalculateBlockTypes() { switch (GlobalVariables.Settings.AccelerationMethod) { case ComputingAccelerationMethod.None: { TerrainGenerator.CalculateBlockTypes_SingleThread(); break; } case ComputingAccelerationMethod.PureCSParallelisation: { TerrainGenerator.CalculateBlockTypes_PureCSParallel(); break; } case ComputingAccelerationMethod.UnityJobSystem: { ReadonlyVector3Int[] heights = TerrainGenerator.CalculateHeights_JobSystem_NoiseSampler(); BlockType[] types = TerrainGenerator.CalculateBlockTypes_NoiseSampler(heights); TerrainGenerator.DeflattenizeOutput(ref types); break; } case ComputingAccelerationMethod.UnityJobSystemBurstCompiler: { ReadonlyVector3Int[] heights = TerrainGenerator.CalculateHeights_JobSystem_NoiseFunction(); BlockType[] types = TerrainGenerator.CalculateBlockTypes_NoiseFunction(heights); TerrainGenerator.DeflattenizeOutput(ref types); break; } case ComputingAccelerationMethod.ComputeShader: { TerrainGenerator.CalculateBlockTypes_ComputeShader(); break; } case ComputingAccelerationMethod.ECS: { TerrainGenerator.CreateEntities(); break; } } }
public static void AddWater() => TerrainGenerator.AddWater();
public static ReadonlyVector3Int CalculateHeights(int seed, int x, int z) => TerrainGenerator.CalculateHeights_NoiseSampler(seed, x, z);
public void InitializeOnWorldSizeChange() => TerrainGenerator.Initialize(_heightsShader, _perlinNoise, _textureResolution);
public void InitializeOnWorldSizeChange() => TerrainGenerator.Initialize(_heightsShader);