-"struct world_info\n"
-"{\n"
-" float time,\n"
-" time_of_day,\n"
-" day_phase,\n"
-" sunset_phase;\n"
-" \n"
-" vec3 sun_dir;\n"
-"};\n"
-"\n"
-"float luminance( vec3 v )\n"
-"{\n"
-" return dot( v, vec3(0.2126, 0.7152, 0.0722) );\n"
-"}\n"
-"\n"
-"vec3 scene_ambient( vec3 dir, const world_info w )\n"
-"{\n"
-" float sun_azimuth = dot( dir.xz, w.sun_dir.xz ) * 0.4 + 0.6;\n"
-" float sky_gradient = dir.y;\n"
-" \n"
-" /* Blend phase colours */\n"
-" vec3 ambient = DAYSKY_COLOUR * (w.day_phase-w.sunset_phase*0.1);\n"
-" ambient += SUNSET_COLOUR * (1.0-dir.y*0.5) * w.sunset_phase * sun_azimuth;\n"
-" ambient += NIGHTSKY_COLOUR * (1.0-w.day_phase);\n"
-" \n"
-" /* Add gradient */\n"
-" ambient -= sky_gradient * luminance(ambient);\n"
-" \n"
-" return ambient;\n"
-"}\n"
-"\n"
-"vec3 scene_sky( vec3 ray_dir, const world_info w )\n"
-"{\n"
-" ray_dir.y = abs( ray_dir.y );\n"
-" vec3 sky_colour = scene_ambient( ray_dir, w );\n"
-" \n"
-" /* Sun */\n"
-" float sun_theta = dot( ray_dir, w.sun_dir );\n"
-" float sun_size = max( 0.0, sun_theta * 0.5 + 0.5 + SUN_ANGLE );\n"
-" float sun_shape = pow( sun_size, 2000.0 );\n"
-" sun_shape += sun_size * max(w.sun_dir.y,0.0) * 0.5;\n"
-" \n"
-" vec3 sun_colour = mix( vec3(1.0), SUNSET_COLOUR, w.sunset_phase*0.5 );\n"
-" sun_colour *= sun_shape;\n"
-" \n"
-" vec3 composite = sky_colour + sun_colour;\n"
-" return composite;\n"
-"}\n"