class_resourceimporterlayeredtexture.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/ResourceImporterLayeredTexture.xml.
  6. .. _class_ResourceImporterLayeredTexture:
  7. ResourceImporterLayeredTexture
  8. ==============================
  9. **Inherits:** :ref:`ResourceImporter<class_ResourceImporter>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Imports a 3-dimensional texture (:ref:`Texture3D<class_Texture3D>`), a :ref:`Texture2DArray<class_Texture2DArray>`, a :ref:`Cubemap<class_Cubemap>` or a :ref:`CubemapArray<class_CubemapArray>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This imports a 3-dimensional texture, which can then be used in custom shaders, as a :ref:`FogMaterial<class_FogMaterial>` density map or as a :ref:`GPUParticlesAttractorVectorField3D<class_GPUParticlesAttractorVectorField3D>`. See also :ref:`ResourceImporterTexture<class_ResourceImporterTexture>` and :ref:`ResourceImporterTextureAtlas<class_ResourceImporterTextureAtlas>`.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`Importing images <../tutorials/assets_pipeline/importing_images>`
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +---------------------------+---------------------------------------------------------------------------------------------------------+-----------+
  25. | :ref:`int<class_int>` | :ref:`compress/channel_pack<class_ResourceImporterLayeredTexture_property_compress/channel_pack>` | ``0`` |
  26. +---------------------------+---------------------------------------------------------------------------------------------------------+-----------+
  27. | :ref:`int<class_int>` | :ref:`compress/hdr_compression<class_ResourceImporterLayeredTexture_property_compress/hdr_compression>` | ``1`` |
  28. +---------------------------+---------------------------------------------------------------------------------------------------------+-----------+
  29. | :ref:`bool<class_bool>` | :ref:`compress/high_quality<class_ResourceImporterLayeredTexture_property_compress/high_quality>` | ``false`` |
  30. +---------------------------+---------------------------------------------------------------------------------------------------------+-----------+
  31. | :ref:`float<class_float>` | :ref:`compress/lossy_quality<class_ResourceImporterLayeredTexture_property_compress/lossy_quality>` | ``0.7`` |
  32. +---------------------------+---------------------------------------------------------------------------------------------------------+-----------+
  33. | :ref:`int<class_int>` | :ref:`compress/mode<class_ResourceImporterLayeredTexture_property_compress/mode>` | ``1`` |
  34. +---------------------------+---------------------------------------------------------------------------------------------------------+-----------+
  35. | :ref:`bool<class_bool>` | :ref:`mipmaps/generate<class_ResourceImporterLayeredTexture_property_mipmaps/generate>` | ``true`` |
  36. +---------------------------+---------------------------------------------------------------------------------------------------------+-----------+
  37. | :ref:`int<class_int>` | :ref:`mipmaps/limit<class_ResourceImporterLayeredTexture_property_mipmaps/limit>` | ``-1`` |
  38. +---------------------------+---------------------------------------------------------------------------------------------------------+-----------+
  39. | :ref:`int<class_int>` | :ref:`slices/arrangement<class_ResourceImporterLayeredTexture_property_slices/arrangement>` | ``1`` |
  40. +---------------------------+---------------------------------------------------------------------------------------------------------+-----------+
  41. .. rst-class:: classref-section-separator
  42. ----
  43. .. rst-class:: classref-descriptions-group
  44. Property Descriptions
  45. ---------------------
  46. .. _class_ResourceImporterLayeredTexture_property_compress/channel_pack:
  47. .. rst-class:: classref-property
  48. :ref:`int<class_int>` **compress/channel_pack** = ``0`` :ref:`🔗<class_ResourceImporterLayeredTexture_property_compress/channel_pack>`
  49. Controls how color channels should be used in the imported texture.
  50. \ **sRGB Friendly:**, prevents the RG color format from being used, as it does not support sRGB color.
  51. \ **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``).
  52. \ **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 (:ref:`Cubemap<class_Cubemap>`, :ref:`CubemapArray<class_CubemapArray>`, :ref:`Texture2DArray<class_Texture2DArray>` and :ref:`Texture3D<class_Texture3D>`).
  53. .. rst-class:: classref-item-separator
  54. ----
  55. .. _class_ResourceImporterLayeredTexture_property_compress/hdr_compression:
  56. .. rst-class:: classref-property
  57. :ref:`int<class_int>` **compress/hdr_compression** = ``1`` :ref:`🔗<class_ResourceImporterLayeredTexture_property_compress/hdr_compression>`
  58. Controls how VRAM compression should be performed for HDR images.
  59. \ **Disabled:** Never use VRAM compression for HDR textures, regardless of whether they're opaque or transparent. Instead, the texture is converted to RGBE9995 (9-bits per channel + 5-bit exponent = 32 bits per pixel) to reduce memory usage compared to a half-float or single-precision float image format.
  60. \ **Opaque Only:** Only uses VRAM compression for opaque HDR textures. This is due to a limitation of HDR formats, as there is no VRAM-compressed HDR format that supports transparency at the same time.
  61. \ **Always:** Force VRAM compression even for HDR textures with an alpha channel. To perform this, the alpha channel is discarded on import.
  62. \ **Note:** Only effective on Radiance HDR (``.hdr``) and OpenEXR (``.exr``) images.
  63. .. rst-class:: classref-item-separator
  64. ----
  65. .. _class_ResourceImporterLayeredTexture_property_compress/high_quality:
  66. .. rst-class:: classref-property
  67. :ref:`bool<class_bool>` **compress/high_quality** = ``false`` :ref:`🔗<class_ResourceImporterLayeredTexture_property_compress/high_quality>`
  68. If ``true``, uses BPTC compression on desktop platforms and ASTC compression on mobile platforms. When using BPTC, BC7 is used for SDR textures and BC6H is used for HDR textures.
  69. If ``false``, uses the faster but lower-quality S3TC compression on desktop platforms and ETC2 on mobile/web platforms. When using S3TC, DXT1 (BC1) is used for opaque textures and DXT5 (BC3) is used for transparent or normal map (RGTC) textures.
  70. BPTC and ASTC support VRAM compression for HDR textures, but S3TC and ETC2 do not (see :ref:`compress/hdr_compression<class_ResourceImporterLayeredTexture_property_compress/hdr_compression>`).
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_ResourceImporterLayeredTexture_property_compress/lossy_quality:
  74. .. rst-class:: classref-property
  75. :ref:`float<class_float>` **compress/lossy_quality** = ``0.7`` :ref:`🔗<class_ResourceImporterLayeredTexture_property_compress/lossy_quality>`
  76. The quality to use when using the **Lossy** compression mode. Higher values result in better quality, at the cost of larger file sizes. Lossy quality does not affect memory usage of the imported texture, only its file size on disk.
  77. .. rst-class:: classref-item-separator
  78. ----
  79. .. _class_ResourceImporterLayeredTexture_property_compress/mode:
  80. .. rst-class:: classref-property
  81. :ref:`int<class_int>` **compress/mode** = ``1`` :ref:`🔗<class_ResourceImporterLayeredTexture_property_compress/mode>`
  82. The compression mode to use. Each compression mode provides a different tradeoff:
  83. \ **Lossless**: Original quality, high memory usage, high size on disk, fast import.
  84. \ **Lossy:** Reduced quality, high memory usage, low size on disk, fast import.
  85. \ **VRAM Compressed:** Reduced quality, low memory usage, low size on disk, slowest import. Only use for textures in 3D scenes, not for 2D elements.
  86. \ **VRAM Uncompressed:** Original quality, high memory usage, highest size on disk, fastest import.
  87. \ **Basis Universal:** Reduced quality, low memory usage, lowest size on disk, slow import. Only use for textures in 3D scenes, not for 2D elements.
  88. See `Compress mode <../tutorials/assets_pipeline/importing_images.html#compress-mode>`__ in the manual for more details.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_ResourceImporterLayeredTexture_property_mipmaps/generate:
  92. .. rst-class:: classref-property
  93. :ref:`bool<class_bool>` **mipmaps/generate** = ``true`` :ref:`🔗<class_ResourceImporterLayeredTexture_property_mipmaps/generate>`
  94. If ``true``, smaller versions of the texture are generated on import. For example, a 64×64 texture will generate 6 mipmaps (32×32, 16×16, 8×8, 4×4, 2×2, 1×1). This has several benefits:
  95. - Textures will not become grainy in the distance (in 3D), or if scaled down due to :ref:`Camera2D<class_Camera2D>` zoom or :ref:`CanvasItem<class_CanvasItem>` scale (in 2D).
  96. - Performance will improve if the texture is displayed in the distance, since sampling smaller versions of the original texture is faster and requires less memory bandwidth.
  97. The downside of mipmaps is that they increase memory usage by roughly 33% (for :ref:`Texture2DArray<class_Texture2DArray>`, :ref:`Cubemap<class_Cubemap>` and :ref:`CubemapArray<class_CubemapArray>`) or 14% (for :ref:`Texture3D<class_Texture3D>`).
  98. It's recommended to enable mipmaps in 3D. However, in 2D, this should only be enabled if your project visibly benefits from having mipmaps enabled. If the camera never zooms out significantly, there won't be a benefit to enabling mipmaps but memory usage will increase.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _class_ResourceImporterLayeredTexture_property_mipmaps/limit:
  102. .. rst-class:: classref-property
  103. :ref:`int<class_int>` **mipmaps/limit** = ``-1`` :ref:`🔗<class_ResourceImporterLayeredTexture_property_mipmaps/limit>`
  104. Unimplemented. This currently has no effect when changed.
  105. .. rst-class:: classref-item-separator
  106. ----
  107. .. _class_ResourceImporterLayeredTexture_property_slices/arrangement:
  108. .. rst-class:: classref-property
  109. :ref:`int<class_int>` **slices/arrangement** = ``1`` :ref:`🔗<class_ResourceImporterLayeredTexture_property_slices/arrangement>`
  110. Controls how the cubemap's texture is internally laid out. When using high-resolution cubemaps, **2×3** and **3×2** are less prone to exceeding hardware texture size limits compared to **1×6** and **6×1**.
  111. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  112. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  113. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  114. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  115. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  116. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  117. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  118. .. |void| replace:: :abbr:`void (No return value.)`