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...
ResourceImporterLayeredTexture
繼承: ResourceImporter < RefCounted < Object
匯入 3 維紋理 (Texture3D)、Texture2DArray、Cubemap 或 CubemapArray。
說明
這會匯入 3 維紋理,然後可以在自訂著色器中將其用作 FogMaterial 密度圖或 GPUParticlesAttractorVectorField3D。另請參閱 ResourceImporterTexture 和 ResourceImporterTextureAtlas。
教學
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
屬性說明
int compress/channel_pack = 0 🔗
Controls how color channels should be used in the imported texture.
sRGB Friendly:, prevents the R and RG color formats from being used, as they do not support nonlinear sRGB encoding.
Optimized:, allows the RG color format to be used if the texture does not use the blue channel. This reduces memory usage if the texture's blue channel can be discarded (all pixels must have a blue value of 0).
Normal Map (RG Channels): This forces all layers from the texture to be imported with the RG color format, with only the red and green channels preserved. RGTC (Red-Green Texture Compression) compression is able to preserve its detail much better, while using the same amount of memory as a standard RGBA VRAM-compressed texture. This only has an effect on textures with the VRAM Compressed or Basis Universal compression modes. This mode is only available in layered textures (Cubemap, CubemapArray, Texture2DArray and Texture3D).
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)。
float compress/lossy_quality = 0.7 🔗
使用有損壓縮模式時使用的品質。值越高,品質越好,但檔案大小越大。有損品質不會影響記憶體匯入紋理的使用,僅其在磁碟上的檔案大小。
要使用的壓縮模式。每個壓縮模式都提供不同的權衡:
無損:原始品質、高記憶體佔用、高磁碟空間、快速匯入。
有損: 品質降低、記憶體使用率高、磁碟空間小、匯入速度快。
VRAM 壓縮: 品質下降、記憶體使用率低、磁碟空間小、匯入速度最慢。僅用於 3D 場景中的紋理,不適用於 2D 元素。
VRAM 未壓縮: 原始品質、高記憶體使用率、磁碟大小最大、匯入速度最快。
Basis Universal: 品質降低、記憶體使用率低、磁碟大小最小、匯入速度慢。僅用於 3D 場景中的紋理,不適用於 2D 元素。
有關詳細信息,請參閱手冊中的壓縮模式。
float compress/rdo_quality_loss = 0.0 🔗
If greater than or equal to 0.01, enables Rate-Distortion Optimization (RDO) to reduce file size. Higher values result in smaller file sizes but lower quality.
Note: Enabling RDO makes encoding times significantly longer, especially when the image is large.
See also ProjectSettings.rendering/textures/basis_universal/rdo_dict_size and ProjectSettings.rendering/textures/basis_universal/zstd_supercompression_level if you want to reduce the file size further.
int compress/uastc_level = 0 🔗
The UASTC encoding level. Higher values result in better quality but make encoding times longer.
bool mipmaps/generate = true 🔗
如果 true,匯入時會產生較小版本的紋理。例如,64×64 紋理將產生 6 個 mipmap(32×32、16× 16 、8×8、4×4、2×2、1×1)。這有幾個優點:
紋理在遠處(3D 中)或由於 Camera2D 縮放或 CanvasItem 縮放(2D)而縮小時不會變得顆粒狀。
如果紋理顯示在遠處,效能將會提高,因為對原始紋理的較小版本進行取樣速度更快並且需要更少的記憶體頻寬。
mipmap 的缺點是它們使記憶體使用量增加約 33%(對於 Texture2DArray、Cubemap 和 CubemapArray)或 14%(對於 Texture3D)。
建議在 3D 中啟用 mipmap。但是,在 2D 中,僅當您的專案明顯受益於啟用 mipmap 時才應啟用此功能。如果相機永遠不會顯著縮小,啟用 mipmap 不會有任何好處,但記憶體使用量會增加。
未實作。目前變更後無效。
控制立方體貼圖紋理的內部佈局方式。使用高解析度立方體貼圖時,2×3 和 3×2與1×6 和6×1 相比,較不容易超出硬體紋理大小限制。