mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
and fixing a bug with shadowing of lightmapped surface
This commit is contained in:
parent
74f0d98fd6
commit
c7eeebe52c
2 changed files with 4 additions and 2 deletions
|
@ -18,7 +18,7 @@ var stageOrientation = Quat.fromPitchYawRollDegrees(0.0, 180.0, 0.0);
|
|||
Scene.setStageDayTime(hour);
|
||||
Scene.setStageOrientation(stageOrientation);
|
||||
Scene.setStageLocation(longitude, latitude, 0.0);
|
||||
|
||||
/*
|
||||
function ticktack() {
|
||||
hour += 0.1;
|
||||
//Scene.setSunIntensity(Math.cos(time));
|
||||
|
@ -31,3 +31,4 @@ function ticktack() {
|
|||
}
|
||||
|
||||
Script.setInterval(ticktack, 41);
|
||||
*/
|
|
@ -95,7 +95,8 @@ vec3 evalAmbienSphereGlobalColor(float shadowAttenuation, vec3 position, vec3 no
|
|||
vec3 evalLightmappedColor(float shadowAttenuation, vec3 normal, vec3 diffuse, vec3 lightmap) {
|
||||
|
||||
Light light = getLight();
|
||||
float diffuseDot = dot(normal, getLightDirection(light));
|
||||
vec3 fragNormal = vec3(invViewMat * vec4(normal, 0.0));
|
||||
float diffuseDot = dot(fragNormal, -getLightDirection(light));
|
||||
|
||||
// need to catch normals perpendicular to the projection plane hence the magic number for the threshold
|
||||
// it should be just 0, but we have innacurracy so we need to overshoot
|
||||
|
|
Loading…
Reference in a new issue