Poobslag / turbofat

Block-dropping puzzle game
MIT License
57 stars 19 forks source link

Improve performance of rendering creature heads #824

Open Poobslag opened 3 years ago

Poobslag commented 3 years ago

Based on the performance investigation documented in #767, creature heads are potentially a performance bottleneck.

We could render these heads more efficiently, in a way that does not require 30 nodes per creature. At a minimum, we should at least prototype a creature with these improvements and see how what impact this could have on performance.

-create a creature which uses a conventional sprite sheet for their head
-create a very rough prototype (just a screenshot or a flat garbage sprite is fine)
-stress test this creature variant to ensure the performance gains are there
-make it look good
 -create 'screenshot' of facing forward
 -create 'screenshot' of facing away
 -blinking animation
 -eating animation
 -idle animations
 -emotes
-stress test this creature variant again to ensure the performance gains remain
Poobslag commented 3 years ago

There are many bottlenecks in rendering creatures, but their head sprites seem to not carry a very significant impact. Downgrading to priority 4.

Poobslag commented 2 years ago

A contributor "pixaeron" created a patch for v0.2820 which replaced the creature shaders with four modulated images. It introduced other problems so was never merged, but it's worth keeping in case we attempt something similar in the future.

4-image-performance-tweak.patch.txt