Repository navigation
Optimise Minecart rendering - #350
Open
Agakitsune wants to merge 1 commit into
Open
Agakitsune wants to merge 1 commit into
Agakitsune wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Optimise all Minecart entities (normal, furnace, tnt, hopper, command block, spawner)
Since all Minecart entities share the same model, it is possible to have different entities to share the same instance of the minecart model.
Also since the sides of the minecart are the same mesh with different transforms, it's possible to, instead of drawing the 4 sides independently, draw the 4 side with 1 draw call, hence with both optimisations, it's possible to draw every Minecart types in 2 draw calls instead of 30 (5 per entity type by default)
For example:

We have 4 entity types, so 20 draw calls
By using the same model for all Minecart types, it's possible to cut the number to 5 draw call
And using instacing to draw the 4 sides, we can draw everything in 2 draw call