Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

StreamedTexture2D

Expérimental : This class may be changed or removed in future versions.

Hérite de : Texture2D < Texture < Resource < RefCounted < Object

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

Description

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.

Propriétés

String

load_path

""

int

max_lod_override

0

int

min_lod_override

0

bool

resource_local_to_scene

false (overrides Resource)

Méthodes

Error

load(path: String)


Descriptions des propriétés

String load_path = "" 🔗

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


int max_lod_override = 0 🔗

  • void set_max_lod_override(value: int)

  • int get_max_lod_override()

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.


int min_lod_override = 0 🔗

  • void set_min_lod_override(value: int)

  • int get_min_lod_override()

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.


Descriptions des méthodes

Error load(path: String) 🔗

Charge la texture au chemin path spécifié.