summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2024-05-15 15:41:24 -0700
committerBrad Linden <brad@lindenlab.com>2024-05-15 15:41:24 -0700
commit3cb329d4fa53df9ab1ab371f26a178ef48ae3ca3 (patch)
treeb07ac60e9dcfbc93a86f7c0755e497978b3bba6e /indra/newview/app_settings/shaders/class1/deferred
parent6252449cd392918d976f0af0317c44688e052b32 (diff)
parent29be88d60d654193926add496d2d851f7c217356 (diff)
Merge commit '29be88d60d654193926add496d2d851f7c217356' into project/gltf_development
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl8
2 files changed, 7 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl
index 1d1545be7e..35b7602569 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl
@@ -35,7 +35,7 @@ uniform float minimum_alpha;
void main()
{
- float alpha = texture(diffuseMap,vary_texcoord0.xy).a;
+ float alpha = texture(diffuseMap,vary_texcoord0.xy).a * vertex_color.a;
if (alpha < minimum_alpha)
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
index 1d5f810cf3..380d493636 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
@@ -69,12 +69,16 @@ void main()
mirrorClip(vary_position);
vec4 basecolor = texture(diffuseMap, base_color_texcoord.xy).rgba;
+ basecolor.rgb = srgb_to_linear(basecolor.rgb);
+
+ basecolor *= vertex_color;
+
if (basecolor.a < minimum_alpha)
{
discard;
}
- vec3 col = vertex_color.rgb * srgb_to_linear(basecolor.rgb);
+ vec3 col = basecolor.rgb;
// from mikktspace.com
vec3 vNt = texture(bumpMap, normal_texcoord.xy).xyz*2.0-1.0;
@@ -108,7 +112,7 @@ void main()
//emissive = tnorm*0.5+0.5;
// See: C++: addDeferredAttachments(), GLSL: softenLightF
frag_data[0] = max(vec4(col, 0.0), vec4(0)); // Diffuse
- frag_data[1] = max(vec4(spec.rgb,vertex_color.a), vec4(0)); // PBR linear packed Occlusion, Roughness, Metal.
+ frag_data[1] = max(vec4(spec.rgb,0.0), vec4(0)); // PBR linear packed Occlusion, Roughness, Metal.
frag_data[2] = vec4(tnorm, GBUFFER_FLAG_HAS_PBR); // normal, environment intensity, flags
frag_data[3] = max(vec4(emissive,0), vec4(0)); // PBR sRGB Emissive
}