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.

ResourceImporterStreamedTexture

實驗性: This class may be changed or removed in future versions.

繼承: ResourceImporter < RefCounted < Object

Imports an image as a streaming-capable texture for dynamic mipmap loading.

說明

This importer creates StreamedTexture2D resources that support 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, significantly reducing VRAM consumption for projects with many large textures.

The streaming system monitors which textures are visible in each frame and loads appropriate mipmap levels accordingly. Textures that are far from the camera or not currently visible have their higher-resolution mipmap levels unloaded, while textures being displayed up close are loaded at higher resolutions.

For textures that don't need streaming support, use ResourceImporterTexture instead.

屬性

int

compress/channel_pack

0

int

compress/hdr_compression

1

bool

compress/high_quality

false

int

compress/normal_map

0

int

roughness/mode

0

String

roughness/src_normal

""

int

streaming/max_lod_override

0

int

streaming/min_lod_override

0


屬性說明

int compress/channel_pack = 0 🔗

控制在匯入的紋理中應如何使用顏色通道。

sRGB 友好:阻止使用 R 和 RG 顏色格式,因為它們不支援非線性 sRGB 編碼。

最佳化:如果紋理不使用藍色通道,則允許使用 RG 顏色格式。如果可以丟棄紋理的藍色通道(所有像素的藍色值必須為 0),則可以減少記憶體佔用。


int compress/hdr_compression = 1 🔗

控制如何對 HDR 影像執行 VRAM 壓縮。

停用:切勿對 HDR 紋理使用 VRAM 壓縮,無論它們是不透明還是透明。相反,紋理會轉換為 RGBE9995(每通道 9 位元 + 5 位元指數 = 每像素 32 位元),以減少與半浮點或單精確度浮點影像格式相比的記憶體使用量。

僅不透明: 僅對不透明 HDR 紋理使用 VRAM 壓縮。這是由於 HDR 格式的限制,因為沒有同時支援透明度的 VRAM 壓縮 HDR 格式。

總是: 強制 VRAM 壓縮,即使對於具有 Alpha 通道的 HDR 紋理也是如此。為此,在匯入時將丟棄 Alpha 通道。

注意: 僅對 Radiance HDR (.hdr) 和 OpenEXR (.exr) 影像有效。


bool compress/high_quality = false 🔗

如果true,在桌面平台上使用BPTC 壓縮,在行動平台上使用ASTC 壓縮。使用BPTC 時,BC7 用於SDR 紋理,BC6H 用於HDR紋理。

如果 false,則在桌面平台上使用速度更快但品質較低的 S3TC 壓縮,在行動裝置/Web 平台上使用 ETC2。使用 S3TC 時,DXT1 (BC1) 用於不透明紋理,DXT5 (BC3) 用於透明或法線貼圖 (RGTC) 紋理。

BPTC 和 ASTC 支援 HDR 紋理的 VRAM 壓縮,但 S3TC 和 ETC2 不支援(請參閱compress/hdr_compression)。


int compress/normal_map = 0 🔗

When using a texture as normal map, only the red and green channels are required. Given regular texture compression algorithms produce artifacts that don't look that nice in normal maps, the RGTC compression format is the best fit for this data. Forcing this option to Enable will make Godot import the image as RGTC compressed. By default, it's set to Detect. This means that if the texture is ever detected to be used as a normal map, it will be changed to Enable and reimported automatically.


int roughness/mode = 0 🔗

The color channel to consider as a roughness map in this texture. Only effective if Roughness > Src Normal is not empty.


String roughness/src_normal = "" 🔗

The path to the texture to consider as a normal map for roughness filtering on import. Specifying this can help decrease specular aliasing slightly in 3D.


int streaming/max_lod_override = 0 🔗

The maximum LOD (mipmap level) that can be loaded for this 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 streaming/min_lod_override = 0 🔗

The minimum LOD (mipmap level) the 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.