Skip to content

StreamedTexture2D

Inherits: Texture2D < Texture < Resource < RefCounted < Object

A texture that supports dynamic mipmap streaming for optimized VRAM usage.

StreamedTexture2D is a texture type that supports dynamic mipmap streaming. When texture streaming is enabled in the Project Settings (ProjectSettings.rendering/textures/streaming/enabled), these textures can have their mipmap levels dynamically loaded and unloaded based on usage.

The texture streaming system monitors which textures are visible in each frame and at what resolution they’re being displayed. Textures that are far from the camera or not currently visible have their higher-resolution mipmap levels unloaded to save VRAM, while textures being displayed up close are loaded at higher resolutions.

This texture type is automatically created when importing images with the streaming-compatible importer.

Type Name Default
String load_path ""
int max_lod_override 0
int min_lod_override 0
bool resource_local_to_scene false (overrides Resource)
Returns Method
Error load(path: String)

load_path

String load_path = ""

The StreamedTexture2D’s file path to a .stex file.

max_lod_override

int max_lod_override = 0

Overrides the maximum LOD (mipmap level) that can be loaded for this specific texture. Lower values allow higher resolution. A value of 0 uses the global setting from ProjectSettings.rendering/textures/streaming/max_lod. Values 1 to 14 correspond to LOD levels 0 to 13.

min_lod_override

int min_lod_override = 0

Overrides the minimum LOD (mipmap level) this texture starts at when loaded. Higher values result in lower initial resolution. A value of 0 uses the global setting from ProjectSettings.rendering/textures/streaming/min_lod. Values 1 to 14 correspond to LOD levels 0 to 13.

load

Error load(path: String)

Loads the texture from the specified path.