From 5b7d8b61e0720aee1ef6c7d6e44ada87ca556d54 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Wed, 24 Aug 2022 16:08:36 -0700 Subject: SL-17702: PBR: Optimize BRDF diffuse --- indra/newview/app_settings/shaders/class1/deferred/deferredUtil.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders') 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 ) -- cgit v1.2.3