I didn’t find much info about this issue specifically, but it’s hard to find the right keywords to search. Hopefully somebody can point me out in the right direction (if there is one!)
Say you have a 2d character with all its rigs and animations done. But you just realized that for that one scene you’ll need said character a little bigger, and if you scale it up in the scene it will of course lose quality. Luckily you have your original art at much higher res, so you can just scale up your PSB and paste over each layer with the hi res art. Or the other way around: maybe you notice the character PSB is unnecessary large because that character will never get up close to the camera, and you’d like to scale down the PSB for better performance/file size.
If I attempt to do this the rig will break: the sprites change size, but geometry and bones stay at the original size and won’t match the sprites anymore. There is no tool to resize the rig proportionally, and if I eyeball it by manual editing each bone and vertex of course all the resulting animations will break: bones won’t have the exact same position and initial angle as before, influences and vertices will be different.
Is there a way to do resize the whole rig to adjust it to the new sprite size, without having to basically redo the whole character and all its animations from scratch? maybe there is some 3rd party add on?
Generally, you want to make the sprites at the size they’ll be in the game, but there’s nothing wrong with changing the scale of the rig via its transform component.
You should also probably use the high-rez sprites by default, and adjust their resolution via the sprite import settings.
There’s no 3rd party addon that can resize bones/meshes, it’s not something that people generally need or want. You can resize anything with the transform component, so most people use that.
But is that good for performance though?
I bet it’s not, I have heard throught the grapevine, that it’s better to have higher resolution assets than having low resolution ones and then regretting it later, but my assets are like 10x larger than they need to be, and now that I’ve animated everything I’m faced with the same problem OP presents.
Of course it was stupid of me to make such high resolution assets, but I tried resizing them outside of unity and now nothing else works.
I’m just wondering if I’m hurting my performance a lot by using large sprites, as I get less than 90 FPS in a 2D game with just 6 characters in the scene…
then again, I’m using a laptop (Samsung Galaxy Book pro 360, intel core i7 with Iris Xe graphics, 16GB ram), so I’m not sure what kind of benchmark that is.
Anyway, if anyone has concrete info on performance with 2D sprites, it would be appreciated.
Thank you very much to both of you for your replies!
I did end up using the profiler, and found out that it was in fact the SkinMesh.LateUpdate that was sinking my performance. So I went ahead and searched for that, then I found out that, like Unrighteouss said, I should download Burst and Collection packages to be able to turn on the “Batching” option under my characters’ SkinMesh Components.
So I’m still not sure if my super high resolution sprites (3200x2400) are hurting my performance, but now instead of 60-90FPS, I’m getting closer to 120-140FPS with the same scene.
I still wanna try to find if it has an effect, but the resizing would take so much work, that I’m dreading it haha.
Glad you figured it out, ~120 FPS is around what I get when using 2D bones with burst/collections, so I think you’re okay. It’s obviously going to depend on your machine, and the final build is going to run better than in the editor.
Keep in mind that having a scene view and game view open simultaneously is also going to lower FPS in editor. Optimizing your rigs to have less weighted vertices is also going to help with performance.
If each sprite you’re using is 3200x2400, that does sound excessive. I use 4096x4096 sprite sheets, and I haven’t had any issues, but everything has limits. I don’t know exactly how Unity works under the hood, but lowering the max resolution of the sprites in their inspector should be fine; in that case, I’m pretty sure Unity builds them at that resolution and isn’t referencing the high-res source file (probably).
This thread is a bit late, but I actually just had the same problematic.
On my side I was more targeting memory rather than CPU optimization.
Indeed, couldn’t find a way to scale down PSB without breaking everything.
The workaround I found was to select the PSB file in the editor, and in the inspector to reduce the “max size” parameter (see screenshot). By default it’s at 2048 which might be too much in some cases. There isn’t much granularity (only powers of 2), sometimes I reduced it to 1024 and it was already too blurred, but sometimes it might do the trick !
Thanks! not late at all In fact I followed the other users’ suggestions and kept all the assets at full res in my subsequent scenes, so I’m still in time to apply yours. This seems easy and straightforward enough to allow some testing. thanks a lot!