Changed back the way biome handles isolevel, because this helps to hide the banding(?) at the side of the mountains with the transvoxel mesher.

This commit is contained in:
Relintai 2020-01-14 13:26:15 +01:00
parent f909042c09
commit afa9701728
2 changed files with 10 additions and 10 deletions

View File

@ -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)

View File

@ -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