mirror of
https://github.com/Relintai/broken_seals.git
synced 2025-01-22 02:17:18 +01:00
Changed the simple biome's generator to FastNoise from OpenSimplexNoise. Also scaled it out more.
This commit is contained in:
parent
4827348c25
commit
1697167975
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user