summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3/windlight/advancedAtmoF.glsl
diff options
context:
space:
mode:
authorGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-05-01 00:10:11 +0100
committerGraham Linden graham@lindenlab.com <Graham Linden graham@lindenlab.com>2018-05-01 00:10:11 +0100
commit3116416fcb8dfd54ef2807e9e75959429c946d79 (patch)
tree5fe7a724ac283796faff1e8bfdc2602238047deb /indra/newview/app_settings/shaders/class3/windlight/advancedAtmoF.glsl
parent21ddbd64af44672e4b20dc4cdf99fd1fbc5c07c2 (diff)
Le Merge
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/windlight/advancedAtmoF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class3/windlight/advancedAtmoF.glsl17
1 files changed, 10 insertions, 7 deletions
diff --git a/indra/newview/app_settings/shaders/class3/windlight/advancedAtmoF.glsl b/indra/newview/app_settings/shaders/class3/windlight/advancedAtmoF.glsl
index 014ab9d11b..fed3edf7de 100644
--- a/indra/newview/app_settings/shaders/class3/windlight/advancedAtmoF.glsl
+++ b/indra/newview/app_settings/shaders/class3/windlight/advancedAtmoF.glsl
@@ -32,12 +32,13 @@ out vec4 frag_color;
in vec3 view_dir;
uniform vec3 cameraPosLocal;
-uniform vec3 sun_direction;
+uniform vec3 sun_dir;
uniform float sun_size;
uniform sampler2D transmittance_texture;
uniform sampler3D scattering_texture;
uniform sampler3D mie_scattering_texture;
+uniform sampler2D irradiance_texture;
vec3 GetSolarLuminance();
vec3 GetSkyLuminance(vec3 camPos, vec3 view_dir, float shadow_length, vec3 sun_dir, out vec3 transmittance);
@@ -50,20 +51,22 @@ void main()
vec3 camPos = cameraPosLocal;
vec3 transmittance;
- vec3 radiance = GetSkyLuminance(camPos, view_direction, 0.0f, sun_direction, transmittance);
+ vec3 sky_illum;
+ vec3 radiance = GetSkyLuminance(camPos, view_direction, 0.0f, sun_dir, transmittance);
+ vec3 radiance2 = GetSunAndSkyIlluminance(camPos, view_direction, sun_dir, sky_illum);
- radiance *= transmittance;
+ //radiance *= transmittance;
// If the view ray intersects the Sun, add the Sun radiance.
- if (dot(view_direction, sun_direction) >= sun_size)
+ if (dot(view_direction, sun_dir) >= sun_size)
{
radiance = radiance + transmittance * GetSolarLuminance();
}
- vec3 color = vec3(1.0) - exp(-radiance);
- color = pow(color, vec3(1.0 / 2.2));
+ //vec3 color = vec3(1.0) - exp(-radiance);
+ //color = pow(color, vec3(1.0 / 2.2));
- frag_color.rgb = color;
+ frag_color.rgb = radiance;
frag_color.a = 1.0;
}