Skip to content
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

Preserving BakedModel and switching to ItemRenderer.render instead of ItemRenderer.renderStatic #6674

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

drouarb
Copy link
Contributor

@drouarb drouarb commented Jul 9, 2024

The current implementation of renderItems calls get the BakedModel to check for isGui3d() then call renderStatic multiple times for the stack. ItemRenderer.renderStatic fetch the BakedModel and call ItemRenderer.render. Saving the BakedModel when used, allows us to call ItemRenderer.render() directly without fetching the baked model up to 4 times and saves CPU usage.
On a big factory with a lot of items, this allowed me to go from ~25fps to ~35fps

@IThundxr IThundxr added pr type: feature PR adds a new feature or changes an existing feature area: rendering Issue or PR is related to rendering labels Jul 9, 2024
@drouarb drouarb mentioned this pull request Jul 10, 2024
@simibubi simibubi merged commit 4f6ab55 into Creators-of-Create:mc1.18/dev Jul 15, 2024
@simibubi
Copy link
Collaborator

Thank you very much 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: rendering Issue or PR is related to rendering pr type: feature PR adds a new feature or changes an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants