summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2022-06-24 13:07:03 -0700
committerPtolemy <ptolemy@lindenlab.com>2022-06-24 13:07:03 -0700
commit8acaa7378f67200d4bb4018379b467f1dd8ab98d (patch)
tree8dc3b4aff0f34ab3cf9d9b4253a3cb8318896870 /indra/newview/app_settings/shaders
parentbbd87a154e7b114276b027707cab00df7120acd2 (diff)
parentc5e3ace94de01ed61ed43284ea72dacec197cdc9 (diff)
Merge branch 'DRTVWR-559' of bitbucket.org:lindenlab/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview/app_settings/shaders')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl3
2 files changed, 18 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 1b5a1c82a2..5538b445fa 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl
@@ -32,10 +32,18 @@
uniform sampler2D diffuseMap; //always in sRGB space
+uniform float metallicFactor;
+uniform float roughnessFactor;
+uniform vec3 emissiveColor;
+
#ifdef HAS_NORMAL_MAP
uniform sampler2D bumpMap;
#endif
+#ifdef HAS_EMISSIVE_MAP
+ uniform sampler2D emissiveMap;
+#endif
+
#ifdef HAS_SPECULAR_MAP
uniform sampler2D specularMap; // Packed: Occlusion, Metal, Roughness
#endif
@@ -76,8 +84,6 @@ void main()
// else
vec3 col = vertex_color.rgb * texture2D(diffuseMap, vary_texcoord0.xy).rgb;
- vec3 emissive = vec3(0);
-
#ifdef HAS_NORMAL_MAP
vec4 norm = texture2D(bumpMap, vary_texcoord1.xy);
norm.xyz = norm.xyz * 2 - 1;
@@ -105,6 +111,14 @@ void main()
vec3 spec = vec3(1,1,1);
#endif
+ spec.g *= roughnessFactor;
+ spec.b *= metallicFactor;
+
+ vec3 emissive = emissiveColor;
+#ifdef HAS_EMISSIVE_MAP
+ emissive *= texture2D(emissiveMap, vary_texcoord0.xy).rgb;
+#endif
+
#if DEBUG_BASIC
col.rgb = vec3( 1, 0, 1 );
diff --git a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
index 8c1323ba1a..ab5badf538 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
@@ -473,4 +473,5 @@ void applyGlossEnv(inout vec3 color, vec3 glossenv, vec4 spec, vec3 pos, vec3 no
fresnel = min(fresnel+envIntensity, 1.0);
reflected_color *= (envIntensity*fresnel)*brighten(spec.rgb);
color = mix(color.rgb, reflected_color, envIntensity);
- } \ No newline at end of file
+ }
+