From da84f5552731e1ece3a463c4c385bb327f1048a1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 16 Sep 2011 12:40:53 -0500 Subject: SH-2243 work in progress -- don't use deprecated shader state --- .../app_settings/shaders/class1/lighting/lightShinyWaterF.glsl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl index ca1af8fc79..9c9f7ca658 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl @@ -24,14 +24,15 @@ */ - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; uniform sampler2D diffuseMap; uniform samplerCube environmentMap; void shiny_lighting_water() { - vec4 color = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy); + vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy); gl_FragColor = color; } -- cgit v1.2.3 From 8a1baaea6c0462b645499e8e7b88345e46b92621 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 16 Sep 2011 17:08:39 -0500 Subject: SH-2243 work in progress -- don't use gl_FragColor or gl_FragData for outputs -- no more deprecation warnings on nvidia --- .../app_settings/shaders/class1/lighting/lightShinyWaterF.glsl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl index 9c9f7ca658..05c9310a37 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl @@ -22,7 +22,10 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; -- cgit v1.2.3 From 183fe0d14c48ebeb174567304cea197e7ea443fa Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 24 Sep 2011 03:09:32 -0500 Subject: SH-2244 Fix for shaders not compiling on pre-GL-3.0 ATI drivers --- .../newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl index 05c9310a37..6761d35316 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif -- cgit v1.2.3 From 7238714634e72dacc4b09c1c4ee98b16fb0c91fe Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 29 Sep 2011 19:32:56 -0500 Subject: SH-2507 Potential fix for basic shaders causing objects to disappear with some drivers (prune shader tree of unused shaders while we're at it) --- .../shaders/class1/lighting/lightShinyWaterF.glsl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl index 6761d35316..68c727d62c 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl @@ -29,13 +29,23 @@ out vec4 gl_FragColor; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; -uniform sampler2D diffuseMap; uniform samplerCube environmentMap; -void shiny_lighting_water() +vec3 atmosLighting(vec3 light); +vec4 applyWaterFog(vec4 color); + +void shiny_lighting_water() { - vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy); - gl_FragColor = color; + vec4 color = diffuseLookup(vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; + + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); + + color.rgb = atmosLighting(color.rgb); + color.a = max(color.a, vertex_color.a); + gl_FragColor = applyWaterFog(color); } -- cgit v1.2.3 From 3710c6110d65d3a604f7b419cd764cf5b9b98600 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 10 Feb 2012 20:04:19 -0600 Subject: SH-2908 Rework indexed texture rendering to use a uvec4 instead of a float for texture indices in the data stream. Also rework gl_FragColor overrides to not collide with some odd driver implementations. --- .../app_settings/shaders/class1/lighting/lightShinyWaterF.glsl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl index 68c727d62c..cf78149733 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -46,6 +48,6 @@ void shiny_lighting_water() color.rgb = atmosLighting(color.rgb); color.a = max(color.a, vertex_color.a); - gl_FragColor = applyWaterFog(color); + frag_color = applyWaterFog(color); } -- cgit v1.2.3 From 60fa5c3d4e23967d1ecd1e5189685ca94223cfb4 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 13 Feb 2012 19:53:39 -0600 Subject: SH-2908 Fix for shaders failing to compile when using GLSL 1.20 or 1.10 profile. --- .../newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl') diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl index cf78149733..d2a4c47aac 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl @@ -26,7 +26,7 @@ #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; #else -#define frag_color gl_FragColor; +#define frag_color gl_FragColor #endif VARYING vec4 vertex_color; -- cgit v1.2.3