From afa9701728809177fd51e521dc04e95f61529387 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 14 Jan 2020 13:26:15 +0100 Subject: [PATCH] Changed back the way biome handles isolevel, because this helps to hide the banding(?) at the side of the mountains with the transvoxel mesher. --- game/scripts/biomes/simple_biome.gd | 18 +++++++++--------- game/voxelman/cubic_mesher/CubicVoxelMesher.gd | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/game/scripts/biomes/simple_biome.gd b/game/scripts/biomes/simple_biome.gd index bbf6755a..491802ee 100644 --- a/game/scripts/biomes/simple_biome.gd +++ b/game/scripts/biomes/simple_biome.gd @@ -80,17 +80,17 @@ func generate_terrarin(chunk : VoxelChunk, spawn_mobs: bool) -> void: else: chunk.set_voxel(2, x, y, z, VoxelChunk.DEFAULT_CHANNEL_TYPE) - if y == v - 1: - chunk.set_voxel(int(255.0 * (val - int(val))), x, y, z, VoxelChunk.DEFAULT_CHANNEL_ISOLEVEL) - else: - chunk.set_voxel(255, x, y, z, VoxelChunk.DEFAULT_CHANNEL_ISOLEVEL) +# if y == v - 1: +# chunk.set_voxel(int(255.0 * (val - int(val))), x, y, z, VoxelChunk.DEFAULT_CHANNEL_ISOLEVEL) +# else: +# chunk.set_voxel(255, x, y, z, VoxelChunk.DEFAULT_CHANNEL_ISOLEVEL) +# + var val2 : float = (val - int(val)) * 4.0 + val2 = int(val2) + val2 /= 4.0 -# var val2 : float = (val - int(val)) * 4.0 -# val2 = int(val2) -# val2 /= 4.0 - -# chunk.set_voxel(int(255.0 * val2), x, y, z, VoxelChunk.DEFAULT_CHANNEL_ISOLEVEL) + chunk.set_voxel(int(255.0 * val2), x, y, z, VoxelChunk.DEFAULT_CHANNEL_ISOLEVEL) # chunk.set_voxel(int(255.0 * (val - int(val)) / 180.0) * 180, x, y, z, VoxelChunk.DEFAULT_CHANNEL_ISOLEVEL) # chunk.set_voxel(int(255.0 * (val - int(val))), x, y, z, VoxelChunk.DEFAULT_CHANNEL_ISOLEVEL) diff --git a/game/voxelman/cubic_mesher/CubicVoxelMesher.gd b/game/voxelman/cubic_mesher/CubicVoxelMesher.gd index f85054f6..fc72e46f 100644 --- a/game/voxelman/cubic_mesher/CubicVoxelMesher.gd +++ b/game/voxelman/cubic_mesher/CubicVoxelMesher.gd @@ -26,7 +26,7 @@ class_name GDCubicVoxelMesher var count : int = 0 -func _add_chunk(chunk : VoxelChunk) -> void: +func _add_chunk(chunk : Node) -> void: chunk.generate_ao(); var x_size : int = chunk.get_size_x() - 1