Would it be wise to include a lot of viewport frames in my game?

Hello, I was wondering if viewportframes could negatively impact the users experience and framerate in large quantities, like if I wanted to display ores in a shop ui such as this one


Would it be wise to load about 2 to 7 viewport frames on each ui element? In total I think my game will have roughly 25 of these seperate upgrades, amounting to 175 or more viewportframes in an extreme scenario if I decide to go this route (however only like a quarter or a half will be loaded at a time).

Could this lag the game extremely? Could it make the game unplayable? And would it be possible to do?

(my game is designed for pc devices)

Please help.

As long as you’re not moving the object around a lot (if you can just move the camera instead) and following the proper practices for viewport frame optimization you should be alright.

A ViewportFrame is a frame that uses a camera to render 3D objects. This type of frame is a good way to display 3D objects and models in a 2D environment, but they have downsides too. They rely on tons of calculations and algorithms to show the object in the workspace into the viewport frame, and since viewport frames rely on the camera, and they render very poorly, they will not function well in large quantities and cause tremendous lag. So I suggest do not use more than 20 at most.

What if I only have one union in each frame? would that have the same consequences?

unions also cause considerable lag, but I think you should be fine as long as you don’t exceed 20 ~ 40.

I mean I have two very conflicting statements here, one saying that I can do hundreds of viewport frames if I follow proper optimization and one saying that 20~40 would be a lot, can you confidently with 100% certainty say that that many viewportframes will lag my game? (I will mark your answer as the solution)

Of course, the amount also depends on your GPU and CPU. And your graphics card. It varies sometimes, but it would be unwise to exceed over 40 ViewPort frames. (Depending on rendering power. If you have a low-tier PC, don’t exceed 20, mid-tier, stay below 40 or so, top notch PC, I’d say you can go over 40 as long as you have the required hardware.)

1 Like

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