PageRenderTime 22ms CodeModel.GetById 16ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl

https://bitbucket.org/lindenlab/viewer-beta/
Unknown | 53 lines | 44 code | 9 blank | 0 comment | 0 complexity | 1ec82f32e1711fe7d72868fe82c655f3 MD5 | raw file
 1/** 
 2 * @file lightFullbrightShinyWaterF.glsl
 3 * $LicenseInfo:firstyear=2007&license=viewerlgpl$
 4 * Second Life Viewer Source Code
 5 * Copyright (C) 2007, Linden Research, Inc.
 6 * 
 7 * This library is free software; you can redistribute it and/or
 8 * modify it under the terms of the GNU Lesser General Public
 9 * License as published by the Free Software Foundation;
10 * version 2.1 of the License only.
11 * 
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * Lesser General Public License for more details.
16 * 
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20 * 
21 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
22 * $/LicenseInfo$
23 */
24 
25#ifdef DEFINE_GL_FRAGCOLOR
26out vec4 gl_FragColor;
27#endif
28
29VARYING vec4 vertex_color;
30VARYING vec2 vary_texcoord0;
31VARYING vec3 vary_texcoord1;
32
33uniform samplerCube environmentMap;
34
35vec3 fullbrightShinyAtmosTransport(vec3 light);
36vec3 fullbrightScaleSoftClip(vec3 light);
37vec4 applyWaterFog(vec4 color);
38
39void fullbright_shiny_lighting_water()
40{
41	vec4 color = diffuseLookup(vary_texcoord0.xy);
42	color.rgb *= vertex_color.rgb;
43	
44	vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;	
45	color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
46
47	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
48	color.rgb = fullbrightScaleSoftClip(color.rgb);
49	color.a = max(color.a, vertex_color.a);
50
51	gl_FragColor = applyWaterFog(color);
52}
53