Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tearing in short-lived dynamic lights at high FPS #368

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/client/effects.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,13 @@ void CL_AddDLights(void)

dl = cl_dlights;
for (i = 0; i < MAX_DLIGHTS; i++, dl++) {
if (dl->die < cl.time)
/* Vanilla Quake II had just cl.time. This worked in 1997
when computers were slow and the game reached ~30 FPS
on beefy hardware. Nowadays with 1000 FPS the dlights
are often rendered just a fraction of a frame. Work
around that by adding 32 ms, e.g. each dlight is shown
for at least 32 ms. */
if (dl->die < cl.time - 32)
continue;
V_AddLight(dl->origin, dl->radius,
dl->color[0], dl->color[1], dl->color[2]);
Expand Down