diff options
author | Ptolemy <ptolemy@lindenlab.com> | 2022-08-23 02:22:03 -0700 |
---|---|---|
committer | Ptolemy <ptolemy@lindenlab.com> | 2022-08-23 02:22:03 -0700 |
commit | 5e41024b9c02176ccfe292f067fb34f0607e59d5 (patch) | |
tree | c8f8078824e498b91ac1401b135556456fd78b09 /indra/newview/app_settings/shaders/class3 | |
parent | f8974f4d783521846a985dd3d08067bd8e7f66a2 (diff) |
SL-17703: PBR: Move IOR calcF0() to deferred utils
Diffstat (limited to 'indra/newview/app_settings/shaders/class3')
-rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index ed478fad1c..9253b63ca1 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -138,6 +138,9 @@ vec3 getNorm(vec2 pos_screen); vec4 getPositionWithDepth(vec2 pos_screen, float depth); void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten, bool use_ao); +float calcF0(float ior); +void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist); + float getAmbientClamp(); vec2 getGGX( vec2 brdfPoint ); vec3 atmosFragLighting(vec3 l, vec3 additive, vec3 atten); @@ -154,18 +157,18 @@ void applyLegacyEnv(inout vec3 color, vec3 legacyenv, vec4 spec, vec3 pos, vec3 vec3 linear_to_srgb(vec3 c); vec3 srgb_to_linear(vec3 c); +// Debug Utils +vec3 BRDFDiffuse(vec3 color); +vec3 fresnelSchlick( vec3 reflect0, vec3 reflect90, float vh); +float D_GGX( float nh, float alphaRough ); +float V_GGX( float nl, float nv, float alphaRough ); + #ifdef WATER_FOG vec4 applyWaterFogView(vec3 pos, vec4 color); #endif uniform vec3 view_dir; // PBR -vec3 calcBaseReflect0(float ior) -{ - vec3 reflect0 = vec3(pow((ior - 1.0) / (ior + 1.0), 2.0)); - return reflect0; -} - void main() { vec2 tc = vary_fragcoord.xy; @@ -241,10 +244,10 @@ void main() float IOR = 1.5; // default Index Of Refraction 1.5 (dielectrics) vec3 reflect0 = vec3(0.04); // -> incidence reflectance 0.04 #if HAS_IOR - reflect0 = calcBaseReflect0(IOR); + reflect0 = vec3(calcF0(IOR)); #endif #if DEBUG_PBR_REFLECT0_BASE - vec3 debug_reflect0 = reflect0; + vec3 debug_reflect0 = vec3(calcF0(IOR)); #endif float metal = packedORM.b; |