class_compressedtexture2d.rst 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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/CompressedTexture2D.xml.
  6. .. _class_CompressedTexture2D:
  7. CompressedTexture2D
  8. ===================
  9. **Inherits:** :ref:`Texture2D<class_Texture2D>` **<** :ref:`Texture<class_Texture>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Texture with 2 dimensions, optionally compressed.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A texture that is loaded from a ``.ctex`` file. This file format is internal to Godot; it is created by importing other image formats with the import system. **CompressedTexture2D** can use one of 4 compression methods (including a lack of any compression):
  15. - Lossless (WebP or PNG, uncompressed on the GPU)
  16. - Lossy (WebP, uncompressed on the GPU)
  17. - VRAM Compressed (compressed on the GPU)
  18. - VRAM Uncompressed (uncompressed on the GPU)
  19. - Basis Universal (compressed on the GPU. Lower file sizes than VRAM Compressed, but slower to compress and lower quality than VRAM Compressed)
  20. Only **VRAM Compressed** actually reduces the memory usage on the GPU. The **Lossless** and **Lossy** compression methods will reduce the required storage on disk, but they will not reduce memory usage on the GPU as the texture is sent to the GPU uncompressed.
  21. Using **VRAM Compressed** also improves loading times, as VRAM-compressed textures are faster to load compared to textures using lossless or lossy compression. VRAM compression can exhibit noticeable artifacts and is intended to be used for 3D rendering, not 2D.
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +-----------------------------+----------------------------------------------------------------+----------------------------------------------------------------------------------------+
  28. | :ref:`String<class_String>` | :ref:`load_path<class_CompressedTexture2D_property_load_path>` | ``""`` |
  29. +-----------------------------+----------------------------------------------------------------+----------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | resource_local_to_scene | ``false`` (overrides :ref:`Resource<class_Resource_property_resource_local_to_scene>`) |
  31. +-----------------------------+----------------------------------------------------------------+----------------------------------------------------------------------------------------+
  32. .. rst-class:: classref-reftable-group
  33. Methods
  34. -------
  35. .. table::
  36. :widths: auto
  37. +---------------------------------------+----------------------------------------------------------------------------------------------+
  38. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load<class_CompressedTexture2D_method_load>`\ (\ path\: :ref:`String<class_String>`\ ) |
  39. +---------------------------------------+----------------------------------------------------------------------------------------------+
  40. .. rst-class:: classref-section-separator
  41. ----
  42. .. rst-class:: classref-descriptions-group
  43. Property Descriptions
  44. ---------------------
  45. .. _class_CompressedTexture2D_property_load_path:
  46. .. rst-class:: classref-property
  47. :ref:`String<class_String>` **load_path** = ``""`` :ref:`🔗<class_CompressedTexture2D_property_load_path>`
  48. .. rst-class:: classref-property-setget
  49. - :ref:`Error<enum_@GlobalScope_Error>` **load**\ (\ path\: :ref:`String<class_String>`\ )
  50. - :ref:`String<class_String>` **get_load_path**\ (\ )
  51. The **CompressedTexture2D**'s file path to a ``.ctex`` file.
  52. .. rst-class:: classref-section-separator
  53. ----
  54. .. rst-class:: classref-descriptions-group
  55. Method Descriptions
  56. -------------------
  57. .. _class_CompressedTexture2D_method_load:
  58. .. rst-class:: classref-method
  59. :ref:`Error<enum_@GlobalScope_Error>` **load**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_CompressedTexture2D_method_load>`
  60. Loads the texture from the specified ``path``.
  61. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  62. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  63. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  64. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  65. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  66. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  67. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  68. .. |void| replace:: :abbr:`void (No return value.)`