summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFerenc Arn <tagcup@yahoo.com>2017-09-29 09:03:37 -0400
committerFerenc Arn <tagcup@yahoo.com>2017-09-29 09:47:06 -0400
commit33c600fedc7417b2c9d2919332c236c7c5a58609 (patch)
tree9a87d9d02dadc9b08d87adff55f5cfc0256280dd /drivers
parent2c5fa0947d724c0dcb24643f692f7a9d686a5490 (diff)
Ensure that Lambert is energy conserving.
Also remove the diffuse_color factor in Oren-Nayar (which was already taken care of below, oops).
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/shaders/scene.glsl4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index 5c7cfecf3e..e4eeab5f58 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -932,7 +932,7 @@ LIGHT_SHADER_CODE
vec3 A = 1.0 + sigma2 * (- 0.5 / (sigma2 + 0.33) + 0.17*diffuse_color / (sigma2 + 0.13) );
float B = 0.45 * sigma2 / (sigma2 + 0.09);
- light_amount = diffuse_color * dotNL * (A + vec3(B) * s / t) / M_PI;
+ light_amount = dotNL * (A + vec3(B) * s / t) / M_PI;
}
#elif defined(DIFFUSE_TOON)
@@ -965,7 +965,7 @@ LIGHT_SHADER_CODE
}
#else
//lambert
- light_amount = dotNL;
+ light_amount = dotNL / M_PI;
#endif
#if defined(TRANSMISSION_USED)