summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2022-09-02 16:12:49 -0700
committerPtolemy <ptolemy@lindenlab.com>2022-09-02 16:12:49 -0700
commit7229dfcc59943f025219721701b2bda471a2ae25 (patch)
tree99d9a93c3e7e32aff2c851b2a627d41ec8daa8f5 /indra/newview/app_settings/shaders
parent7bb5315847f6ad68927efac9914bee3bb81bb894 (diff)
SL-17701: PBR: Add support for gltf Alpha MASK (cutoff)
Diffstat (limited to 'indra/newview/app_settings/shaders')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl12
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
index b5c38bba04..b0becdbb5b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
@@ -76,17 +76,23 @@ VARYING vec2 vary_texcoord1;
VARYING vec2 vary_texcoord2;
#endif
+uniform float minimum_alpha; // PBR alphaMode: MASK, See: mAlphaCutoff, setAlphaCutoff()
+
vec2 encode_normal(vec3 n);
vec3 linear_to_srgb(vec3 c);
-const float M_PI = 3.141592653589793;
-
void main()
{
// IF .mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels;
// vec3 col = vertex_color.rgb * diffuseLookup(vary_texcoord0.xy).rgb;
// else
- vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb;
+ vec4 albedo = texture2D(diffuseMap, vary_texcoord0.xy).rgba;
+ if (albedo.a < minimum_alpha)
+ {
+ discard;
+ }
+
+ vec3 col = vertex_color.rgb * albedo.rgb;
#ifdef HAS_NORMAL_MAP
vec4 norm = texture2D(bumpMap, vary_texcoord1.xy);