From 8abc2ad094c150479530d2c8d99ceb7c484497d7 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 11 Aug 2022 15:26:51 -0700 Subject: SL-17929: PBR: Add sun/moon reflection in surface --- .../app_settings/shaders/class3/deferred/softenLightF.glsl | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl') diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index c2a3e472d0..e3608a1136 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -319,6 +319,16 @@ void main() #endif colorDiffuse *= packedORM.r; // Occlusion -- NOTE: pbropaque will need occlusion_strength pre-multiplied into spec.r + // Add in sun/moon reflection + if (metal > 0.0) + { + vec3 r = reflect(pos.xyz, norm.xyz); + float sa = dot(normalize(r), light_dir.xyz); + float sun = texture2D(lightFunc, vec2(sa, metal)).r; + vec3 sunSpec = sunlit * scol * sun; + colorSpec += sunSpec; + bloom = dot(sunSpec, sunSpec) / 6; + } color.rgb = colorDiffuse + colorEmissive + colorSpec; vec3 sun_contrib = min(da, scol) * sunlit; -- cgit v1.2.3