summaryrefslogtreecommitdiff
path: root/servers/visual/rasterizer_rd
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2020-01-02 12:05:29 -0800
committerclayjohn <claynjohn@gmail.com>2020-02-11 12:10:36 +0100
commite530f49be256fe5a9369cc73113336967d4ccd03 (patch)
tree4dc9415543e7e5af40ad339dd08753f0c8ae21f9 /servers/visual/rasterizer_rd
parent6310354cdeb9e9412a9b7e210a0cf341dabbcfda (diff)
Fix Specular Blinn in vulkan
Diffstat (limited to 'servers/visual/rasterizer_rd')
-rw-r--r--servers/visual/rasterizer_rd/shaders/scene_forward.glsl4
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/visual/rasterizer_rd/shaders/scene_forward.glsl b/servers/visual/rasterizer_rd/shaders/scene_forward.glsl
index fe4e8a52a3..e4addc6fb5 100644
--- a/servers/visual/rasterizer_rd/shaders/scene_forward.glsl
+++ b/servers/visual/rasterizer_rd/shaders/scene_forward.glsl
@@ -552,9 +552,9 @@ LIGHT_SHADER_CODE
//normalized blinn
float shininess = exp2(15.0 * (1.0 - roughness) + 1.0) * 0.25;
- float blinn = pow(cNdotH, shininess);
+ float blinn = pow(cNdotH, shininess) * cNdotL;
blinn *= (shininess + 8.0) * (1.0 / (8.0 * M_PI));
- float intensity = (blinn) / max(4.0 * cNdotV * cNdotL, 0.75);
+ float intensity = blinn;
specular_light += light_color * intensity * specular_blob_intensity * attenuation;