summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2022-08-24 16:08:36 -0700
committerPtolemy <ptolemy@lindenlab.com>2022-08-24 16:08:36 -0700
commit5b7d8b61e0720aee1ef6c7d6e44ada87ca556d54 (patch)
tree097239aa2a659432a682a6b3448a312ec994c96e
parent5a346844df747ada7468c5814c2d1cd7c5d74f60 (diff)
SL-17702: PBR: Optimize BRDF diffuse
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl
index 8ecdafa167..d1b9418ee9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl
@@ -44,6 +44,7 @@ uniform mat4 inv_proj;
uniform vec2 screen_res;
const float M_PI = 3.14159265;
+const float ONE_OVER_PI = 0.3183098861;
vec3 srgb_to_linear(vec3 cs);
@@ -442,7 +443,7 @@ void initMaterial( vec3 diffuse, vec3 packedORM, out float alphaRough, out vec3
vec3 BRDFDiffuse(vec3 color)
{
- return color / M_PI;
+ return color * ONE_OVER_PI;
}
vec3 BRDFLambertian( vec3 reflect0, vec3 reflect90, vec3 c_diff, float specWeight, float vh )