Skip to content

Align ray-casting tutorial lighting on HiDPI displays - #3004

Open
kuldeepsisodiya wants to merge 1 commit into
pythonarcade:developmentfrom
kuldeepsisodiya:fix/raycasting-hidpi
Open

kuldeepsisodiya wants to merge 1 commit into
pythonarcade:developmentfrom
kuldeepsisodiya:fix/raycasting-hidpi

Conversation

@kuldeepsisodiya

Copy link
Copy Markdown

Summary

Keep the ray-casting tutorial's light centered on the player when the framebuffer is larger than the logical window. Each draw passes the framebuffer size to Shadertoy. The shaders use that size to normalize fragment coordinates, then use the scene texture size to measure distance in the same logical units as the player and light radius.

The resizable steps also resize both scene textures with the logical window. The tutorial explains the two coordinate systems.

Closes #2997.

Testing

  • OpenGL pixel regression on macOS at 1×, 1.5×, and 2× scaling. The two scaled cases failed on d3c9626 and pass with the fix. The resize tests for steps 7 and 8 also pass.
  • Tutorial suite completed with 74 passed and 1 skipped.
  • The combined unit and tutorial run with the locked pytest version had 1,730 passed, 1 skipped, and 9 failures. All nine also failed on unchanged d3c9626 under the same setup.
  • Ruff passed on the new regression file. git diff --check passed.

This branch has not been deployed

No deployments
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.

Ray-casting Shadows Tutorial light can be miss-aligned if framebuffer size is larger than the window size

1 participant