From 5462ac5d3b20aeefbe750ab10780346c9238bdff Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Mon, 27 Jun 2022 16:45:06 -0700 Subject: SL-17274: PBR: Fix IOR --- .../shaders/class3/deferred/softenLightF.glsl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 0ca7391e32..9b21c7a3cb 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -51,6 +51,7 @@ #define DEBUG_PBR_DOT_TV 0 // Output: #define DEBUG_PBR_DOT_BV 0 // Output: #define DEBUG_PBR_FRESNEL 0 // Output: roughness dependent fresnel +#define DEBUG_PBR_IOR 0 // Output: grayscale IOR #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_shader_texture_lod : enable @@ -205,11 +206,14 @@ void main() #if DEBUG_PBR_PACK_ORM1 packedORM = vec3(1,1,1); #endif - float IOR = 1.5; // default Index Of Reflection 1.5 + float IOR = 1.5; // default Index Of Refraction 1.5 (dielectrics) vec3 reflect0 = vec3(0.04); // -> incidence reflectance 0.04 - - IOR = 0.0; // TODO: Set from glb - reflect0 = calcBaseReflect0(IOR); +#if HAS_IOR + reflect0 = calcBaseReflect0(IOR); +#endif +#if DEBUG_PBR_REFLECT0_BASE + vec3 debug_reflect0 = reflect0; +#endif float metal = packedORM.b; vec3 reflect90 = vec3(0); @@ -273,6 +277,12 @@ void main() #if DEBUG_PBR_FRESNEL color.rgb = fresnelR; #endif + #if DEBUG_PBR_IOR + color.rgb = vec3(IOR); + #endif + #if DEBUG_PBR_KSPEC + color.rgb = kSpec; + #endif #if DEBUG_PBR_RAW_DIFF color.rgb = diffuse.rgb; #endif -- cgit v1.2.3