Fix Oculus stencil and first-person depth ordering - #731
Draft
DecoderCoder wants to merge 2 commits into
Draft
Conversation
Prevent the first scope render from recreating main depth attachments after Oculus and Distant Horizons cache them.
DecoderCoder
force-pushed
the
1.20.1-render-compat-fixes
branch
from
August 4, 2026 08:11
1bb2dc5 to
a03d39b
Compare
Register the shared gun item through Forge IMC so delayed player models cannot composite over first-person weapons.
DecoderCoder
force-pushed
the
1.20.1-render-compat-fixes
branch
from
August 10, 2026 13:56
9b77877 to
c54bc80
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.
What changed
Why
The first scoped-weapon draw previously called RenderTarget.enableStencil() in the middle of hand rendering. Forge can recreate the main color and depth attachments at that point, after Oculus and Distant Horizons have cached the old depth texture. Provisioning stencil before Oculus constructs its pipeline makes later render-time calls no-ops.
With Separate Entity Draws enabled, translucent player models are intentionally drawn after the solid hand pass. Registering the gun for Oculus's existing late hand pass prevents nearby players from compositing over the weapon and scope.
Standalone compatibility
The IMC message contains only the existing gun ResourceLocation and is sent only on the physical client. TACZ has no compile-time Oculus dependency; absent or older Oculus builds ignore it, dedicated servers are unchanged, and shaders-disabled rendering keeps the vanilla path.
Validation
Refs #519
Refs Asek3/Oculus#797