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/class2/effects | |
parent | 4fea7dcb3ef35cae9e31ba467403d31ce9083905 (diff) |
SH-2243 work in progress -- don't use deprecated shader state
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/effects')
7 files changed, 17 insertions, 67 deletions
diff --git a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl b/indra/newview/app_settings/shaders/class2/effects/blurF.glsl index 35411db04b..01fe4a4e14 100644 --- a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/blurF.glsl @@ -23,29 +23,5 @@ * $/LicenseInfo$ */ +//NOT USED!!! - -uniform sampler2DRect RenderTexture; -uniform float bloomStrength; - -varying vec4 gl_TexCoord[gl_MaxTextureCoords]; -void main(void) -{ - float blurWeights[7]; - blurWeights[0] = 0.05; - blurWeights[1] = 0.1; - blurWeights[2] = 0.2; - blurWeights[3] = 0.3; - blurWeights[4] = 0.2; - blurWeights[5] = 0.1; - blurWeights[6] = 0.05; - - vec3 color = vec3(0,0,0); - for (int i = 0; i < 7; i++){ - color += vec3(texture2DRect(RenderTexture, gl_TexCoord[i].st)) * blurWeights[i]; - } - - color *= bloomStrength; - - gl_FragColor = vec4(color, 1.0); -} diff --git a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl index 4fd4b101ff..b92e9b3f03 100644 --- a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl @@ -23,36 +23,5 @@ * $/LicenseInfo$ */ -uniform mat4 modelview_projection_matrix; + // NOT USED!! -attribute vec3 position; -attribute vec2 texcoord0; - -uniform vec2 texelSize; -uniform vec2 blurDirection; -uniform float blurWidth; - -void main(void) -{ - // Transform vertex - gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - - vec2 blurDelta = texelSize * blurDirection * vec2(blurWidth, blurWidth); - vec2 s = vec4(texcoord0,0,1).st - (blurDelta * 3.0); - - // for (int i = 0; i < 7; i++) { - // gl_TexCoord[i].st = s + (i * blurDelta); - // } - - // MANUALLY UNROLL - gl_TexCoord[0].st = s; - gl_TexCoord[1].st = s + blurDelta; - gl_TexCoord[2].st = s + (2. * blurDelta); - gl_TexCoord[3].st = s + (3. * blurDelta); - gl_TexCoord[4].st = s + (4. * blurDelta); - gl_TexCoord[5].st = s + (5. * blurDelta); - gl_TexCoord[6].st = s + (6. * blurDelta); - - // gl_TexCoord[0].st = s; - // gl_TexCoord[1].st = blurDelta; -} diff --git a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl index 42ab8d40e8..8d673237b8 100644 --- a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl @@ -36,7 +36,7 @@ const float gamma = 2.0; void main(void) { - vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st)); + vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st)); /// Modulate brightness color *= brightness; diff --git a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl index d3c93ab05f..f03a6076c0 100644 --- a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl @@ -25,15 +25,15 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec2 texcoord0; -attribute vec2 texcoord1; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; void main(void) { //transform vertex gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_TexCoord[0] = vec4(texcoord0,0,1); - gl_TexCoord[1] = vec4(texcoord1,0,1); + vary_texcoord0 = texcoord0; + vary_texcoord1 = texcoord1; } diff --git a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl index 9187c8ec31..06b83e3f5f 100644 --- a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl @@ -33,7 +33,7 @@ uniform vec3 lumWeights; void main(void) { /// Get scene color - vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st)); + vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st)); /// Extract luminance and scale up by night vision brightness float lum = smoothstep(extractLow, extractHigh, dot(color, lumWeights)); diff --git a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl index 76b675a9bd..3050fa63cc 100644 --- a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl @@ -30,6 +30,9 @@ uniform sampler2D NoiseTexture; uniform float brightMult; uniform float noiseStrength; +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; + float luminance(vec3 color) { /// CALCULATING LUMINANCE (Using NTSC lum weights) @@ -40,7 +43,7 @@ float luminance(vec3 color) void main(void) { /// Get scene color - vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st)); + vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st)); /// Extract luminance and scale up by night vision brightness float lum = luminance(color) * brightMult; @@ -50,7 +53,7 @@ void main(void) vec3 outColor = (lum * vec3(0.91, 1.21, 0.9)) + vec3(-0.07, 0.1, -0.12); /// Add noise - float noiseValue = texture2D(NoiseTexture, gl_TexCoord[1].st).r; + float noiseValue = texture2D(NoiseTexture, vary_texcoord1.st).r; noiseValue = (noiseValue - 0.5) * noiseStrength; /// Older NVG colors (more muted) diff --git a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl index abf1be6645..74e9559185 100644 --- a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl @@ -27,8 +27,10 @@ uniform sampler2DRect RenderTexture; +VARYING vec2 vary_texcoord0; + void main(void) { - vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st)); + vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st)); gl_FragColor = vec4(1.0 - color, 1.0); } |