PageRenderTime 47ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.1
  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. #ifdef DEFINE_GL_FRAGCOLOR
  25. out vec4 gl_FragColor;
  26. #endif
  27. VARYING vec4 vertex_color;
  28. VARYING vec2 vary_texcoord0;
  29. VARYING vec3 vary_texcoord1;
  30. uniform samplerCube environmentMap;
  31. vec3 fullbrightShinyAtmosTransport(vec3 light);
  32. vec3 fullbrightScaleSoftClip(vec3 light);
  33. vec4 applyWaterFog(vec4 color);
  34. void fullbright_shiny_lighting_water()
  35. {
  36. vec4 color = diffuseLookup(vary_texcoord0.xy);
  37. color.rgb *= vertex_color.rgb;
  38. vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb;
  39. color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a);
  40. color.rgb = fullbrightShinyAtmosTransport(color.rgb);
  41. color.rgb = fullbrightScaleSoftClip(color.rgb);
  42. color.a = max(color.a, vertex_color.a);
  43. gl_FragColor = applyWaterFog(color);
  44. }