PageRenderTime 31ms CodeModel.GetById 28ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://bitbucket.org/lindenlab/viewer-beta/
text | 48 lines | 38 code | 10 blank | 0 comment | 0 complexity | 5e907f0ce1db375014798b70266f6f81 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
26
27
28uniform samplerCube environmentMap;
29
30vec3 fullbrightShinyAtmosTransport(vec3 light);
31vec3 fullbrightScaleSoftClip(vec3 light);
32vec4 applyWaterFog(vec4 color);
33
34void fullbright_shiny_lighting_water()
35{
36	vec4 color = diffuseLookup(gl_TexCoord[0].xy);
37	color.rgb *= gl_Color.rgb;
38	
39	vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb;	
40	color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a);
41
42	color.rgb = fullbrightShinyAtmosTransport(color.rgb);
43	color.rgb = fullbrightScaleSoftClip(color.rgb);
44	color.a = max(color.a, gl_Color.a);
45
46	gl_FragColor = applyWaterFog(color);
47}
48