summaryrefslogtreecommitdiff
path: root/drivers/gles3/shaders/scene.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles3/shaders/scene.glsl')
-rw-r--r--drivers/gles3/shaders/scene.glsl7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index a94558a58a..598bd3465e 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -1070,11 +1070,10 @@ LIGHT_SHADER_CODE
#if defined(LIGHT_USE_ANISOTROPY)
+ float alpha = roughness * roughness;
float aspect = sqrt(1.0 - anisotropy * 0.9);
- float rx = roughness / aspect;
- float ry = roughness * aspect;
- float ax = rx * rx;
- float ay = ry * ry;
+ float ax = alpha / aspect;
+ float ay = alpha * aspect;
float XdotH = dot(T, H);
float YdotH = dot(B, H);
float D = D_GGX_anisotropic(cNdotH, ax, ay, XdotH, YdotH);