commit 758e00f61b4e288a2a8f7c6e9b9bcf8574b08226 parent 668817ad689e352ecad59415edec3e6fba2c5c12 Author: Michael Savage <mikejsavage@gmail.com> Date: Sat Dec 3 21:59:55 +0200 No fog closer than 500 units away Diffstat:
terrain_manager.cc | | | 3 | ++- |
diff --git a/terrain_manager.cc b/terrain_manager.cc @@ -100,7 +100,8 @@ static const char * frag_src = GLSL( // fog vec3 fog_color = vec3( 0.6, 0.6, 0.6 ); - float fog_t = 1.0 - clamp( 1.0 / exp( dot( vpos, vpos ) * 0.0005 * 0.0005 ), 0.0, 1.0 ); + float fog_distance_bias = -500.0 * 500.0; + float fog_t = 1.0 - clamp( 1.0 / exp( ( fog_distance_bias + dot( vpos, vpos ) ) * 0.0005 * 0.0005 ), 0.0, 1.0 ); colour = vec4( mix( c, fog_color, fog_t ), 1.0 ); }