Repository navigation
Conversation
This was referenced Nov 3, 2026
Open
HarnoorC
force-pushed
the
fix/enchanted-tool-rendering
branch
from
November 3, 2026 08:33
789fb67 to
87e1d7c
Compare
Contributor
Author
Fixes NVIDIAGameWorks#84. Enchanted tools held in first person drift as the camera turns. Vanilla's glint unions can flatten item poses before capture, and the projected-glint wrapper used by compasses and clocks emits fully posed vertices, so correcting only captured bones misses that geometry. Once the tool holds still, `main`'s glint shows as purple artifacts around it: glint is an opaque cutout shell 0.0005 blocks out from the item, and the 0.1 view-model scale shrinks that gap tenfold. Apply camera/FOV correction and the view-model scale once at the common capture root. Preserve local meshes and hand-owned transforms through vanilla's unions and sprite wrappers, and keep projected-glint UVs written after the normal. Streamed and projected parts use transient meshes, and block-breaking cracks keep a block-local pose. Wrapper dispatch stays typed and allocation-free. Draw glint with the runtime's color-additive emissive blend instead of as a cutout. Layers keep `main`'s request-order identity and shell depth, except glint: vanilla requests it before its substrate, so it sits one shell past the deepest non-glint shell, banner patterns included. Layer and text spacing are compensated for the view-model scale. Vanilla's two glint textures scroll at vanilla's phase and Glint Speed through the existing texture-update API, at intensity 300 so the band stays visible in daylight, and Glint Strength scales them. The hidden first-person body, which only secondary rays see, draws its items without glint, so its emission does not light the scene around the player. No native signature or runtime pin changes. Add Fabric integration tests that run capture and submission through the production path against a counting API: camera turns with both hands, pose replay, crack reuse, instance reuse for layers vanilla rebuilds on every call, text spacing, glint and glowing-sign depth read from the built mesh vertices, and the hidden body drawing no glint. This covers first person only. In third person, a held tool's glint still covers the item's whole square card instead of just its opaque texels. That is left for a follow-up. Validation: - `gradlew.bat check`: 813 JVM tests and 67 Fabric integration tests, no failures or skips. - `tools\rtx.bat check --tests` with the commit-message scan over this branch: 1,162 tests and 178 subtests. - In game on `7f01dd0`, which renders like this change apart from the hidden body's glint: an enchanted golden pickaxe held in first person at night shows its glint with no purple artifacts around it. That build's hidden-body glint lit nearby cobblestone purple; the hidden body's change is not yet rechecked in game. - Not yet checked in game: enchanted tools in both hands while turning, a held compass and cracks at FOV 30, 70 and 110, patterned shields, glowing signs, charged creepers and breeze wind. Signed-off-by: Harnoor Chima <harnoorchima1@gmail.com>
HarnoorC
force-pushed
the
fix/enchanted-tool-rendering
branch
from
November 3, 2026 08:55
87e1d7c to
408bdee
Compare
HarnoorC
marked this pull request as ready for review
November 3, 2026 09:18
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 #65 (also reported as #84).
Enchanted tools held in first person drift as the camera turns. Vanilla's glint unions can flatten item poses before capture, and the projected-glint wrapper used by compasses and clocks emits fully posed vertices, so correcting only captured bones misses that geometry. Once the tool holds still,
main's glint shows as purple artifacts around it: glint is an opaque cutout shell 0.0005 blocks out from the item, and the 0.1 view-model scale shrinks that gap tenfold.Apply camera/FOV correction and the view-model scale once at the common capture root. Preserve local meshes and hand-owned transforms through vanilla's unions and sprite wrappers, and keep projected-glint UVs written after the normal. Streamed and projected parts use transient meshes, and block-breaking cracks keep a block-local pose. Wrapper dispatch stays typed and allocation-free.
Draw glint with the runtime's color-additive emissive blend instead of as a cutout. Layers keep
main's request-order identity and shell depth, except glint: vanilla requests it before its substrate, so it sits one shell past the deepest non-glint shell, banner patterns included. Layer and text spacing are compensated for the view-model scale. Vanilla's two glint textures scroll at vanilla's phase and Glint Speed through the existing texture-update API, at intensity 300 so the band stays visible in daylight, and Glint Strength scales them. The hidden first-person body, which only secondary rays see, draws its items without glint, so its emission does not light the scene around the player. No native signature or runtime pin changes.Add Fabric integration tests that run capture and submission through the production path against a counting API: camera turns with both hands, pose replay, crack reuse, instance reuse for layers vanilla rebuilds on every call, text spacing, glint and glowing-sign depth read from the built mesh vertices, and the hidden body drawing no glint.
This PR covers first person only. In third person, a held tool's glint still covers the item's whole square card instead of just its opaque texels (screenshot in the comments). That is left for a follow-up.
Validation on
408bdee:gradlew.bat check: 813 JVM tests and 67 Fabric integration tests, no failures or skips.tools\rtx.bat check --testswith the commit-message scan over this branch: 1,162 tests and 178 subtests.mainagainst this PR's head (408bdee), from the same position at night (before and after screenshots in the comments): onmainthe enchanted golden pickaxe held in first person is out of place and sits on a purple rectangle. On this head it stays in its corner and shows its glint with no purple artifacts around it, and nearby stone is not lit purple. When moving around, the tool no longer drifts as described in First-person held item is placed in world space and drifts with camera direction #84.Signed-off-by: Harnoor Chima harnoorchima1@gmail.com