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

Conversation

Calinou
Copy link

@Calinou Calinou commented Nov 13, 2024

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

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).

This uses the same fix as Yamagi Quake 2.
@skullernet
Copy link
Owner

Muzzleflash dynamic lights are always shown for at least 16 msec in Q2PRO, which corresponds to 60 FPS. This can be raised to 32 msec but in comparison to 16 I don't see much difference in terms of tearing. Tearing is a result of having vsync disabled, you can't avoid it without vsync. The sample video is pretty much useless here since tearing can only be seen on your monitor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove tearing on muzzleflashes?
2 participants