summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2019-01-25 22:04:47 +0000
committerRider Linden <rider@lindenlab.com>2019-01-25 22:04:47 +0000
commit64ce16aa078a028a2009d0d76bc2bf2133f033c5 (patch)
treead3a20b8a872306ef058ab428f13087e44724394 /indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl
parent9246be072101e4e09f6ab2655eb78939242bac3f (diff)
parent88d4d85711a25772f3659850902e3a395ef2358c (diff)
Merged in graham_linden/viewer-eep-fixes (pull request #237)
SL-10303
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl16
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl
index c67ed8e6d9..0d117c6bc7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunDiscV.glsl
@@ -31,18 +31,22 @@ ATTRIBUTE vec3 position;
ATTRIBUTE vec2 texcoord0;
VARYING vec2 vary_texcoord0;
+VARYING float sun_fade;
void calcAtmospherics(vec3 eye_pos);
void main()
{
- //transform vertex
- vec4 vert = vec4(position.xyz - vec3(0, 0, 50), 1.0);
- vec4 pos = modelview_projection_matrix*vert;
+ //transform vertex
+ vec3 offset = vec3(0, 0, 50);
+ vec4 vert = vec4(position.xyz - offset, 1.0);
+ vec4 pos = modelview_projection_matrix*vert;
- gl_Position = pos;
-
+ sun_fade = smoothstep(0.3, 1.0, (position.z + 50) / 512.0f);
+
+ gl_Position = pos;
+
calcAtmospherics(pos.xyz);
- vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
}