StreamedTexture2D
A texture that supports dynamic mipmap streaming for optimized VRAM usage.
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.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
StreamedTexture2DConstructor
public StreamedTexture2D();Properties3
LoadPathProperty
public string LoadPath { get; set; }The StreamedTexture2D's file path to a .stex file.
MaxLodOverrideProperty
public int MaxLodOverride { get; set; }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.
MinLodOverrideProperty
public int MinLodOverride { get; set; }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.
Methods6
GetLoadPathstring
public string GetLoadPath();stringGetMaxLodOverrideint
public int GetMaxLodOverride();intGetMinLodOverrideint
public int GetMinLodOverride();intLoadError
public Error Load(string path);Loads the texture from the specified path.
| Name | Type | Default |
|---|---|---|
path | string | — |
ErrorSetMaxLodOverridevoid
public void SetMaxLodOverride(int maxLod);| Name | Type | Default |
|---|---|---|
maxLod | int | — |
SetMinLodOverridevoid
public void SetMinLodOverride(int minLod);| Name | Type | Default |
|---|---|---|
minLod | int | — |