summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1
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/class1
parentbbd87a154e7b114276b027707cab00df7120acd2 (diff)
parentc5e3ace94de01ed61ed43284ea72dacec197cdc9 (diff)
Merge branch 'DRTVWR-559' of bitbucket.org:lindenlab/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl18
1 files changed, 16 insertions, 2 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 );