diff options
author | Dave Parks <davep@lindenlab.com> | 2011-09-16 12:40:53 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-09-16 12:40:53 -0500 |
commit | da84f5552731e1ece3a463c4c385bb327f1048a1 (patch) | |
tree | dc10fc228a15b69f8b62631a68dbc67efe1f3395 /indra/newview/app_settings/shaders/class1/effects | |
parent | 4fea7dcb3ef35cae9e31ba467403d31ce9083905 (diff) |
SH-2243 work in progress -- don't use deprecated shader state
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/effects')
5 files changed, 38 insertions, 23 deletions
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl index c5ca9f4804..a34e76d25a 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl @@ -34,9 +34,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 ) ); diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl index c2cc8ed567..cbf4dc4bea 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractMSF.glsl @@ -35,9 +35,11 @@ uniform vec3 lumWeights; uniform vec3 warmthWeights; uniform float warmthAmount; +VARYING vec2 vary_texcoord0; + void main() { - ivec2 itc = ivec2(gl_TexCoord[0].xy); + ivec2 itc = ivec2(vary_texcoord0.xy); vec4 fcol = vec4(0,0,0,0); for (int i = 0; i < samples; i++) diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl index 628489296f..1396dc6973 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl @@ -25,13 +25,14 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec2 texcoord0; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +VARYING vec2 vary_texcoord0; void main() { gl_Position = modelview_projection_matrix * vec4(position, 1.0); - gl_TexCoord[0].xy = texcoord0; + 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..3d17a20fbb 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowF.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowF.glsl @@ -28,6 +28,11 @@ 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 +43,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 615ca6a0b4..cdb2281578 100644 --- a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl +++ b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl @@ -25,21 +25,26 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec2 texcoord0; +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 = modelview_projection_matrix * vec4(position, 1.0); - gl_TexCoord[0].xy = texcoord0 + glowDelta*(-3.5); - gl_TexCoord[1].xy = texcoord0 + glowDelta*(-2.5); - gl_TexCoord[2].xy = texcoord0 + glowDelta*(-1.5); - gl_TexCoord[3].xy = texcoord0 + glowDelta*(-0.5); - gl_TexCoord[0].zw = texcoord0 + glowDelta*(0.5); - gl_TexCoord[1].zw = texcoord0 + glowDelta*(1.5); - gl_TexCoord[2].zw = texcoord0 + glowDelta*(2.5); - gl_TexCoord[3].zw = texcoord0 + 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); } |