Allow us to encode a viewportframe's rendered texture to base64 for exporting to an external source

I have a system which generates thumbnail images for objects in my game using viewportframes (as is conventional), but I would like to replicate these same images to my website where I can display them there. If we could serialize the texture data of a viewportframe into some format like base64, that would allow me to transfer that data to my external server via httpservice and then reconstruct it on my website.

Other potential use cases for such functionality may be:

  1. a plugin that accepts any model as an input and generates a bunch of viewportframes, perhaps a series of images of the object from different angles, and then exports that data so an external program can reconstruct the base64 images into a rotating model preview gif (a turntable animation for showcasing your works).
  2. a game like Bloxburg could automatically take snapshots of players’ houses using viewportframes which are serialized and sent to a website for display. Bloxburg would then have an online catalog of images of house designs for other players to look at and admire.
  3. a fashion show game with tight integration with an official discord server where players can press a button to have the game take an appealing picture of their outfit and post it to said discord server.

These use cases sound crazy and farfetched, and perhaps they are, but my use case (at the top of the post) is very much real and without this kind of functionality I am forced to make major compromises to my vision. These kinds of unique, obscure behaviors, while unnoticed by most developers, often prove to be the crux of many novel and radical ideas and ambitions. For example, the ability of plugins to write to a text file has inspired me to work on a personal plugin where I could generate an overhead map of my level using raycasts, write that data to a text file, and then with an external program, parse it and convert it into a high quality image.

17 Likes

This seems super useful to me. I could use it to further automate the creation of item icons, which at the moment involves manually grabbing a screencap of each item - having the ability to automatically go through a folder of models and generate a useable image of each model would speed things up considerably.

Sending the current look of a player’s outfit to Discord/your own app also seems very useful in general.

4 Likes