Disabled directional light if its below the map.
This commit is contained in:
parent
b8538be749
commit
abca7c9f1e
@ -114,6 +114,7 @@ void main()
|
||||
// direction lighting
|
||||
if(length(directionalLightVector)>0.0f) {
|
||||
vec3 directionalVector = normalize(directionalLightVector);
|
||||
if (dot(vec3(0.0, 1.0, 0.0), directionalVector) > 0.0) {
|
||||
float directionalVisibility = 1.0f;
|
||||
if (distanceToBorder(shadowCoord1.xy) <= 0.5 && distanceToBorder(shadowCoord1.xy) > 0.2) {
|
||||
if (distanceToBorder(shadowCoord0.xy) <= 0.5 && distanceToBorder(shadowCoord0.xy) > 0.2) {
|
||||
@ -143,6 +144,7 @@ void main()
|
||||
(length(cameraVector+directionalVector)*length(normalize(vNormal)))),shininess), 0.0, 1.0)
|
||||
*specularFactor*directionalIntensity*directionalColor*directionalVisibility;
|
||||
}
|
||||
}
|
||||
|
||||
// point lights
|
||||
float visibility = 1.0;
|
||||
|
Loading…
Reference in New Issue
Block a user