medfall

A super great game engine
Log | Files | Refs

commit 4b7c92092658dfa9d1ef693bea705d7f9c3a2e3d
parent e576908af859079ca534144a7840c5213a58dc96
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun, 29 Oct 2017 09:37:08 +0200

Less foggy terrain

Diffstat:
shaders/terrain.glsl | 6++----
shaders/tree.glsl | 5++---
2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/shaders/terrain.glsl b/shaders/terrain.glsl @@ -89,10 +89,8 @@ void main() { // fog vec3 fog_colour = vec3( 0.5, 0.6, 0.7 ); - float fog_strength = 0.0005; - // don't draw any fog too close to the camera because the banding is quite noticable - float fog_distance_bias = 100.0; - float fog_t = 1.0 - exp( -fog_strength * max( ( length( v2f.view_position ) - fog_distance_bias ), 0.0 ) ); + float fog_strength = 0.0003; + float fog_t = 1.0 - exp( -fog_strength * max( ( length( v2f.view_position ) ), 0.0 ) ); vec3 dither_noise = texture( blue_noise, gl_FragCoord.xy / textureSize( blue_noise, 0 ) ).xxx; dither_noise = ( dither_noise - vec3( 0.5 ) ) / 128.0; diff --git a/shaders/tree.glsl b/shaders/tree.glsl @@ -46,9 +46,8 @@ void main() { // fog vec3 fog_colour = vec3( 0.5, 0.6, 0.7 ); - float fog_strength = 0.0005; - float fog_distance_bias = 100.0; - float fog_t = 1.0 - exp( -fog_strength * max( ( length( v2f.view_position ) - fog_distance_bias ), 0.0 ) ); + float fog_strength = 0.0003; + float fog_t = 1.0 - exp( -fog_strength * max( ( length( v2f.view_position ) ), 0.0 ) ); screen_colour = vec4( linear_to_srgb( mix( c, fog_colour, fog_t ) ), 1.0 ); }