Fix LOD heights in towns.

This commit is contained in:
Joshua Yanovski 2020-04-26 23:11:08 +02:00
parent cc39e5734e
commit 682a3d74c8
3 changed files with 9 additions and 3 deletions

View File

@ -7,7 +7,7 @@ const float PI = 3.141592;
const vec3 SKY_DAY_TOP = vec3(0.1, 0.5, 0.9); const vec3 SKY_DAY_TOP = vec3(0.1, 0.5, 0.9);
const vec3 SKY_DAY_MID = vec3(0.02, 0.28, 0.8); const vec3 SKY_DAY_MID = vec3(0.02, 0.28, 0.8);
const vec3 SKY_DAY_BOT = vec3(0.1, 0.2, 0.3); const vec3 SKY_DAY_BOT = vec3(0.1, 0.2, 0.3);
const vec3 DAY_LIGHT = vec3(1.2, 1.0, 1.0) * 1.8; const vec3 DAY_LIGHT = vec3(1.2, 1.0, 1.0) * 6.0;
const vec3 SUN_HALO_DAY = vec3(0.35, 0.35, 0.0); const vec3 SUN_HALO_DAY = vec3(0.35, 0.35, 0.0);
const vec3 SKY_DUSK_TOP = vec3(0.06, 0.1, 0.20); const vec3 SKY_DUSK_TOP = vec3(0.06, 0.1, 0.20);

View File

@ -599,8 +599,8 @@ pub fn block_from_structure(
StructureBlock::PineLeaves => Some(Block::new( StructureBlock::PineLeaves => Some(Block::new(
BlockKind::Leaves, BlockKind::Leaves,
Lerp::lerp( Lerp::lerp(
saturate_leaves(Rgb::new(0.0, 60.0, 50.0)), Rgb::new(0.0, 60.0, 50.0),
saturate_leaves(Rgb::new(30.0, 100.0, 10.0)), Rgb::new(30.0, 100.0, 10.0),
lerp, lerp,
) )
.map(|e| e as u8), .map(|e| e as u8),

View File

@ -3,6 +3,7 @@
mod econ; mod econ;
use crate::{ use crate::{
config::CONFIG,
sim::WorldSim, sim::WorldSim,
site::{Dungeon, Settlement, Site as WorldSite}, site::{Dungeon, Settlement, Site as WorldSite},
util::{attempt, seed_expan, CARDINALS, NEIGHBORS}, util::{attempt, seed_expan, CARDINALS, NEIGHBORS},
@ -123,6 +124,11 @@ impl Civs {
.filter(|chunk| !chunk.river.near_water()) .filter(|chunk| !chunk.river.near_water())
.map(|chunk| { .map(|chunk| {
let diff = Lerp::lerp_precise(chunk.alt, center_alt, factor) - chunk.alt; let diff = Lerp::lerp_precise(chunk.alt, center_alt, factor) - chunk.alt;
// Make sure we don't fall below sea level (fortunately, we don't have
// to worry about the case where water_alt is already set to a correct
// value higher than alt, since this chunk should have been filtered
// out in that case).
chunk.water_alt = CONFIG.sea_level.max(chunk.water_alt + diff);
chunk.alt += diff; chunk.alt += diff;
chunk.basement += diff; chunk.basement += diff;
chunk.rockiness = 0.0; chunk.rockiness = 0.0;