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

Eliminate laser wobbling at large resolutions #73

Open
nmlgc opened this issue Oct 13, 2024 · 0 comments
Open

Eliminate laser wobbling at large resolutions #73

nmlgc opened this issue Oct 13, 2024 · 0 comments
Labels
Enhancement New feature or request Graphics ~≤0.1 pushes Projected number of pushes needed. Might turn out to get more expensive!

Comments

@nmlgc
Copy link
Owner

nmlgc commented Oct 13, 2024

Diagonal lasers look really bad with geometry scaling. Like everything else in the game, their vertex coordinates are calculated as integer pixels relative to the original 640×480 resolution and SDL can then only scale these integers, not the calculation that originally produced them. As a result, they appear to jump and wobble more and more as the scaled output resolution increases:

Laser.wobble.webm
Technically, the wobbling exists with framebuffer scaling as well, but it sticks out much more when the lasers themselves are rendered at the high-res output resolution.

This wasn't part of the #4 delivery because

  1. geometry scaling is only meant to be a fallback option as it's academically inaccurate from a preservation point of view
  2. making the SDL port subpixel-accurate to the original D3D output seemed a more important goal to me, which also implied focusing on framebuffer scaling
  3. I did not want to start an 11th push

But I agree that this is a bug that should be fixed if geometry scaling finds its fans.

Requires a slight bit of care to not affect gameplay, since collision detection must continue to use the original fixed-point coordinates. If the fix should remain exclusive to geometry scaling, we wouldn't need a dedicated configuration setting to toggle it because you'd always want to have it on. Otherwise we would, though, as a non-wobbling render would no longer be subpixel-accurate.

@nmlgc nmlgc added Enhancement New feature or request Graphics ~≤0.1 pushes Projected number of pushes needed. Might turn out to get more expensive! labels Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Graphics ~≤0.1 pushes Projected number of pushes needed. Might turn out to get more expensive!
Projects
None yet
Development

No branches or pull requests

1 participant