Repository navigation
fix(node): floor the seeded render size to match three's PassNode - #89
Merged
Merged
Conversation
UpscalerNode's first configure rounded drawingBufferSize / ratio, while three's PassNode renders at Math.floor(size * (1 / ratio)). Whenever the quotient's fraction was >= .5 (about half of all canvas sizes) the upscaler reported a render size one texel larger than its real input until updateBefore re-synced, so consumers validating renderWidth/renderHeight saw a mismatch on the first frame. Seed with getPassRenderResolution (three's multiply-by-reciprocal, which also matches for custom ratios where it diverges from floor(size / ratio)) and floor in _configureUpscaler. Fixes #88 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 of 5 tasks
bpodwinski
added a commit
to bpodwinski/upscaler
that referenced
this pull request
Oct 12, 2026
Resolve import conflicts in UpscalerNode.ts and resolution.test.ts: keep the branch's .js import specifiers and add upstream's getPassRenderResolution (pmndrs#89). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #88.
UpscalerNode._configureUpscaler()rounded the seeded render size (drawingBufferSize / ratio). three'sPassNoderenders atMath.floor(size * (1 / ratio)). When the quotient's fraction was ≥ .5 (about half of all canvas sizes), the first configure reported a size one texel larger than the real input. Example: 1252×936 at Quality gave 835×624, but three renders 834×624.updateBeforere-synced later, but consumers that validaterenderWidth/renderHeighton the first frame saw the mismatch.Change
getPassRenderResolution(src/math/resolution.ts; not exported from the package) uses three's own arithmetic. For the preset ratios it gives the same result asgetRenderResolutionat every size up to 8192, which a test pins. For custom ratios it follows three, e.g.39 * (1 / 1.3)→ 29 vs39 / 1.3→ 30._inputfrom that helper, and_configureUpscalerfloors instead of rounding.TemporalGuidesNodekeepsMath.round. It only receives real (integer) texture sizes.Verification
getRenderResolutionat the preset ratios.Ship as a patch release (
fix:→autoresolves to a patch).🤖 Generated with Claude Code