From e530f49be256fe5a9369cc73113336967d4ccd03 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Thu, 2 Jan 2020 12:05:29 -0800 Subject: [PATCH] Fix Specular Blinn in vulkan --- servers/visual/rasterizer_rd/shaders/scene_forward.glsl | 4 ++-- 1 file 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 fe4e8a52a36..e4addc6fb59 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;