PageRenderTime 90ms CodeModel.GetById 20ms app.highlight 1ms RepoModel.GetById 28ms app.codeStats 1ms

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

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