ViewportFrame performance issues for displaying items

Hello, so I just recently noticed my screen animation hitches when there are a larger number of viewport frame item displays on screen. This is really unfortunate, the geometry shouldn’t even be that complex that’s in the viewport frame, they’re just standard character limb meshes to display shirts or whatnot. There’s also at most 24 per page, which isn’t a lot really.

It would be extremely time consuming to bake individual images and use those instead, not really sure what I can physically improve to the codebase to smoothen the screen animation when the screen holds a full page of items.

My assumption would be that scaling a ViewportFrame is more expensive than meets the eye. If that’s the case, introducing almost like a ‘baked’ mode for the viewport frame would be really good. So you could basically have just a static render at runtime rather than having to dynamically update what’s inside the viewport frame (which I’m guessing is sort of what the current situation is)

Appreciate any assistance. Clip is below. Thanks. It might appear fine, but there’s definitely noticeable FPS drops during the animation.

1 Like

We’ve filled a ticket into our internal database for this issue, and will come back with an update as soon as we have news!

Thanks for the report!

2 Likes

I appreciate it a lot. Does not appear to be causing any FPS loss when the animation finishes, only when the frame’s scale is changing.

I have trouble with this in my game as well (character models in buttons in a custom character selector) but in my case there are many more instances involved in each frame because they’re whole character models. I’ve designed to limit the number of buttons shown per screen, and I’ve been considering trying to cache the viewport frame instances to see if that helps, but doing this with Roact sounds a bit messy so I haven’t tried yet. Will keep you posted if I do.

1 Like

Refreshing ViewportFrame is expensive, it’s just an easier way to generate item preview images. It’s not recommended to have more than one animated ViewportFrame. The perf drop is expected when you have more.

1 Like

Could there be a feature request for like a flag to change this behavior? like IsBaked?

It’s not practical to have to take a screenshot of every new item I add to the game, and then upload each image, and so on.

I don’t understand why this is expensive by design. In Unity I believe there’s a way to bake a 3D model and use that as a texture, if that could be implemented to ViewportFrames that would be fantastic.

They are baked. But resizing and visibility changes are considered event to update the baked image.

2 Likes

Fair enough.

It would be extremely useful though to at least add an additional property to disable that behavior.

For most UI animations, positional or size change is pretty typical. I had to actually go with a generic frame change instead of playing the animation for the sake of performance, and I don’t feel like uploading images of 30+ items manually.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.