fix culling orientation, fabric feature renderer face filtering, sprite bounds check, and multithreading crashes - #468
Open
Spagles wants to merge 6 commits into
Open
fix culling orientation, fabric feature renderer face filtering, sprite bounds check, and multithreading crashes#468Spagles wants to merge 6 commits into
Spagles wants to merge 6 commits into
Conversation
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.
Fixed adjacent wall face orientation in painting back-face culling (
CullingUtils#shouldCullPaintingBack):moreculling$getFaceCullingShape(oppositeDir)to queryoppositeDir.getOpposite().posBehind = paintingPos.relative(oppositeDir). The face of that wall block that abuts the painting is its opposite face (oppositeDir.getOpposite()), pointing back towards the painting. QueryingoppositeDirevaluated the far side of the wall block rather than the contact surface, leading to incorrect occlusion tests and visual artifacts when paintings were placed against directional or non-solid blocks.Restored face culling filtering in the Fabric block model feature renderer (
MorecullingFabricBlockModelFeatureRenderer):submittoputPartQuadsand guarded quad additions withsubmit.shouldCull(direction)andsubmit.shouldCull(quad.direction()).putPartQuadspreviously iterated over all model part quads and submitted them unconditionally. This bypassed directional face culling rules defined by submit types likeBlockModelSubmitWithoutFaceorBlockModelSubmitForFace, rendering all faces and defeating optimizations.Forwarded quad bounds in sprite transparency checks (
TextureAtlasSprite_opacityMixin):moreculling$hasTransparency(QuadBounds bounds)to passboundstoSpriteUtils.doesHaveTransparency(...).QuadBoundsargument and evaluated the entire sprite image. This caused quads whose specific UV region was completely opaque to be falsely identified as transparent if any other unrelated area of the texture atlas contained transparent pixels.Added null check for
bakedModelManagerduring cache resets (CacheUtils#resetAllCache):if (bakedModelManager != null)guard.bakedModelManageris populated during client setup. If a resource reload event fires before the model manager field is captured, callingbakedModelManager.getBlockStateModelSet()threw an unhandledNullPointerExceptionthat crashed the client during startup.Eradicated shared mutable state in platform helper singletons (
FabricPlatformHelper&NeoForgePlatformHelper):partscollection field and allocated the list locally insidegetQuads().Services.PLATFORM. In multi-threaded rendering pipelines where chunk baking and model translucency caching occur across multiple worker threads simultaneously, sharing and clearing a single mutable list instance caused data races, missing quads, andConcurrentModificationExceptioncrashes.