diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-10-01 19:08:49 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-10-01 19:08:49 -0300 |
commit | c9a925c4e0e226b168f05b1d54b1050437869b5e (patch) | |
tree | 44442c56339486e62aa2a39893f7f1d088fd92a5 /drivers | |
parent | d10e5eabedcdbcbb3b2854ed27b50b756a771b73 (diff) |
Switched Burley/Lambert, and restored diffuse term to 0-1 range for compatibility.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles3/shaders/scene.glsl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 4d32d5ec13..715237281f 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -932,7 +932,8 @@ 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 = dotNL * (A + vec3(B) * s / t) / M_PI; +// light_amount = dotNL * (A + vec3(B) * s / t) / M_PI; + light_amount = dotNL * (A + vec3(B) * s / t); } #elif defined(DIFFUSE_TOON) @@ -952,7 +953,8 @@ LIGHT_SHADER_CODE float FD90 = 0.5 + 2.0 * LoH * LoH * roughness; float FdV = 1.0 + (FD90 - 1.0) * SchlickFresnel(NoV); float FdL = 1.0 + (FD90 - 1.0) * SchlickFresnel(NoL); - light_amount = ( (1.0 / M_PI) * FdV * FdL ) * NoL; + //light_amount = ( (1.0 / M_PI) * FdV * FdL ) * NoL; + light_amount = ( FdV * FdL ) * NoL; /* float energyBias = mix(roughness, 0.0, 0.5); float energyFactor = mix(roughness, 1.0, 1.0 / 1.51); @@ -965,7 +967,8 @@ LIGHT_SHADER_CODE } #else //lambert - light_amount = dotNL / M_PI; +// light_amount = dotNL / M_PI; + light_amount = dotNL; #endif #if defined(TRANSMISSION_USED) |