Skip to main content

ST Image Loader

Downloads a picture from a link and shows it on a renderer or in a UI Raw Image, like VRChat's VRCImageDownloader. Add it with Add Component → StageTime → ST Image Loader.

Approved sources are coming

In a future SDK update, ST Image Loader will only load from an approved list of sources, and links to other sites will stop loading. The list will be published in these docs before the change. See the Roadmap.

Field
urlThe https link to a JPG or PNG image
loadOnStartLoad when the world loads
targetRendererShow the image on this renderer (optional). The material is not copied: the image is set on this renderer only
texturePropertyThe material's texture to replace; empty = its main texture (_BaseMap in URP)
targetRawImageShow the image in this UI Raw Image (optional)
mipmapsMake smaller copies so the image looks smooth from far away (on by default; uses a third more memory)
filterMode, wrapMode, anisoLevelHow the image is sampled: blending, edges (Clamp by default), sharpness at steep angles
cacheMinutesShow a copy saved on the device for this many minutes instead of downloading again (default 60)
Member
resultThe image after OnImageLoadSuccess (a Texture2D; null before and after Unload)
width, heightIts size in pixels
errorWhy the last load failed
isLoading, progressA load is in progress; how much has arrived (0 to 1)
Load(), LoadUrl(url)Load again, or another link. The current image stays until the new one arrives
Unload()Free the image and show the material's own texture again

Scripts on the same GameObject get OnImageLoadSuccess() and OnImageLoadError().

public class Poster : StageTimeBehaviour
{
public override void OnImageLoadSuccess()
{
STImageLoader loader = GetComponent<STImageLoader>();
transform.localScale = new Vector3((float)loader.width / loader.height, 1f, 1f); // keep the picture's shape
}
}

Limits​

  • JPG or PNG, at most 2048 x 2048 pixels and 16 MB. https links only.
  • All of a world's image loaders share a limit of one new download per second; extra loads wait their turn. An image loaded in the last cacheMinutes comes from the device and doesn't wait.
  • A loader keeps one image. Loading another, Unload() or destroying the loader frees the old one, so a gallery can flip through any number of pictures with one loader.

Same picture for everyone​

Each player's device loads its own copy, and nothing about the image is synced. To show everyone the same picture, sync which picture to show (a number or a link) and load it in OnDeserialization. The Image gallery example does this.

Unlike VRChat, the events carry no parameter (read the loader's fields), links are plain strings (no VRCUrl), and the loader shows the image on its targets for you, without copying the material.