Split light sample into direct and ambient parts when using deluxemaps or per-vertex light vectors. Fixes #5813.

This commit is contained in:
James Canete 2012-12-10 22:35:57 +00:00
parent 8424865879
commit f4a0a78b43
2 changed files with 40 additions and 22 deletions

View file

@ -441,15 +441,7 @@ int R_LightDirForPoint( vec3_t point, vec3_t lightDir, vec3_t normal, world_t *w
Com_Memset(&ent, 0, sizeof(ent));
VectorCopy( point, ent.e.origin );
R_SetupEntityLightingGrid( &ent, world );
if ((DotProduct(ent.lightDir, ent.lightDir) < 0.9f) || (DotProduct(ent.lightDir, normal) < 0.1f))
{
VectorCopy(normal, lightDir);
}
else
{
VectorCopy(ent.lightDir, lightDir);
}
VectorCopy(ent.lightDir, lightDir);
return qtrue;
}