light: fix sunlight + phong shading

This commit is contained in:
Eric Wasylishen 2016-03-05 23:56:28 -07:00
parent d2f1eb2b2b
commit 34858ed243
1 changed files with 5 additions and 3 deletions

View File

@ -1270,11 +1270,13 @@ LightFace_Sky(const sun_t *sun, const lightsurf_t *lightsurf, lightmap_t *lightm
surfnorm = lightsurf->normals[0];
for (i = 0; i < lightsurf->numpoints; i++, sample++, surfpoint += 3, surfnorm += 3) {
vec_t value;
if (!TestSky(surfpoint, sun->sunvec, shadowself))
continue;
angle = DotProduct(incoming, surfnorm);
if (angle < 0) angle = 0;
if (angle < 0)
continue;
if (!TestSky(surfpoint, sun->sunvec, shadowself))
continue;
angle = (1.0 - sun->anglescale) + sun->anglescale * angle;
value = angle * sun->sunlight.light;