summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-09-17 14:38:07 -0500
committerDave Parks <davep@lindenlab.com>2022-09-17 14:38:07 -0500
commit13ac0f77ffe488ccdebfd28cabe8ed95d61aa684 (patch)
tree2d4fa048d191382d613da447cc41e3d117da8e77 /indra/newview/app_settings/shaders/class1
parent54e6c554c528262ed053b138c6159bc34f18d6dc (diff)
Make sure specular highlights from punctual lights don't fall off of polished surfaces
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl20
1 files changed, 3 insertions, 17 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl
index 52345e7e51..d730d92054 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl
@@ -351,23 +351,6 @@ vec3 hue_to_rgb(float hue)
// PBR Utils
-// ior Index of Refraction, normally 1.5
-// returns reflect0
-float calcF0(float ior)
-{
- float f0 = (1.0 - ior) / (1.0 + ior);
- return f0 * f0;
-}
-
-vec3 fresnel(float vh, vec3 f0, vec3 f90 )
-{
- float x = 1.0 - abs(vh);
- float x2 = x*x;
- float x5 = x2*x2*x;
- vec3 fr = f0 + (f90 - f0)*x5;
- return fr;
-}
-
vec3 fresnelSchlick( vec3 reflect0, vec3 reflect90, float vh)
{
return reflect0 + (reflect90 - reflect0) * pow(clamp(1.0 - vh, 0.0, 1.0), 5.0);
@@ -682,6 +665,9 @@ vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,
vec3 v, // surface point to camera
vec3 l) //surface point to light
{
+ // make sure specular highlights from punctual lights don't fall off of polished surfaces
+ perceptualRoughness = max(perceptualRoughness, 8.0/255.0);
+
float alphaRoughness = perceptualRoughness * perceptualRoughness;
// Compute reflectance.