diff --git a/assets/shaders/terrain/unpack.wgsl b/assets/shaders/terrain/unpack.wgsl index 686889c2..8633027b 100644 --- a/assets/shaders/terrain/unpack.wgsl +++ b/assets/shaders/terrain/unpack.wgsl @@ -10,7 +10,7 @@ fn unpack_height(h: u32) -> f32 { fn unpack_normal(v: u32) -> vec3 { let x = f32(v >> 8u) / 128.0 - 1.0; let y = f32(v & 0xFFu) / 128.0 - 1.0; - let z = sqrt(1.0 - x * x - y * y); + let z = sqrt(max(0.0, 1.0 - x * x - y * y)); return vec3(x, y, z); } diff --git a/native_app/src/gui/mod.rs b/native_app/src/gui/mod.rs index 340838c4..98ba977e 100644 --- a/native_app/src/gui/mod.rs +++ b/native_app/src/gui/mod.rs @@ -107,6 +107,7 @@ impl Default for InspectedEntity { #[derive(Copy, Clone, Default, Serialize, Deserialize, Eq, PartialEq)] pub enum Tool { + #[default] Hand, RoadbuildStraight, RoadbuildCurved, @@ -115,7 +116,6 @@ pub enum Tool { LotBrush, SpecialBuilding, Train, - #[default] Terraforming, } diff --git a/native_app/src/gui/terraforming.rs b/native_app/src/gui/terraforming.rs index e5deb4a6..6bdf96c9 100644 --- a/native_app/src/gui/terraforming.rs +++ b/native_app/src/gui/terraforming.rs @@ -145,7 +145,7 @@ pub fn terraforming(sim: &Simulation, uiworld: &mut UiWorld) { impl Default for TerraformingResource { fn default() -> Self { Self { - kind: TerraformKind::Erode, + kind: TerraformKind::Elevation, radius: 200.0, amount: 200.0, level: None,