Merge branch 'master' of github.com:Faerbit/swp
This commit is contained in:
commit
1a0d671614
@ -29,7 +29,7 @@ function trigger(objectToChange)
|
|||||||
local yPos = 25.0
|
local yPos = 25.0
|
||||||
local zPos = 54.5
|
local zPos = 54.5
|
||||||
level:preloadLightPosition(xPos, yPos, zPos)
|
level:preloadLightPosition(xPos, yPos, zPos)
|
||||||
level:addLightByParameters(0.2, 0.9, 0.0, 4.0, -2.5, 1.3, 2.3)
|
level:addLightByParameters(0.2, 0.9, 0.0, 4.0, -2.0, 1.3, 2.0)
|
||||||
print("openSecondDoor1")
|
print("openSecondDoor1")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -29,7 +29,7 @@ function trigger(objectToChange)
|
|||||||
local yPos = 25.0
|
local yPos = 25.0
|
||||||
local zPos = 26.5
|
local zPos = 26.5
|
||||||
level:preloadLightPosition(xPos, yPos, zPos)
|
level:preloadLightPosition(xPos, yPos, zPos)
|
||||||
level:addLightByParameters(0.2, 0.9, 0.0, 4.0, -2.5, 1.3, 2.3)
|
level:addLightByParameters(0.2, 0.9, 0.0, 4.0, -2.0, 1.3, 2.0)
|
||||||
print("openSecondDoor2")
|
print("openSecondDoor2")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -29,7 +29,7 @@ function trigger(objectToChange)
|
|||||||
local yPos = 25.0
|
local yPos = 25.0
|
||||||
local zPos = 26.5
|
local zPos = 26.5
|
||||||
level:preloadLightPosition(xPos, yPos, zPos)
|
level:preloadLightPosition(xPos, yPos, zPos)
|
||||||
level:addLightByParameters(0.2, 0.9, 0.0, 4.0, -2.5, 1.3, 2.3)
|
level:addLightByParameters(0.2, 0.9, 0.0, 4.0, -2.0, 1.3, 2.0)
|
||||||
print("openSecondDoor3")
|
print("openSecondDoor3")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -38,7 +38,7 @@ function trigger(objectToChange)
|
|||||||
local yPos = 25.0
|
local yPos = 25.0
|
||||||
local zPos = 54.5
|
local zPos = 54.5
|
||||||
level:preloadLightPosition(xPos, yPos, zPos)
|
level:preloadLightPosition(xPos, yPos, zPos)
|
||||||
level:addLightByParameters(0.2, 0.9, 0.0, 4.0, -2.5, 1.3, 2.3)
|
level:addLightByParameters(0.2, 0.9, 0.0, 4.0, -2.0, 1.3, 2.0)
|
||||||
print("openSecondDoor4")
|
print("openSecondDoor4")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -132,8 +132,8 @@ float samplePointShadow(samplerCubeShadow shadowMap, vec3 lightDirection) {
|
|||||||
float A = -(farPlane+nearPlane)/(farPlane-nearPlane);
|
float A = -(farPlane+nearPlane)/(farPlane-nearPlane);
|
||||||
float B = -2*(farPlane*nearPlane)/(farPlane - nearPlane);
|
float B = -2*(farPlane*nearPlane)/(farPlane - nearPlane);
|
||||||
float compValue = 0.5*(-A*length(lightDirection) + B)/length(lightDirection) + 0.5;
|
float compValue = 0.5*(-A*length(lightDirection) + B)/length(lightDirection) + 0.5;
|
||||||
float bias = 0.001*tan(acos(clamp(dot(vNormal, -directionalLightVector), 0.0, 1.0)));
|
float bias = 0.001*tan(acos(clamp(dot(vNormal, lightDirection), 0.0, 1.0)));
|
||||||
bias = clamp(bias, 0.0, 0.01);
|
bias = clamp(bias, 0.0, 0.001);
|
||||||
return texture(shadowMap, vec4(lightDirection , compValue - bias));
|
return texture(shadowMap, vec4(lightDirection , compValue - bias));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user