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

Cache icon renders between frames #1825

Merged
merged 8 commits into from
Jun 5, 2024

Conversation

wixoaGit
Copy link
Member

@wixoaGit wixoaGit commented Jun 2, 2024

The texture for an atom is now only re-rendered once its appearance or animation frame changes. This same texture is reused between frames instead of performing the entire render process again. This leads to massive improvements in client performance, in both render times and allocation rate.

Observing this same spot on Paradise brought allocations per frame down ~350KB (~20.5MB per second at 60FPS!). FPS is more difficult to get a hard number for, but this brought it much closer to a stable 60FPS on my laptop's integrated graphics.

Before:
image
After:
image

Did a lot of playing around with things that led to some dirty code, so I'd like to clean things up some before merging. There are also some minor bugs (there are so many magic numbers & steps in the renderer) and I need to test how this plays with animate(). All looks good.

@boring-cyborg boring-cyborg bot added the Client Involves the OpenDream client label Jun 2, 2024
@github-actions github-actions bot added the size/L label Jun 2, 2024
@wixoaGit wixoaGit merged commit 0644395 into OpenDreamProject:master Jun 5, 2024
8 of 9 checks passed
@wixoaGit wixoaGit deleted the cache_icon_renders branch June 5, 2024 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client Involves the OpenDream client size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant