Fix tearing in short-lived dynamic lights at high FPS #368
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The tearing occurred because the dynamic light was shown for a single frame, but when running above the monitor refresh rate, less than a single frame was actually visible on screen. Even when V-Sync was used, the dynamic light was visible for a very small portion of time on screen depending on the monitor refresh rate.
The fix works by ensuring each dynamic light is visible for at least 32 milliseconds, which roughly matches the appearance of dynamic lights as they were in vanilla Quake 2 on period-appropriate hardware (running at 30-35 FPS).
Moving dynamic lights (e.g. from rockets) are not impacted by this change - they still move as smoothly as before.
This uses the same fix as Yamagi Quake 2.
Preview
Game is running at 1,000 FPS (60 FPS video):
q2pro_dynamic_light.mp4