summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/interface
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-03-22 10:56:19 -0700
committerRichard Linden <none@none>2013-03-22 10:56:19 -0700
commit21b7de56ad6c1efd81ad4406aba1428633b9356e (patch)
treee43549e0684da27f03e6507bc118403e876c2458 /indra/newview/app_settings/shaders/class1/interface
parent68f9f656cd22332e46959a90347e38f79c19a66c (diff)
parent041024e8e5d1f27ab77dc4fa2c1e38b8266e7b41 (diff)
Automated merge with bundle:d:\code\viewer-interesting+c:\users\richard\appdata\local\temp\thg.sp0eps\ssh__richard@hg.lindenlab.com_richard_viewer-interesting-metrics_5o81ck.hg
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/interface')
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl17
1 files changed, 17 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl
index 050114b37e..6eeb2596b2 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl
@@ -31,6 +31,10 @@ out vec4 frag_color;
uniform sampler2D tex0;
uniform sampler2D tex1;
+uniform sampler2D dither_tex;
+uniform float dither_scale;
+uniform float dither_scale_s;
+uniform float dither_scale_t;
VARYING vec2 vary_texcoord0;
VARYING vec2 vary_texcoord1;
@@ -38,4 +42,17 @@ VARYING vec2 vary_texcoord1;
void main()
{
frag_color = abs(texture2D(tex0, vary_texcoord0.xy) - texture2D(tex1, vary_texcoord0.xy));
+
+ vec2 dither_coord;
+ dither_coord[0] = vary_texcoord0[0] * dither_scale_s;
+ dither_coord[1] = vary_texcoord0[1] * dither_scale_t;
+ vec4 dither_vec = texture(dither_tex, dither_coord.xy);
+
+ for(int i = 0; i < 3; i++)
+ {
+ if(frag_color[i] < dither_vec[i] * dither_scale)
+ {
+ frag_color[i] = 0.f;
+ }
+ }
}