From 2962acfdedc2ffab10d3696eb52e944543cfd278 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Fri, 27 Mar 2015 15:05:01 +0100 Subject: [PATCH] Made sun shine through the fog. --- data/shader/skydome.fsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/shader/skydome.fsh b/data/shader/skydome.fsh index 7883e67..e8e4944 100644 --- a/data/shader/skydome.fsh +++ b/data/shader/skydome.fsh @@ -80,8 +80,8 @@ void main() { fogFactor *= clamp((1.0-((fragPosition.y-40.0)/30.0)), 0.0, 1.0); if (distanceToSun < sunSize) { float sunIntensity = clamp(0.3*exp(1/(distanceToSun/sunSize))-exp(1.0)*0.3, 0.0, 1.0); - vec4 color = mix(textureColor, vec4(sunColorFunc(sunAngle), sunIntensity), sunIntensity); - oColor = mix(color, fogColor(-sunAngle), fogFactor); + vec4 fogcolor = mix(textureColor, fogColor(-sunAngle), fogFactor); + oColor = mix(fogcolor, vec4(sunColorFunc(sunAngle), sunIntensity), sunIntensity*sin(2*(-sunAngle))); } else { oColor = mix(textureColor, fogColor(-sunAngle), fogFactor);