summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-08-10 14:40:39 -0500
committerDave Parks <davep@lindenlab.com>2011-08-10 14:40:39 -0500
commit17f46868d28876b65adcf24a45e6c19a20f2834c (patch)
tree6d496917f91e0a752ad1d9ae63e8252b7a6e6e5e /indra/newview/app_settings/shaders
parentf302e119627090c22325df59c40e1762402a08c6 (diff)
SH-2265 Fix for impostor alpha masking being broken.
Diffstat (limited to 'indra/newview/app_settings/shaders')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/impostorF.glsl26
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/impostorV.glsl16
3 files changed, 50 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
index fa811f0d55..75f594ed8f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl
@@ -5,6 +5,8 @@
* $/LicenseInfo$
*/
+uniform float minimum_alpha;
+uniform float maximum_alpha;
uniform sampler2D diffuseMap;
@@ -14,6 +16,12 @@ uniform sampler2D specularMap;
void main()
{
vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
+
+ if (col.a < minimum_alpha || col.a > maximum_alpha)
+ {
+ discard;
+ }
+
gl_FragData[0] = vec4(col.rgb, col.a * 0.005);
gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy);
gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0);
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
new file mode 100644
index 0000000000..7257132f06
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorF.glsl
@@ -0,0 +1,26 @@
+/**
+ * @file impostorF.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+
+uniform float minimum_alpha;
+uniform float maximum_alpha;
+
+vec3 fullbrightAtmosTransport(vec3 light);
+vec3 fullbrightScaleSoftClip(vec3 light);
+
+uniform sampler2D diffuseMap;
+
+void main()
+{
+ vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color;
+
+ if (color.a < minimum_alpha || color.a > maximum_alpha)
+ {
+ discard;
+ }
+
+ gl_FragColor = color;
+}
diff --git a/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
new file mode 100644
index 0000000000..724b86a1b7
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/objects/impostorV.glsl
@@ -0,0 +1,16 @@
+/**
+ * @file impostorV.glsl
+ *
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $/LicenseInfo$
+ */
+
+
+void main()
+{
+ //transform vertex
+ gl_Position = ftransform();
+ gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+
+ gl_FrontColor = gl_Color;
+}