: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/Texture3D.xml. .. _class_Texture3D: Texture3D ========= **Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`CompressedTexture3D`, :ref:`ImageTexture3D`, :ref:`NoiseTexture3D`, :ref:`PlaceholderTexture3D`, :ref:`Texture3DRD` Base class for 3-dimensional textures. .. rst-class:: classref-introduction-group Description ----------- Base class for :ref:`ImageTexture3D` and :ref:`CompressedTexture3D`. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. **Texture3D** is the base class for all 3-dimensional texture types. See also :ref:`TextureLayered`. All images need to have the same width, height and number of mipmap levels. To create such a texture file yourself, reimport your image files using the Godot Editor import presets. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`Image`\] | :ref:`_get_data`\ (\ ) |virtual| |required| |const| | +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_get_depth`\ (\ ) |virtual| |required| |const| | +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`Format` | :ref:`_get_format`\ (\ ) |virtual| |required| |const| | +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_get_height`\ (\ ) |virtual| |required| |const| | +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`_get_width`\ (\ ) |virtual| |required| |const| | +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_has_mipmaps`\ (\ ) |virtual| |required| |const| | +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`Resource` | :ref:`create_placeholder`\ (\ ) |const| | +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`Image`\] | :ref:`get_data`\ (\ ) |const| | +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_depth`\ (\ ) |const| | +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`Format` | :ref:`get_format`\ (\ ) |const| | +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_height`\ (\ ) |const| | +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_width`\ (\ ) |const| | +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_mipmaps`\ (\ ) |const| | +--------------------------------------------------------+-----------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_Texture3D_private_method__get_data: .. rst-class:: classref-method :ref:`Array`\[:ref:`Image`\] **_get_data**\ (\ ) |virtual| |required| |const| :ref:`🔗` Called when the **Texture3D**'s data is queried. .. rst-class:: classref-item-separator ---- .. _class_Texture3D_private_method__get_depth: .. rst-class:: classref-method :ref:`int` **_get_depth**\ (\ ) |virtual| |required| |const| :ref:`🔗` Called when the **Texture3D**'s depth is queried. .. rst-class:: classref-item-separator ---- .. _class_Texture3D_private_method__get_format: .. rst-class:: classref-method :ref:`Format` **_get_format**\ (\ ) |virtual| |required| |const| :ref:`🔗` Called when the **Texture3D**'s format is queried. .. rst-class:: classref-item-separator ---- .. _class_Texture3D_private_method__get_height: .. rst-class:: classref-method :ref:`int` **_get_height**\ (\ ) |virtual| |required| |const| :ref:`🔗` Called when the **Texture3D**'s height is queried. .. rst-class:: classref-item-separator ---- .. _class_Texture3D_private_method__get_width: .. rst-class:: classref-method :ref:`int` **_get_width**\ (\ ) |virtual| |required| |const| :ref:`🔗` Called when the **Texture3D**'s width is queried. .. rst-class:: classref-item-separator ---- .. _class_Texture3D_private_method__has_mipmaps: .. rst-class:: classref-method :ref:`bool` **_has_mipmaps**\ (\ ) |virtual| |required| |const| :ref:`🔗` Called when the presence of mipmaps in the **Texture3D** is queried. .. rst-class:: classref-item-separator ---- .. _class_Texture3D_method_create_placeholder: .. rst-class:: classref-method :ref:`Resource` **create_placeholder**\ (\ ) |const| :ref:`🔗` Creates a placeholder version of this resource (:ref:`PlaceholderTexture3D`). .. rst-class:: classref-item-separator ---- .. _class_Texture3D_method_get_data: .. rst-class:: classref-method :ref:`Array`\[:ref:`Image`\] **get_data**\ (\ ) |const| :ref:`🔗` Returns the **Texture3D**'s data as an array of :ref:`Image`\ s. Each :ref:`Image` represents a *slice* of the **Texture3D**, with different slices mapping to different depth (Z axis) levels. .. rst-class:: classref-item-separator ---- .. _class_Texture3D_method_get_depth: .. rst-class:: classref-method :ref:`int` **get_depth**\ (\ ) |const| :ref:`🔗` Returns the **Texture3D**'s depth in pixels. Depth is typically represented by the Z axis (a dimension not present in :ref:`Texture2D`). .. rst-class:: classref-item-separator ---- .. _class_Texture3D_method_get_format: .. rst-class:: classref-method :ref:`Format` **get_format**\ (\ ) |const| :ref:`🔗` Returns the current format being used by this texture. .. rst-class:: classref-item-separator ---- .. _class_Texture3D_method_get_height: .. rst-class:: classref-method :ref:`int` **get_height**\ (\ ) |const| :ref:`🔗` Returns the **Texture3D**'s height in pixels. Width is typically represented by the Y axis. .. rst-class:: classref-item-separator ---- .. _class_Texture3D_method_get_width: .. rst-class:: classref-method :ref:`int` **get_width**\ (\ ) |const| :ref:`🔗` Returns the **Texture3D**'s width in pixels. Width is typically represented by the X axis. .. rst-class:: classref-item-separator ---- .. _class_Texture3D_method_has_mipmaps: .. rst-class:: classref-method :ref:`bool` **has_mipmaps**\ (\ ) |const| :ref:`🔗` Returns ``true`` if the **Texture3D** has generated mipmaps. .. |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.)`