We call Crop() 478 times in initialize on SS13, at the most conservative configuration. This costs 3 seconds+ on my i7-9700k. We are calling Crop() this much for a character menu--we are putting hair on a mock character, scaling it up, then cropping it, so that it only shows the head, and we're showing you all of them so you can visually see the potential hairstyles you can choose.
We do not want to cache the output of this or do any other tricks because the current system lets artists simply make the hair they want to make, and everything else will magically work without any possibility of going wrong.
We also cannot use CSS tricks to do the cropping on the client side. We have to combine all these into a spritesheet for maximum efficiency, but you cannot zoom in on pieces of a spritesheet without also losing nearest neighbor interpolation (even with -ms-interpolate-mode).
The new \ref stuff is cool, but will ultimately end up being much more complex code than what we are doing now. It would be great to use for a lot of our UI, but our character creation UI is simply too complex.
Currently to fix this, we are thinking of several hacky options like having a pre-compile step that pre-crops everything. I would like to not feel the need to do this. It would be great if Crop() was a lot faster.
Mar 11, 8:22 pm