[BUG FIX] Clamp BatchRenderer deferred RGB packing - #57
Merged
duburcqa merged 2 commits intoJul 22, 2026
Merged
Conversation
NoahLinckeScout
force-pushed
the
noah-batch-rgb-pack-clamp
branch
from
July 15, 2026 17:09
2be683f to
1cbba54
Compare
NoahLinckeScout
force-pushed
the
noah-batch-rgb-pack-clamp
branch
from
July 15, 2026 18:39
1cbba54 to
404b863
Compare
duburcqa
approved these changes
Jul 22, 2026
duburcqa
marked this pull request as ready for review
July 22, 2026 11:52
Match the alpha-shift convention already used by the sibling pack helpers (draw_deferred_depth.hlsl, post_process.hlsl). `255 << 24` is a signed-int left shift into the sign bit; the explicit `(uint32_t)255` keeps the shift well-defined and consistent. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
duburcqa
force-pushed
the
noah-batch-rgb-pack-clamp
branch
from
July 22, 2026 16:15
493e527 to
413280a
Compare
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.
Why
BatchRenderer packs deferred RGB into 8-bit channels. Direct-light values above one were converted to integers before saturation, allowing high bits to spill into adjacent channels and producing cyan/blue material corruption.
What changed
[0, 1]range before byte packing.Impact / safety properties
The change preserves all in-range colors and prevents one channel from contaminating another. Values above one now saturate predictably instead of corrupting the packed pixel.
Validation
Rendered a textured tan vehicle under direct light: BatchRenderer retains the intended material without cyan/blue artifacts. Rasterizer remains correct.
Stack
This branch contains one commit on top of #56. GitHub cannot select another fork branch as this PR’s base, so it targets
main; after #56 merges, this becomes a standalone one-commit fix.Fixes #58.