From 66987d687879017affb787b4a3ffb1ef11880336 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 2 Oct 2017 09:09:22 -0300 Subject: [PATCH] missing PI division on vertex shader --- drivers/gles3/shaders/scene.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 26395da294a..41d5ef5bc92 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1,5 +1,6 @@ [vertex] +#define M_PI 3.14159265359 /* from VisualServer: @@ -166,7 +167,7 @@ out vec4 specular_light_interp; void light_compute(vec3 N, vec3 L,vec3 V, vec3 light_color,float roughness,inout vec3 diffuse, inout vec3 specular) { float dotNL = max(dot(N,L), 0.0 ); - diffuse += dotNL * light_color; + diffuse += dotNL * light_color / M_PI; if (roughness > 0.0) {