[PR #17104] AtlasEngine: Fix custom shader time imprecision #31113

Open
opened 2026-01-31 09:45:12 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/17104

State: closed
Merged: Yes


Since floats are imprecise we need to constrain the time value into a
range that can be accurately represented. Assuming a monitor refresh
rate of 1000 Hz, we can still easily represent 1000 seconds accurately
(roughly 16 minutes). So to solve this, we'll simply treat the shader
time modulo 1000s. This may lead to some unexpected jank every 16min
but it keeps any ongoing animation smooth otherwise.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/17104 **State:** closed **Merged:** Yes --- Since floats are imprecise we need to constrain the time value into a range that can be accurately represented. Assuming a monitor refresh rate of 1000 Hz, we can still easily represent 1000 seconds accurately (roughly 16 minutes). So to solve this, we'll simply treat the shader time modulo 1000s. This may lead to some unexpected jank every 16min but it keeps any ongoing animation smooth otherwise.
claunia added the pull-request label 2026-01-31 09:45:12 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#31113