Caeden117 / ChroMapper

GitHub repository for ChroMapper, the Unity-based map editor for Beat Saber.
https://cm.topc.at/dl
GNU General Public License v2.0
300 stars 87 forks source link

Optimize gradient displays #461

Closed Caeden117 closed 1 year ago

Caeden117 commented 1 year ago

Instead of creating a 256x1 texture for every single gradient, we just do gradient math on the shader. Gradients should now be much faster to initialize, and cooperate with batching as well which should further improve GPU performance.

Only tested with Chroma 2.0 gradients, vanilla transition events remain untested (however I am fairly confident they work well)

EDIT: Also untested is whether or not the GPU easing functions are accurate to the CPU easing functions. I converted the C# easing functions to shader code by hand, and I am well aware that the GPU compiles things differently. Things looked fine when eyeballing comparisons, but that's the only thing I've done.