As a Roblox developer, it’s currently impossible to create image snapshots of ViewportFrames. Our game fund team has several use cases for this feature:
Reducing memory usage when rendering many complex ViewportFrames by converting them into static images and destroying the viewport once rendered. This is a significant problem in our game because user profile pages render dozens of viewports simultaneously. On low-end mobile devices, this can cause crashes because the client runs out of memory.
If this feature is exposed to developers, we plan to make further optimizations by loading the viewport image into a DynamicImage, extracting the pixels from the image, and then serving only the image pixels to clients who visit a profile, rather than sending the entire scene instance tree. This will save significant client bandwidth; profile blobs are currently giant.
Pairing up with the upcoming DynamicImage class to extract color information from viewports. In Clip It, we use DynamicImages to extract the most vibrant color for a player’s avatar and then use that as an accent in backgrounds. However, we want to migrate our avatar thumbnails from static images to viewports, and this feature addition would help support that.
It should be noted that this was already a recent API addition but appears to have only been added for internal UGC validation. It would be fantastic if the developer accessibility of this API could be reaccessed because there are numerous use cases beyond ours.
I would love this as well. Lua Learning uses ViewportFrames for the Quest boards in the card view on its discover page, which uses a lot of memory. Same use case, different application.
I would love this feature because it would immediately solve my game’s biggest performance problem and allow me to rip out a LOT of janky code that attempts to optimize the user’s UI. My game shows high-res models in viewportframes, so to optimize it, I have the server selectively replicate the models to the client when they come into view, and then have the client destroy them when they go out of view. This feature would let me just generate small snapshots of the models and give them all to the client, no weird replication behavior required.
(Naturally it would be best to just optimize the models but I am neither the modeller nor manager for this project so this is the best I can do.)
This would be critical in making our game perform (or even run at all!) on lower-end mobile devices. We have complex scenes that are shown to users as they select content. The scenes are made by users in-game and can not be saved/uploaded as images ahead of time.
Giving us the ability to generate an ImageId from a viewportframe in real-time would allow us to reduce our memory footprint by 10-100x for these scenes. We display 9 of them on the screen at once, so the memory impact is massive.
I think a great way to solve the moderation issue is to have developers prompt the user via a Roblox CoreGui popup asking “Would you like to upload this image to Roblox?” It would display the image and communicate to the user that they would be the ones taking responsibility for any potential moderation.