summaryrefslogtreecommitdiff
path: root/drivers/gles3/shaders/scene.glsl
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-09-27 15:34:38 +0200
committerGitHub <noreply@github.com>2017-09-27 15:34:38 +0200
commitbad5dd37b087c3ba0acc9fd29b6de8ddde1b5a64 (patch)
tree770460880975ec7ce7ffba88e335b61b7c8fa05c /drivers/gles3/shaders/scene.glsl
parentd5cccf26a99e5eb3c04efb953ce76e58fa2d524f (diff)
parentae78413bb1a8375ddd376ad450ed2517c4077789 (diff)
Merge pull request #11624 from tagcup/burley_pow
Avoid pow in Burley diffuse.
Diffstat (limited to 'drivers/gles3/shaders/scene.glsl')
-rw-r--r--drivers/gles3/shaders/scene.glsl8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index 25115bc18a..7692a0932a 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -941,12 +941,12 @@ LIGHT_SHADER_CODE
vec3 H = normalize(V + L);
float NoL = max(0.0,dot(N, L));
- float VoH = max(0.0,dot(L, H));
+ float LoH = max(0.0,dot(L, H));
float NoV = max(0.0,dot(N, V));
- float FD90 = 0.5 + 2.0 * VoH * VoH * roughness;
- float FdV = 1.0 + (FD90 - 1.0) * pow( 1.0 - NoV, 5.0 );
- float FdL = 1.0 + (FD90 - 1.0) * pow( 1.0 - NoL, 5.0 );
+ 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 );
/*
float energyBias = mix(roughness, 0.0, 0.5);