World Utilities / Converters

Texture2D Loader

Downloads an image from a URL value and stores it in a Texture2D value, with placeholders for loading and errors.

since v0.1.0localsynchronized
Component Add Component menu / prefab Source
Local Texture2D Loader ConverterVRCTools.World.LocalValues.Converters.LocalTexture2DLoaderConverter Local Values › Converter › Local Texture2D Loader Converterprefab: Image Loader.prefab LocalTexture2DLoaderConverter.cs ↗
Synchronized Texture2D Loader ConverterVRCTools.World.LocalValues.Converters.SynchronizedTexture2DLoaderConverter Synchronized Values › Converter › Synchronized Texture2D Loader Converterprefab: Image Loader.prefab SynchronizedTexture2DLoaderConverter.cs ↗

Watches a URL value and downloads the image it points to using VRChat’s image downloader. The downloaded texture is written into a local Texture2D value, from where you can show it with a Raw Image or Material Property applicator.

The Local variant reads a local URL, the Synchronized variant reads a synchronized URL - in that case every player downloads the image themselves, so everybody sees the same picture without textures ever being sent over the network.

Parameters

Parameter Default Description
Local URL / Synchronized URL None The URL value to watch. Required.
Local Texture2D None The texture value receiving the image. Required.
Alternative Textures    
Default Texture None Shown while the URL is empty.
Loading Texture None Shown while a download is in progress (the previous image stays visible if unset).
Error Texture None Shown when a download fails and no more specific texture is set.
Access Denied Error Texture None The URL is not allowed (e.g. untrusted URLs are disabled by the player).
Download Error Texture None The download itself failed.
Invalid Error Texture None The URL does not point to a supported image.
Too Many Requests Error Texture None VRChat’s image download rate limit was hit.
Invalid URL Error Texture None The URL is malformed.
Error Handling    
Retry Period 2 Seconds to wait before retrying after a too many requests error.

The package ships ready-made loading and error textures in Runtime/Textures (T_Texture_Loading, T_Texture_Error), which the Image Loader prefabs use by default.

Behavior

  1. When the URL changes to an empty value, the texture is set to Default Texture.
  2. Otherwise Loading Texture is shown (if set) and the download starts.
  3. On success the downloaded texture is written to the target value.
  4. On failure the most specific error texture is used, falling back to Error Texture. Rate limited downloads are retried automatically after Retry Period seconds.

If the URL changes while a download is still running, the new URL is queued and downloaded as soon as the current download finishes. When the loader is destroyed it resets the texture value to Default Texture and releases all downloaded textures.

VRChat only loads images from trusted domains unless the player enabled Allow Untrusted URLs. Host your images on a trusted service (e.g. GitHub Pages, Imgur) so everybody can see them, and set an Access Denied Error Texture that explains what is going on.

See the Remote image board guide for a complete setup.