summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/effects
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/effects')
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl56
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowF.glsl25
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowV.glsl26
5 files changed, 48 insertions, 80 deletions
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
index e827863436..9a3d792224 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
@@ -23,10 +23,12 @@
* $/LicenseInfo$
*/
-
-
#extension GL_ARB_texture_rectangle : enable
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
+
uniform sampler2DRect diffuseMap;
uniform float minLuminance;
uniform float maxExtractAlpha;
@@ -34,10 +36,11 @@ uniform vec3 lumWeights;
uniform vec3 warmthWeights;
uniform float warmthAmount;
+VARYING vec2 vary_texcoord0;
+
void main()
{
- vec4 col = texture2DRect(diffuseMap, gl_TexCoord[0].xy);
-
+ vec4 col = texture2DRect(diffuseMap, vary_texcoord0.xy);
/// CALCULATING LUMINANCE (Using NTSC lum weights)
/// http://en.wikipedia.org/wiki/Luma_%28video%29
float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) );
@@ -45,4 +48,5 @@ void main()
gl_FragColor.rgb = col.rgb;
gl_FragColor.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha);
+
}
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
deleted file mode 100644
index c2cc8ed567..0000000000
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * @file glowExtractF.glsl
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2007, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-
-
-#extension GL_ARB_texture_rectangle : enable
-#extension GL_ARB_texture_multisample : enable
-
-uniform sampler2DMS diffuseMap;
-uniform float minLuminance;
-uniform float maxExtractAlpha;
-uniform vec3 lumWeights;
-uniform vec3 warmthWeights;
-uniform float warmthAmount;
-
-void main()
-{
- ivec2 itc = ivec2(gl_TexCoord[0].xy);
- vec4 fcol = vec4(0,0,0,0);
-
- for (int i = 0; i < samples; i++)
- {
- vec4 col = texelFetch(diffuseMap, itc, i);
-
- /// CALCULATING LUMINANCE (Using NTSC lum weights)
- /// http://en.wikipedia.org/wiki/Luma_%28video%29
- float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) );
- float warmth = smoothstep(minLuminance, minLuminance+1.0, max(col.r * warmthWeights.r, max(col.g * warmthWeights.g, col.b * warmthWeights.b)) );
-
- fcol += vec4(col.rgb, max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha));
- }
-
- gl_FragColor = fcol/samples;
-}
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
index 8db6d1bf24..1396dc6973 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
@@ -23,11 +23,16 @@
* $/LicenseInfo$
*/
+uniform mat4 modelview_projection_matrix;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
+
+VARYING vec2 vary_texcoord0;
void main()
{
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+ gl_Position = modelview_projection_matrix * vec4(position, 1.0);
- gl_TexCoord[0].xy = gl_MultiTexCoord0.xy;
+ vary_texcoord0.xy = texcoord0;
}
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
index 75cff75ea9..90bb84323c 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl
@@ -23,11 +23,18 @@
* $/LicenseInfo$
*/
-
+#ifdef DEFINE_GL_FRAGCOLOR
+out vec4 gl_FragColor;
+#endif
uniform sampler2D diffuseMap;
uniform float glowStrength;
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
+VARYING vec4 vary_texcoord2;
+VARYING vec4 vary_texcoord3;
+
void main()
{
@@ -38,14 +45,14 @@ void main()
kern[0] = 0.25; kern[1] = 0.5; kern[2] = 0.8; kern[3] = 1.0;
kern[4] = 1.0; kern[5] = 0.8; kern[6] = 0.5; kern[7] = 0.25;
- col += kern[0] * texture2D(diffuseMap, gl_TexCoord[0].xy);
- col += kern[1] * texture2D(diffuseMap, gl_TexCoord[1].xy);
- col += kern[2] * texture2D(diffuseMap, gl_TexCoord[2].xy);
- col += kern[3] * texture2D(diffuseMap, gl_TexCoord[3].xy);
- col += kern[4] * texture2D(diffuseMap, gl_TexCoord[0].zw);
- col += kern[5] * texture2D(diffuseMap, gl_TexCoord[1].zw);
- col += kern[6] * texture2D(diffuseMap, gl_TexCoord[2].zw);
- col += kern[7] * texture2D(diffuseMap, gl_TexCoord[3].zw);
+ col += kern[0] * texture2D(diffuseMap, vary_texcoord0.xy);
+ col += kern[1] * texture2D(diffuseMap, vary_texcoord1.xy);
+ col += kern[2] * texture2D(diffuseMap, vary_texcoord2.xy);
+ col += kern[3] * texture2D(diffuseMap, vary_texcoord3.xy);
+ col += kern[4] * texture2D(diffuseMap, vary_texcoord0.zw);
+ col += kern[5] * texture2D(diffuseMap, vary_texcoord1.zw);
+ col += kern[6] * texture2D(diffuseMap, vary_texcoord2.zw);
+ col += kern[7] * texture2D(diffuseMap, vary_texcoord3.zw);
gl_FragColor = vec4(col.rgb * glowStrength, col.a);
}
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
index a5aacc0196..cdb2281578 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
@@ -23,20 +23,28 @@
* $/LicenseInfo$
*/
+uniform mat4 modelview_projection_matrix;
+ATTRIBUTE vec3 position;
+ATTRIBUTE vec2 texcoord0;
uniform vec2 glowDelta;
+VARYING vec4 vary_texcoord0;
+VARYING vec4 vary_texcoord1;
+VARYING vec4 vary_texcoord2;
+VARYING vec4 vary_texcoord3;
+
void main()
{
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+ gl_Position = modelview_projection_matrix * vec4(position, 1.0);
- gl_TexCoord[0].xy = gl_MultiTexCoord0.xy + glowDelta*(-3.5);
- gl_TexCoord[1].xy = gl_MultiTexCoord0.xy + glowDelta*(-2.5);
- gl_TexCoord[2].xy = gl_MultiTexCoord0.xy + glowDelta*(-1.5);
- gl_TexCoord[3].xy = gl_MultiTexCoord0.xy + glowDelta*(-0.5);
- gl_TexCoord[0].zw = gl_MultiTexCoord0.xy + glowDelta*(0.5);
- gl_TexCoord[1].zw = gl_MultiTexCoord0.xy + glowDelta*(1.5);
- gl_TexCoord[2].zw = gl_MultiTexCoord0.xy + glowDelta*(2.5);
- gl_TexCoord[3].zw = gl_MultiTexCoord0.xy + glowDelta*(3.5);
+ vary_texcoord0.xy = texcoord0 + glowDelta*(-3.5);
+ vary_texcoord1.xy = texcoord0 + glowDelta*(-2.5);
+ vary_texcoord2.xy = texcoord0 + glowDelta*(-1.5);
+ vary_texcoord3.xy = texcoord0 + glowDelta*(-0.5);
+ vary_texcoord0.zw = texcoord0 + glowDelta*(0.5);
+ vary_texcoord1.zw = texcoord0 + glowDelta*(1.5);
+ vary_texcoord2.zw = texcoord0 + glowDelta*(2.5);
+ vary_texcoord3.zw = texcoord0 + glowDelta*(3.5);
}