From ef98be881c3f13e7668f75cb0d302261053d9804 Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Thu, 1 Sep 2022 17:30:48 -0400 Subject: Use an SRGB buffer for initial reflection map capture for proper linear sampling Fix irradiance gen up vector to be properly normalized --- .../newview/app_settings/shaders/class1/interface/irradianceGenF.glsl | 2 +- indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/shaders/class1/interface/irradianceGenF.glsl b/indra/newview/app_settings/shaders/class1/interface/irradianceGenF.glsl index 4d91395a1b..4681fa1abd 100644 --- a/indra/newview/app_settings/shaders/class1/interface/irradianceGenF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/irradianceGenF.glsl @@ -79,7 +79,7 @@ void main() vec3 N = normalize(vary_dir); vec3 up = vec3(0.0, 1.0, 0.0); vec3 right = normalize(cross(up, N)); - up = cross(N, right); + up = normalize(cross(N, right)); const float TWO_PI = PI * 2.0; const float HALF_PI = PI * 0.5; diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 85bb9fbbd1..e6017534ca 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -335,7 +335,6 @@ void main() #if PBR_USE_IRRADIANCE_HACK irradiance = max(amblit,irradiance) * ambocc; #endif - specLight = srgb_to_linear(specLight); #if DEBUG_PBR_SPECLIGHT051 specLight = vec3(0,0.5,1.0); irradiance = specLight; @@ -670,6 +669,9 @@ else diffuse.rgb = linear_to_srgb(diffuse.rgb); // SL-14035 sampleReflectionProbes(ambenv, glossenv, legacyenv, pos.xyz, norm.xyz, spec.a, envIntensity); + ambenv.rgb = linear_to_srgb(ambenv.rgb); + glossenv.rgb = linear_to_srgb(glossenv.rgb); + legacyenv.rgb = linear_to_srgb(legacyenv.rgb); amblit = max(ambenv, amblit); color.rgb = amblit*ambocc; -- cgit v1.2.3