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