mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
Try light trace from entity origin first
Fixes issues described at https://github.com/Novum/vkQuake/issues/550.
This commit is contained in:
parent
b26707b2ff
commit
7e4c88aed9
1 changed files with 10 additions and 7 deletions
|
@ -547,14 +547,17 @@ void R_SetupAliasLighting (entity_t *e)
|
|||
int i;
|
||||
int quantizedangle;
|
||||
float radiansangle;
|
||||
vec3_t lpos;
|
||||
|
||||
VectorCopy (e->origin, lpos);
|
||||
// start the light trace from slightly above the origin
|
||||
// this helps with models whose origin is below ground level, but are otherwise visible
|
||||
// (e.g. some of the candles in the DOTM start map, which would otherwise appear black)
|
||||
lpos[2] += e->model->maxs[2] * 0.5f;
|
||||
R_LightPoint (lpos);
|
||||
// if the initial trace is completely black, try again from above
|
||||
// this helps with models whose origin is slightly below ground level
|
||||
// (e.g. some of the candles in the DOTM start map)
|
||||
if (!R_LightPoint (e->origin))
|
||||
{
|
||||
vec3_t lpos;
|
||||
VectorCopy (e->origin, lpos);
|
||||
lpos[2] += e->model->maxs[2] * 0.5f;
|
||||
R_LightPoint (lpos);
|
||||
}
|
||||
|
||||
//add dlights
|
||||
for (i=0 ; i<MAX_DLIGHTS ; i++)
|
||||
|
|
Loading…
Reference in a new issue