Changed the simple biome's generator to FastNoise from OpenSimplexNoise. Also scaled it out more.

This commit is contained in:
Relintai 2021-08-06 19:24:13 +02:00
parent 4827348c25
commit 1697167975

View File

@ -69,15 +69,16 @@ func gen_terra_chunk(chunk: TerraChunk) -> void:
chunk.channel_ensure_allocated(TerraChunkDefault.DEFAULT_CHANNEL_TYPE, 1) chunk.channel_ensure_allocated(TerraChunkDefault.DEFAULT_CHANNEL_TYPE, 1)
chunk.channel_ensure_allocated(TerraChunkDefault.DEFAULT_CHANNEL_ISOLEVEL, 0) chunk.channel_ensure_allocated(TerraChunkDefault.DEFAULT_CHANNEL_ISOLEVEL, 0)
var s : OpenSimplexNoise = OpenSimplexNoise.new() var s : FastNoise = FastNoise.new()
s.seed = current_seed s.set_noise_type(FastNoise.TYPE_SIMPLEX)
s.set_seed(current_seed)
for x in range(-chunk.margin_start, chunk.size_x + chunk.margin_end): for x in range(-chunk.margin_start, chunk.size_x + chunk.margin_end):
for z in range(-chunk.margin_start, chunk.size_x + chunk.margin_end): for z in range(-chunk.margin_start, chunk.size_x + chunk.margin_end):
var vx : int = x + (chunk.position_x * chunk.size_x) var vx : int = x + (chunk.position_x * chunk.size_x)
var vz : int = z + (chunk.position_z * chunk.size_z) var vz : int = z + (chunk.position_z * chunk.size_z)
var val : float = (s.get_noise_2d(vx, vz) + 2) var val : float = (s.get_noise_2d(vx * 0.4, vz * 0.4) + 2)
val *= val val *= val
val *= 20.0 val *= 20.0