aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl')
-rw-r--r--linden/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl41
1 files changed, 41 insertions, 0 deletions
diff --git a/linden/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/linden/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
new file mode 100644
index 0000000..bc6d6d3
--- /dev/null
+++ b/linden/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
@@ -0,0 +1,41 @@
1/**
2 * @file WLSkyF.glsl
3 *
4 * Copyright (c) 2005-$CurrentYear$, Linden Research, Inc.
5 * $License$
6 */
7
8/////////////////////////////////////////////////////////////////////////
9// The fragment shader for the sky
10/////////////////////////////////////////////////////////////////////////
11
12varying vec4 vary_HazeColor;
13
14uniform sampler2D cloud_noise_texture;
15uniform vec4 gamma;
16
17/// Soft clips the light with a gamma correction
18vec3 scaleSoftClip(vec3 light) {
19 //soft clip effect:
20 light = 1. - clamp(light, vec3(0.), vec3(1.));
21 light = 1. - pow(light, gamma.xxx);
22
23 return light;
24}
25
26void main()
27{
28 // Potential Fill-rate optimization. Add cloud calculation
29 // back in and output alpha of 0 (so that alpha culling kills
30 // the fragment) if the sky wouldn't show up because the clouds
31 // are fully opaque.
32
33 vec4 color;
34 color = vary_HazeColor;
35 color *= 2.;
36
37 /// Gamma correct for WL (soft clip effect).
38 gl_FragColor.rgb = scaleSoftClip(color.rgb);
39 gl_FragColor.a = 1.0;
40}
41