diff --git a/assets/voxygen/shaders/figure-frag.glsl b/assets/voxygen/shaders/figure-frag.glsl index 1680ceb19f..181bd8299b 100644 --- a/assets/voxygen/shaders/figure-frag.glsl +++ b/assets/voxygen/shaders/figure-frag.glsl @@ -80,7 +80,7 @@ void main() { float max_light = 0.0; max_light += get_sun_diffuse2(f_norm, sun_dir, moon_dir, view_dir, k_a/* * (shade_frac * 0.5 + light_frac * 0.5)*/, k_d, k_s, alpha, emitted_light, reflected_light); reflected_light *= point_shadow * shade_frac; - emitted_light *= point_shadow; + emitted_light *= point_shadow * max(shade_frac, MIN_SHADOW); max_light *= point_shadow * shade_frac; max_light += lights_at(f_pos, f_norm, view_dir, k_a, k_d, k_s, alpha, emitted_light, reflected_light); diff --git a/assets/voxygen/shaders/fluid-frag/cheap.glsl b/assets/voxygen/shaders/fluid-frag/cheap.glsl index b5e49bfca0..5f3293d42c 100644 --- a/assets/voxygen/shaders/fluid-frag/cheap.glsl +++ b/assets/voxygen/shaders/fluid-frag/cheap.glsl @@ -79,7 +79,7 @@ void main() { float max_light = 0.0; max_light += get_sun_diffuse2(f_norm, /*time_of_day.x*/sun_dir, moon_dir, /*-cam_to_frag*/view_dir, k_a/* * (shade_frac * 0.5 + light_frac * 0.5)*/, vec3(0.0), k_s, alpha, emitted_light, reflected_light); reflected_light *= f_light * point_shadow * shade_frac; - emitted_light *= f_light * point_shadow; + emitted_light *= f_light * point_shadow * max(shade_frac, MIN_SHADOW); max_light *= f_light * point_shadow * shade_frac; // get_sun_diffuse(f_norm, time_of_day.x, light, diffuse_light, ambient_light, 0.0); // diffuse_light *= f_light * point_shadow; diff --git a/assets/voxygen/shaders/fluid-frag/shiny.glsl b/assets/voxygen/shaders/fluid-frag/shiny.glsl index aa796b70b2..8b3be18f5f 100644 --- a/assets/voxygen/shaders/fluid-frag/shiny.glsl +++ b/assets/voxygen/shaders/fluid-frag/shiny.glsl @@ -144,7 +144,7 @@ void main() { float max_light = 0.0; max_light += get_sun_diffuse2(norm, /*time_of_day.x*/sun_dir, moon_dir, view_dir, k_a/* * (shade_frac * 0.5 + light_frac * 0.5)*/, vec3(0.0), /*vec3(f_light * point_shadow)*//*reflect_color*/k_s, alpha, emitted_light, reflected_light); reflected_light *= reflect_color * f_light * point_shadow * shade_frac; - emitted_light *= f_light * point_shadow; + emitted_light *= f_light * point_shadow * max(shade_frac, MIN_SHADOW); max_light *= f_light * point_shadow * shade_frac; vec3 diffuse_light_point = vec3(0.0); diff --git a/assets/voxygen/shaders/include/lod.glsl b/assets/voxygen/shaders/include/lod.glsl index 17576aa69e..a24d4c34b8 100644 --- a/assets/voxygen/shaders/include/lod.glsl +++ b/assets/voxygen/shaders/include/lod.glsl @@ -5,6 +5,8 @@ uniform sampler2D t_map; uniform sampler2D t_horizon; +const float MIN_SHADOW = 0.33; + vec2 pos_to_uv(sampler2D sampler, vec2 pos) { // Want: (pixel + 0.5) / W vec2 texSize = textureSize(sampler, 0); diff --git a/assets/voxygen/shaders/include/sky.glsl b/assets/voxygen/shaders/include/sky.glsl index 85d52461a8..71714fddc5 100644 --- a/assets/voxygen/shaders/include/sky.glsl +++ b/assets/voxygen/shaders/include/sky.glsl @@ -123,7 +123,7 @@ vec3 get_moon_color(vec3 moon_dir) { // Returns computed maximum intensity. float get_sun_diffuse2(vec3 norm, vec3 sun_dir, vec3 moon_dir, vec3 dir, vec3 k_a, vec3 k_d, vec3 k_s, float alpha, out vec3 emitted_light, out vec3 reflected_light) { - const float SUN_AMBIANCE = 0.23 / 3.0;/* / 1.8*/;// 0.1 / 3.0; + const float SUN_AMBIANCE = 0.23;/* / 1.8*/;// 0.1 / 3.0; const float SUN_COLOR_FACTOR = 6.0;//1.8; const float MOON_AMBIANCE = 0.23;//0.1; diff --git a/assets/voxygen/shaders/lod-terrain-frag.glsl b/assets/voxygen/shaders/lod-terrain-frag.glsl index 680100a066..8396d742ce 100644 --- a/assets/voxygen/shaders/lod-terrain-frag.glsl +++ b/assets/voxygen/shaders/lod-terrain-frag.glsl @@ -152,6 +152,7 @@ void main() { float max_light = 0.0; max_light += get_sun_diffuse2(f_norm/*l_norm*/, sun_dir, moon_dir, view_dir, vec3(1.0)/* * (0.5 * light_frac + vec3(0.5 * shade_frac))*/, vec3(1.0), /*0.5 * shade_frac * *//*vec3(1.0)*//*f_col*/vec3(R_s), alpha, emitted_light, reflected_light); // emitted_light = vec3(1.0); + emitted_light *= max(shade_frac, MIN_SHADOW); reflected_light *= shade_frac; max_light *= shade_frac; // reflected_light = vec3(0.0); diff --git a/assets/voxygen/shaders/sprite-frag.glsl b/assets/voxygen/shaders/sprite-frag.glsl index a5fe0bcc2a..ea67710038 100644 --- a/assets/voxygen/shaders/sprite-frag.glsl +++ b/assets/voxygen/shaders/sprite-frag.glsl @@ -73,7 +73,7 @@ void main() { float max_light = 0.0; max_light += get_sun_diffuse2(f_norm, /*time_of_day.x, */sun_dir, moon_dir, /*cam_to_frag*/view_dir, k_a/* * (shade_frac * 0.5 + light_frac * 0.5)*/, k_d, k_s, alpha, emitted_light, reflected_light); reflected_light *= vert_light * point_shadow * shade_frac; - emitted_light *= vert_light * point_shadow; + emitted_light *= vert_light * point_shadow * max(shade_frac, MIN_SHADOW); max_light *= vert_light * point_shadow * shade_frac; // get_sun_diffuse(f_norm, time_of_day.x, light, diffuse_light, ambient_light, 1.0); // float point_shadow = shadow_at(f_pos, f_norm); diff --git a/assets/voxygen/shaders/terrain-frag.glsl b/assets/voxygen/shaders/terrain-frag.glsl index e360acc31c..78eb7d3c8b 100644 --- a/assets/voxygen/shaders/terrain-frag.glsl +++ b/assets/voxygen/shaders/terrain-frag.glsl @@ -73,7 +73,7 @@ void main() { float point_shadow = shadow_at(f_pos, f_norm); max_light += get_sun_diffuse2(f_norm, /*time_of_day.x, */sun_dir, moon_dir, view_dir, k_a/* * (shade_frac * 0.5 + light_frac * 0.5)*/, k_d, k_s, alpha, emitted_light, reflected_light); - emitted_light *= f_light * point_shadow; + emitted_light *= f_light * point_shadow * max(shade_frac, MIN_SHADOW); reflected_light *= f_light * point_shadow * shade_frac; max_light *= f_light * point_shadow * shade_frac;