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.
Checking the stable version of the documentation...
StreamedTexture2D
Experimental: This class may be changed or removed in future versions.
Inherits: 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.
Properties
|
||
|
||
|
||
resource_local_to_scene |
|
Methods
Property Descriptions
The StreamedTexture2D's file path to a .stex file.
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.
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.
Method Descriptions
Loads the texture from the specified path.