summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2022-06-28 11:11:40 -0700
committerPtolemy <ptolemy@lindenlab.com>2022-06-28 11:11:40 -0700
commit7fdb05d7ef449d2cc9b96c77c7bfa41bf7c15ede (patch)
tree13209fe8b7cd0217353b1baf172390216dbcf9f6 /indra
parentc90fb9b14c61a81c2cebfaa7d92c09d98bfd06da (diff)
SL-17274: PBR: Add occlusion
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl10
1 files changed, 9 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index c97a09ab1d..ff2b87b9df 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -33,6 +33,7 @@
#define DEBUG_PBR_IRRADIANCE 0 // Output: Diffuse Irradiance
#define DEBUG_PBR_DIFFUSE 0 // Output: Radiance Lambertian
#define DEBUG_PBR_ORM 0 // Output: Packed Occlusion Roughness Metal
+#define DEBUG_PBR_OCCLUSION 0 // Output: Occlusion map
#define DEBUG_PBR_ROUGH_PERCEPTUAL 0 // Output: grayscale Perceptual Roughenss
#define DEBUG_PBR_ROUGH_ALPHA 0 // Output: grayscale Alpha Roughness
#define DEBUG_PBR_METAL 0 // Output: grayscale metal
@@ -277,7 +278,11 @@ void main()
vec3 kDiffuse = colorDiffuse * (1.0 - FssEssLambert + FmsEms);
colorDiffuse += (FmsEms + kDiffuse) * irradiance;
- color.rgb = colorDiffuse + colorEmissive + colorSpec;
+ float occlusion_strength = 1.0; // TODO: From glb
+ float ao = packedORM.r;
+ colorDiffuse = mix(colorDiffuse, colorDiffuse * ao, occlusion_strength);
+
+ color.rgb = colorDiffuse + colorEmissive + colorSpec;
#if DEBUG_PBR_BRDF_UV
color.rgb = vec3(brdfPoint,0.0);
@@ -336,6 +341,9 @@ void main()
#if DEBUG_PBR_SPEC_REFLECTION
color.rgb = specLight;
#endif
+ #if DEBUG_PBR_OCCLUSION
+ color.rgb = vec3(packedORM.r);
+ #endif
#if DEBUG_PBR_ORM
color.rgb = packedORM;
#endif