diff --git a/assets/voxygen/shaders/include/point_glow.glsl b/assets/voxygen/shaders/include/point_glow.glsl index 5f8e848f72..11b08e302d 100644 --- a/assets/voxygen/shaders/include/point_glow.glsl +++ b/assets/voxygen/shaders/include/point_glow.glsl @@ -30,6 +30,14 @@ vec3 apply_point_glow(vec3 wpos, vec3 dir, float max_dist, vec3 color) { float strength = pow(attenuation_strength_real(difference), spread); + #ifdef EXPERIMENTAL_LOWGLOWNEARCAMERA + vec3 cam_wpos = cam_pos.xyz + focus_pos.xyz + focus_off.xyz; + vec3 cam_diff = light_pos - cam_wpos; + float cam_dist_2 = dot(cam_diff, cam_diff); + // 3 meters away glow returns to the maximum strength. + strength *= clamp(cam_dist_2 / 9.0, 0.25, 1.0); + #endif + vec3 light_color = srgb_to_linear(L.light_col.rgb) * strength; const float LIGHT_AMBIANCE = 0.025; diff --git a/voxygen/src/render/mod.rs b/voxygen/src/render/mod.rs index 19aad1168b..e1c9f4a7b4 100644 --- a/voxygen/src/render/mod.rs +++ b/voxygen/src/render/mod.rs @@ -456,4 +456,6 @@ pub enum ExperimentalShader { /// Removes as many effects (including lighting) as possible in the name of /// performance. BareMinimum, + /// Lowers strength of the glow effect for lights near the camera. + LowGlowNearCamera, }