From 5a089863beb01d4794bbe3580ada47b278715ea2 Mon Sep 17 00:00:00 2001 From: Joshua Yanovski Date: Thu, 2 Apr 2020 03:17:49 +0200 Subject: [PATCH] Making maps brighter. This is probably not the right way to do it, but oh well! --- world/examples/water.rs | 6 ++++++ world/src/sim/map.rs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/world/examples/water.rs b/world/examples/water.rs index e737dc8341..5ceff64654 100644 --- a/world/examples/water.rs +++ b/world/examples/water.rs @@ -273,6 +273,12 @@ fn main() { if win.is_key_down(minifb::Key::L) { if is_camera { // TODO: implement removing horizon mapping. + horizons = if horizons.is_some() { + None + } else { + refresh_horizons(lgain, is_basement, is_water) + }; + samples_changed = true; } else { is_shaded ^= true; samples_changed = true; diff --git a/world/src/sim/map.rs b/world/src/sim/map.rs index 34a8f6365f..311ed32d6e 100644 --- a/world/src/sim/map.rs +++ b/world/src/sim/map.rs @@ -626,7 +626,7 @@ impl<'a> MapConfig<'a> { 1.0 } }) - .unwrap_or(alt as f64); + .unwrap_or(1.0); let rgb = if is_shaded { // Phong reflection model with shadows: @@ -643,7 +643,7 @@ impl<'a> MapConfig<'a> { // // for each light m, // i_m,d = (RGB) intensity of diffuse component of light source m - let i_m_d = Rgb::new(0.45, 0.45, 0.45); + let i_m_d = Rgb::new(1.0, 1.0, 1.0); // i_m,s = (RGB) intensity of specular component of light source m let i_m_s = Rgb::new(0.45, 0.45, 0.45); // let i_m_s = Rgb::new(0.45, 0.45, 0.45);