Biome blending

Dithering to biome edges
This commit is contained in:
2024-07-07 10:51:02 -04:00
parent 8e92df8008
commit ba2dcf7129
7 changed files with 68 additions and 19 deletions

View File

@@ -207,8 +207,9 @@ fn create_heightmap(
) {
let config = GenerationConfig {
biome_blend: 16,
continent_layer: NoiseConfig {
scale: 450.,
biome_dither: 16.,
continent_noise: NoiseConfig {
scale: 500.,
layers: vec![GeneratorLayer {
base_roughness: 2.14,
roughness: 0.87,
@@ -222,8 +223,8 @@ fn create_heightmap(
first_layer_mask: false,
}],
},
moisture_layer: NoiseConfig {
scale: 450.,
moisture_noise: NoiseConfig {
scale: 500.,
layers: vec![GeneratorLayer {
base_roughness: 2.14,
roughness: 0.87,
@@ -237,8 +238,8 @@ fn create_heightmap(
first_layer_mask: false,
}],
},
temperature_layer: NoiseConfig {
scale: 450.,
temperature_noise: NoiseConfig {
scale: 500.,
layers: vec![GeneratorLayer {
base_roughness: 2.14,
roughness: 0.87,

View File

@@ -38,8 +38,8 @@ pub fn paint_chunk(
for x in 0..Chunk::SIZE {
let idx = x + z * Chunk::SIZE;
let height = chunk.heights[idx];
let biome_data = &chunk.biome_data[idx];
let biome = painter.sample_biome(biome_data);
let biome_id = chunk.biome_id[idx];
let biome = &painter.biomes[biome_id];
let mapper = mappers.get(biome.tile_mapper.clone());
let tile_handle = mapper.unwrap().sample_tile(height);
let tile = tiles.get(tile_handle).unwrap();