PageRenderTime 42ms CodeModel.GetById 23ms RepoModel.GetById 0ms 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
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. uniform samplerCube environmentMap;
  25. vec3 fullbrightShinyAtmosTransport(vec3 light);
  26. vec3 fullbrightScaleSoftClip(vec3 light);
  27. vec4 applyWaterFog(vec4 color);
  28. void fullbright_shiny_lighting_water()
  29. {
  30. vec4 color = diffuseLookup(gl_TexCoord[0].xy);
  31. color.rgb *= gl_Color.rgb;
  32. vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb;
  33. color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a);
  34. color.rgb = fullbrightShinyAtmosTransport(color.rgb);
  35. color.rgb = fullbrightScaleSoftClip(color.rgb);
  36. color.a = max(color.a, gl_Color.a);
  37. gl_FragColor = applyWaterFog(color);
  38. }