medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 18c3098295a78c86857a6104b0e7b88da8a27e90
parent 9c4e1158a7efa0ee6f45a056f051dcdb2e190ba3
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Mon Nov 28 21:13:36 +0200

Add a halo around the sun

Diffstat:
skybox.cc | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/skybox.cc b/skybox.cc @@ -31,12 +31,14 @@ static const char * frag_src = GLSL( vec4 horizon = vec4( 0.4, 0.7, 1.0, 1.0 ); vec4 top = vec4( 0.3, 0.6, 1.0, 1.0 ); + vec4 halo = vec4( 0.7, 0.8, 1.0, 1.0 ); vec4 sunny = vec4( 0.9, 0.9, 0.2, 1.0 ); float scaled_z = smoothstep( 0.0, 0.2, pos.z ); float sun_dot = smoothstep( 0.99, 1.0, dot( sun_direction, normalize( pos ) ) ); + float halo_dot = smoothstep( 0.9, 1.0, dot( sun_direction, normalize( pos ) ) ); - colour = mix( mix( horizon, top, scaled_z ), sunny, sun_dot ); + colour = mix( mix( mix( horizon, top, scaled_z ), halo, halo_dot ), sunny, sun_dot ); } );