-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port FRAPI to 1.21.4 and refactor #4247
Merged
Merged
Conversation
This file contains 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
- Port to 1.21.4 - Change `glint` material property type from `TriState` to new `GlintMode` enum, due to addition of vanilla `ItemRenderState.Glint` enum - Remove `ItemStack` and `ModelTransformationMode` parameters from `emitItemQuads` to preserve contract of `ItemRenderState` - Apply refactors and breaking changes - Move `hasTransform`, `pushTransform`, and `popTransform` from `RenderContext` to `QuadEmitter` to make the system more flexible and allowing mesh builder emitters to also have transforms - Remove `RenderContext` and inline remaining parameters to `emit*` methods; allows outputting model to arbitrary emitter and invoking model from arbitrary location - Remove `RendererAccess` and add static `Renderer#get` and `#register` instead - Disallow `Renderer` retrieval from returning a null value - Change `QuadView#faceNormal` to return a `Vector3fc` instead of a `Vector3f` - Remove deprecated methods - Change `MeshImpl` to use a static cursor pool to save on memory and to allow nesting access to cursor on a thread - Remove "compatibility mode" from Indigo
This allows a model to control which quads a submodel can cull early irrespective of transforms. Forwarding the test to the submodel will make it so pushed transforms may not receive quads that will be culled. The previous behavior of pushing a transform disabling early culling can now be achieved by passing `face -> false` to the submodel.
- Remove disableColorIndex material property - Rename colorIndex methods to tintIndex in QuadView and MutableQuadView to match recent Yarn rename - Remove ForwardingBakedModel and WrapperBakedModel - Vanilla's new WrapperBakedModel is similar enough to ForwardingBakedModel - WrapperBakedModel will be moved to Model Loading API v1 in a different PR - Set default vertex color to 0xFFFFFFFF instead of 0 - Disallow MutableQuadView#material from accepting a null material - Precompute default quad data buffer instead of using zeroed buffer and setting defaults every time
PepperCode1
added
indigo
Pull requests and issues related to Indigo's implementation of the rendering api
port
Porting existing code to a different version
priority:high
High priority PRs that need review and work now. Review these first.
labels
Nov 27, 2024
- Effectively split MeshBuilder#build into MutableMesh#immutableCopy and #clear - Effectively add MutableMesh#forEachMutable - Add Mesh#size - Remove QuadEmitter#hasTransform - Optimize MutableQuadViewImpl#copyFrom by not precomputing geometry - Give UnwrappableBakedModel#unwrap a default implementation to prevent issues with interface injection - Finish porting FRAPI and Model Loading API testmods
modmuss50
approved these changes
Dec 2, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
indigo
Pull requests and issues related to Indigo's implementation of the rendering api
port
Porting existing code to a different version
priority:high
High priority PRs that need review and work now. Review these first.
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.
glint
material property type fromTriState
to newGlintMode
enum, due to addition of vanillaItemRenderState.Glint
enumItemStack
andModelTransformationMode
parameters fromemitItemQuads
to preserve contract ofItemRenderState
FabricBakedModel
methods on vanilla'sWrapperBakedModel
hasTransform
,pushTransform
, andpopTransform
fromRenderContext
toQuadEmitter
to make the system more flexible and allow mesh builder emitters to also have transformsRenderContext
and inline remaining parameters toemit*
methods; allows outputting model to arbitrary emitter, invoking model from arbitrary location, and having better control over early cullingMeshBuilder
toMutableMesh
, which has more functionality necessary for advanced use casesMesh#size
RendererAccess
and add staticRenderer#get
and#register
insteadRenderer
retrieval from returning a null valueQuadEmitter#hasTransform
as it is no longer necessary for its original purposedisableColorIndex
material propertycolorIndex
methods totintIndex
inQuadView
andMutableQuadView
to match FabricMC/yarn@6d2cb31QuadView#faceNormal
to return aVector3fc
instead of aVector3f
ForwardingBakedModel
as it is similar enough to vanilla's newWrapperBakedModel
WrapperBakedModel
as it was moved to Model Loading API v1 in Update Model Loading API to 1.21.4 #4243MeshImpl
to use a static cursor pool to save on memory and to allow nesting access to cursor on a threadMutableQuadViewImpl#material
from accepting a null material (in the API, the material parameter was already not nullable)MutableQuadViewImpl#clear
MutableQuadViewImpl#copyFrom
by not precomputing geometryTODO
QuadTransform
s to say that they do not need to receive quads that will be culled in one way or another - "post-cull transforms". Utilizing this functionality in a custom model can significantly improve performance in some cases. [May require a breaking change]Resolution: Update documentation to make it clear that
emitter.hasTransforms()
does not need to be checked to perform early culling.MutableMesh
/QuadBuffer
which automatically grows and serves like aList<MutableQuadView>
. This can make models that need to analyze submodels or perform 1:N transforms on submodels significantly more efficient, and make it easier to create such models. [May require a breaking change]Resolution:
MeshBuilder
was converted toMutableMesh
with the necessary new methods.WrapperBakedModel
andForwaringBakedModel
now that vanilla added its ownWrapperBakedModel
, which is very similar toForwardingBakedModel
. [May require a breaking change]Resolution: Remove
ForwardingBakedModel
and moveWrapperBakedModel
to Model Loading API with some changes.ModelTransformationMode
parameter toemitItemQuads
since it is an enum value and is passed toItemRenderer#renderItem
(where Indigo hooks into item rendering) anyway. [May require a breaking change]Resolution: Not re-added.
QuadEmitter#hasTransform
now that its initial purpose has been replaced by thecullTest
parameter. [May require a breaking change]Resolution: Removed. Can be re-added later without a user-facing breaking change if necessary.
MutableQuadView#clear
as public API.Resolution: Not exposed. Can be exposed later without a user-facing breaking change if necessary.