:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/RDTextureFormat.xml. .. _class_RDTextureFormat: RDTextureFormat =============== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Texture format (used by :ref:`RenderingDevice`). .. rst-class:: classref-introduction-group Description ----------- This object is used by :ref:`RenderingDevice`. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +------------------------------------------------------------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`array_layers` | ``1`` | +------------------------------------------------------------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`depth` | ``1`` | +------------------------------------------------------------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`DataFormat` | :ref:`format` | ``8`` | +------------------------------------------------------------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`height` | ``1`` | +------------------------------------------------------------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`is_discardable` | ``false`` | +------------------------------------------------------------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`is_resolve_buffer` | ``false`` | +------------------------------------------------------------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`mipmaps` | ``1`` | +------------------------------------------------------------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`TextureSamples` | :ref:`samples` | ``0`` | +------------------------------------------------------------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`TextureType` | :ref:`texture_type` | ``1`` | +------------------------------------------------------------------------------+----------------------------------------------------------------------------+-----------+ | |bitfield|\[:ref:`TextureUsageBits`\] | :ref:`usage_bits` | ``0`` | +------------------------------------------------------------------------------+----------------------------------------------------------------------------+-----------+ | :ref:`int` | :ref:`width` | ``1`` | +------------------------------------------------------------------------------+----------------------------------------------------------------------------+-----------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +--------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_shareable_format`\ (\ format\: :ref:`DataFormat`\ ) | +--------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`remove_shareable_format`\ (\ format\: :ref:`DataFormat`\ ) | +--------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_RDTextureFormat_property_array_layers: .. rst-class:: classref-property :ref:`int` **array_layers** = ``1`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_array_layers**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_array_layers**\ (\ ) The number of layers in the texture. Only relevant for 2D texture arrays. .. rst-class:: classref-item-separator ---- .. _class_RDTextureFormat_property_depth: .. rst-class:: classref-property :ref:`int` **depth** = ``1`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_depth**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_depth**\ (\ ) The texture's depth (in pixels). This is always ``1`` for 2D textures. .. rst-class:: classref-item-separator ---- .. _class_RDTextureFormat_property_format: .. rst-class:: classref-property :ref:`DataFormat` **format** = ``8`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_format**\ (\ value\: :ref:`DataFormat`\ ) - :ref:`DataFormat` **get_format**\ (\ ) The texture's pixel data format. .. rst-class:: classref-item-separator ---- .. _class_RDTextureFormat_property_height: .. rst-class:: classref-property :ref:`int` **height** = ``1`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_height**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_height**\ (\ ) The texture's height (in pixels). .. rst-class:: classref-item-separator ---- .. _class_RDTextureFormat_property_is_discardable: .. rst-class:: classref-property :ref:`bool` **is_discardable** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_is_discardable**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **get_is_discardable**\ (\ ) If a texture is discardable, its contents do not need to be preserved between frames. This flag is only relevant when the texture is used as target in a draw list. This information is used by :ref:`RenderingDevice` to figure out if a texture's contents can be discarded, eliminating unnecessary writes to memory and boosting performance. .. rst-class:: classref-item-separator ---- .. _class_RDTextureFormat_property_is_resolve_buffer: .. rst-class:: classref-property :ref:`bool` **is_resolve_buffer** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_is_resolve_buffer**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **get_is_resolve_buffer**\ (\ ) The texture will be used as the destination of a resolve operation. .. rst-class:: classref-item-separator ---- .. _class_RDTextureFormat_property_mipmaps: .. rst-class:: classref-property :ref:`int` **mipmaps** = ``1`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_mipmaps**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_mipmaps**\ (\ ) The number of mipmaps available in the texture. .. rst-class:: classref-item-separator ---- .. _class_RDTextureFormat_property_samples: .. rst-class:: classref-property :ref:`TextureSamples` **samples** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_samples**\ (\ value\: :ref:`TextureSamples`\ ) - :ref:`TextureSamples` **get_samples**\ (\ ) The number of samples used when sampling the texture. .. rst-class:: classref-item-separator ---- .. _class_RDTextureFormat_property_texture_type: .. rst-class:: classref-property :ref:`TextureType` **texture_type** = ``1`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_texture_type**\ (\ value\: :ref:`TextureType`\ ) - :ref:`TextureType` **get_texture_type**\ (\ ) The texture type. .. rst-class:: classref-item-separator ---- .. _class_RDTextureFormat_property_usage_bits: .. rst-class:: classref-property |bitfield|\[:ref:`TextureUsageBits`\] **usage_bits** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_usage_bits**\ (\ value\: |bitfield|\[:ref:`TextureUsageBits`\]\ ) - |bitfield|\[:ref:`TextureUsageBits`\] **get_usage_bits**\ (\ ) The texture's usage bits, which determine what can be done using the texture. .. rst-class:: classref-item-separator ---- .. _class_RDTextureFormat_property_width: .. rst-class:: classref-property :ref:`int` **width** = ``1`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_width**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_width**\ (\ ) The texture's width (in pixels). .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_RDTextureFormat_method_add_shareable_format: .. rst-class:: classref-method |void| **add_shareable_format**\ (\ format\: :ref:`DataFormat`\ ) :ref:`🔗` Adds ``format`` as a valid format for the corresponding :ref:`RDTextureView`'s :ref:`RDTextureView.format_override` property. If any format is added as shareable, then the main :ref:`format` must also be added. .. rst-class:: classref-item-separator ---- .. _class_RDTextureFormat_method_remove_shareable_format: .. rst-class:: classref-method |void| **remove_shareable_format**\ (\ format\: :ref:`DataFormat`\ ) :ref:`🔗` Removes ``format`` from the list of valid formats that the corresponding :ref:`RDTextureView`'s :ref:`RDTextureView.format_override` property can be set to. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`