diff --git a/Shaders/ShaderGen/SG_LIGHTING.GLSL b/Shaders/ShaderGen/SG_LIGHTING.GLSL index fdb25ea958ddb8c1cb06309be872fceea3ce5ce4..ba140356e05d3f9ed69ebdc5f8d8c00599605c3e 100644 --- a/Shaders/ShaderGen/SG_LIGHTING.GLSL +++ b/Shaders/ShaderGen/SG_LIGHTING.GLSL @@ -33,7 +33,7 @@ vec3 LitPointLight(vec3 vPosition, // specular vec3 h = normalize(vLightDir - vec3(0,0,-1)); // half vector between light and view direction - float hdotn = max(dot(h, vNormal), 0.0); + float hdotn = max(dot(h, vNormal), 0.001); // small epsilon to avoid undefined pow(0, 0) if shininess is also 0 cLight += (pow(hdotn, SHININESS) * cLightSpecular) * g_cSpecular; @@ -60,7 +60,7 @@ vec3 LitDirLight(vec3 vPosition, // specular vec3 h = normalize(vLightDir - vec3(0,0,-1)); // half vector between light and view direction - float hdotn = max(dot(h, vNormal), 0.0); + float hdotn = max(dot(h, vNormal), 0.001); // small epsilon to avoid undefined pow(0, 0) if shininess is also 0 cLight += (pow(hdotn, SHININESS) * cLightSpecular) * g_cSpecular; return cLight; @@ -93,7 +93,7 @@ vec3 LitSpotLight(vec3 vPosition, // specular vec3 h = normalize(vLightDir - vec3(0,0,-1)); // half vector between light and view direction - float hdotn = max(dot(h, vNormal), 0.0); + float hdotn = max(dot(h, vNormal), 0.001); // small epsilon to avoid undefined pow(0, 0) if shininess is also 0 cLight += (pow(hdotn, SHININESS) * cLightSpecular) * g_cSpecular;