Files
godot-docs/classes/class_visualshadernodetextureparameter.rst
2025-10-11 03:22:24 +00:00

416 lines
19 KiB
ReStructuredText

: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/VisualShaderNodeTextureParameter.xml.
.. _class_VisualShaderNodeTextureParameter:
VisualShaderNodeTextureParameter
================================
**Inherits:** :ref:`VisualShaderNodeParameter<class_VisualShaderNodeParameter>` **<** :ref:`VisualShaderNode<class_VisualShaderNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`VisualShaderNodeCubemapParameter<class_VisualShaderNodeCubemapParameter>`, :ref:`VisualShaderNodeTexture2DArrayParameter<class_VisualShaderNodeTexture2DArrayParameter>`, :ref:`VisualShaderNodeTexture2DParameter<class_VisualShaderNodeTexture2DParameter>`, :ref:`VisualShaderNodeTexture3DParameter<class_VisualShaderNodeTexture3DParameter>`, :ref:`VisualShaderNodeTextureParameterTriplanar<class_VisualShaderNodeTextureParameterTriplanar>`
Performs a uniform texture lookup within the visual shader graph.
.. rst-class:: classref-introduction-group
Description
-----------
Performs a lookup operation on the texture provided as a uniform for the shader.
.. rst-class:: classref-reftable-group
Properties
----------
.. table::
:widths: auto
+---------------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------+
| :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` | :ref:`color_default<class_VisualShaderNodeTextureParameter_property_color_default>` | ``0`` |
+---------------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------+
| :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` | :ref:`texture_filter<class_VisualShaderNodeTextureParameter_property_texture_filter>` | ``0`` |
+---------------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------+
| :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` | :ref:`texture_repeat<class_VisualShaderNodeTextureParameter_property_texture_repeat>` | ``0`` |
+---------------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------+
| :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` | :ref:`texture_source<class_VisualShaderNodeTextureParameter_property_texture_source>` | ``0`` |
+---------------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------+
| :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` | :ref:`texture_type<class_VisualShaderNodeTextureParameter_property_texture_type>` | ``0`` |
+---------------------------------------------------------------------------+---------------------------------------------------------------------------------------+-------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Enumerations
------------
.. _enum_VisualShaderNodeTextureParameter_TextureType:
.. rst-class:: classref-enumeration
enum **TextureType**: :ref:`🔗<enum_VisualShaderNodeTextureParameter_TextureType>`
.. _class_VisualShaderNodeTextureParameter_constant_TYPE_DATA:
.. rst-class:: classref-enumeration-constant
:ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **TYPE_DATA** = ``0``
No hints are added to the uniform declaration.
.. _class_VisualShaderNodeTextureParameter_constant_TYPE_COLOR:
.. rst-class:: classref-enumeration-constant
:ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **TYPE_COLOR** = ``1``
Adds ``source_color`` as hint to the uniform declaration for proper conversion from nonlinear sRGB encoding to linear encoding.
.. _class_VisualShaderNodeTextureParameter_constant_TYPE_NORMAL_MAP:
.. rst-class:: classref-enumeration-constant
:ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **TYPE_NORMAL_MAP** = ``2``
Adds ``hint_normal`` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map.
.. _class_VisualShaderNodeTextureParameter_constant_TYPE_ANISOTROPY:
.. rst-class:: classref-enumeration-constant
:ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **TYPE_ANISOTROPY** = ``3``
Adds ``hint_anisotropy`` as hint to the uniform declaration to use for a flowmap.
.. _class_VisualShaderNodeTextureParameter_constant_TYPE_MAX:
.. rst-class:: classref-enumeration-constant
:ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **TYPE_MAX** = ``4``
Represents the size of the :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` enum.
.. rst-class:: classref-item-separator
----
.. _enum_VisualShaderNodeTextureParameter_ColorDefault:
.. rst-class:: classref-enumeration
enum **ColorDefault**: :ref:`🔗<enum_VisualShaderNodeTextureParameter_ColorDefault>`
.. _class_VisualShaderNodeTextureParameter_constant_COLOR_DEFAULT_WHITE:
.. rst-class:: classref-enumeration-constant
:ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **COLOR_DEFAULT_WHITE** = ``0``
Defaults to fully opaque white color.
.. _class_VisualShaderNodeTextureParameter_constant_COLOR_DEFAULT_BLACK:
.. rst-class:: classref-enumeration-constant
:ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **COLOR_DEFAULT_BLACK** = ``1``
Defaults to fully opaque black color.
.. _class_VisualShaderNodeTextureParameter_constant_COLOR_DEFAULT_TRANSPARENT:
.. rst-class:: classref-enumeration-constant
:ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **COLOR_DEFAULT_TRANSPARENT** = ``2``
Defaults to fully transparent black color.
.. _class_VisualShaderNodeTextureParameter_constant_COLOR_DEFAULT_MAX:
.. rst-class:: classref-enumeration-constant
:ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **COLOR_DEFAULT_MAX** = ``3``
Represents the size of the :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` enum.
.. rst-class:: classref-item-separator
----
.. _enum_VisualShaderNodeTextureParameter_TextureFilter:
.. rst-class:: classref-enumeration
enum **TextureFilter**: :ref:`🔗<enum_VisualShaderNodeTextureParameter_TextureFilter>`
.. _class_VisualShaderNodeTextureParameter_constant_FILTER_DEFAULT:
.. rst-class:: classref-enumeration-constant
:ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_DEFAULT** = ``0``
Sample the texture using the filter determined by the node this shader is attached to.
.. _class_VisualShaderNodeTextureParameter_constant_FILTER_NEAREST:
.. rst-class:: classref-enumeration-constant
:ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_NEAREST** = ``1``
The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled).
.. _class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR:
.. rst-class:: classref-enumeration-constant
:ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_LINEAR** = ``2``
The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled).
.. _class_VisualShaderNodeTextureParameter_constant_FILTER_NEAREST_MIPMAP:
.. rst-class:: classref-enumeration-constant
:ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_NEAREST_MIPMAP** = ``3``
The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter<class_ProjectSettings_property_rendering/textures/default_filters/use_nearest_mipmap_filter>` is ``true``). This makes the texture look pixelated from up close, and smooth from a distance.
Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D<class_Camera2D>` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.
.. _class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR_MIPMAP:
.. rst-class:: classref-enumeration-constant
:ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_LINEAR_MIPMAP** = ``4``
The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter<class_ProjectSettings_property_rendering/textures/default_filters/use_nearest_mipmap_filter>` is ``true``). This makes the texture look smooth from up close, and smooth from a distance.
Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to :ref:`Camera2D<class_Camera2D>` zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.
.. _class_VisualShaderNodeTextureParameter_constant_FILTER_NEAREST_MIPMAP_ANISOTROPIC:
.. rst-class:: classref-enumeration-constant
:ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_NEAREST_MIPMAP_ANISOTROPIC** = ``5``
The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter<class_ProjectSettings_property_rendering/textures/default_filters/use_nearest_mipmap_filter>` is ``true``) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level<class_ProjectSettings_property_rendering/textures/default_filters/anisotropic_filtering_level>`.
\ **Note:** This texture filter is rarely useful in 2D projects. :ref:`FILTER_NEAREST_MIPMAP<class_VisualShaderNodeTextureParameter_constant_FILTER_NEAREST_MIPMAP>` is usually more appropriate in this case.
.. _class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR_MIPMAP_ANISOTROPIC:
.. rst-class:: classref-enumeration-constant
:ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_LINEAR_MIPMAP_ANISOTROPIC** = ``6``
The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if :ref:`ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter<class_ProjectSettings_property_rendering/textures/default_filters/use_nearest_mipmap_filter>` is ``true``) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting :ref:`ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level<class_ProjectSettings_property_rendering/textures/default_filters/anisotropic_filtering_level>`.
\ **Note:** This texture filter is rarely useful in 2D projects. :ref:`FILTER_LINEAR_MIPMAP<class_VisualShaderNodeTextureParameter_constant_FILTER_LINEAR_MIPMAP>` is usually more appropriate in this case.
.. _class_VisualShaderNodeTextureParameter_constant_FILTER_MAX:
.. rst-class:: classref-enumeration-constant
:ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **FILTER_MAX** = ``7``
Represents the size of the :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` enum.
.. rst-class:: classref-item-separator
----
.. _enum_VisualShaderNodeTextureParameter_TextureRepeat:
.. rst-class:: classref-enumeration
enum **TextureRepeat**: :ref:`🔗<enum_VisualShaderNodeTextureParameter_TextureRepeat>`
.. _class_VisualShaderNodeTextureParameter_constant_REPEAT_DEFAULT:
.. rst-class:: classref-enumeration-constant
:ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **REPEAT_DEFAULT** = ``0``
Sample the texture using the repeat mode determined by the node this shader is attached to.
.. _class_VisualShaderNodeTextureParameter_constant_REPEAT_ENABLED:
.. rst-class:: classref-enumeration-constant
:ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **REPEAT_ENABLED** = ``1``
Texture will repeat normally.
.. _class_VisualShaderNodeTextureParameter_constant_REPEAT_DISABLED:
.. rst-class:: classref-enumeration-constant
:ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **REPEAT_DISABLED** = ``2``
Texture will not repeat.
.. _class_VisualShaderNodeTextureParameter_constant_REPEAT_MAX:
.. rst-class:: classref-enumeration-constant
:ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **REPEAT_MAX** = ``3``
Represents the size of the :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` enum.
.. rst-class:: classref-item-separator
----
.. _enum_VisualShaderNodeTextureParameter_TextureSource:
.. rst-class:: classref-enumeration
enum **TextureSource**: :ref:`🔗<enum_VisualShaderNodeTextureParameter_TextureSource>`
.. _class_VisualShaderNodeTextureParameter_constant_SOURCE_NONE:
.. rst-class:: classref-enumeration-constant
:ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_NONE** = ``0``
The texture source is not specified in the shader.
.. _class_VisualShaderNodeTextureParameter_constant_SOURCE_SCREEN:
.. rst-class:: classref-enumeration-constant
:ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_SCREEN** = ``1``
The texture source is the screen texture which captures all opaque objects drawn this frame.
.. _class_VisualShaderNodeTextureParameter_constant_SOURCE_DEPTH:
.. rst-class:: classref-enumeration-constant
:ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_DEPTH** = ``2``
The texture source is the depth texture from the depth prepass.
.. _class_VisualShaderNodeTextureParameter_constant_SOURCE_NORMAL_ROUGHNESS:
.. rst-class:: classref-enumeration-constant
:ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_NORMAL_ROUGHNESS** = ``3``
The texture source is the normal-roughness buffer from the depth prepass.
.. _class_VisualShaderNodeTextureParameter_constant_SOURCE_MAX:
.. rst-class:: classref-enumeration-constant
:ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **SOURCE_MAX** = ``4``
Represents the size of the :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` enum.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_VisualShaderNodeTextureParameter_property_color_default:
.. rst-class:: classref-property
:ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **color_default** = ``0`` :ref:`🔗<class_VisualShaderNodeTextureParameter_property_color_default>`
.. rst-class:: classref-property-setget
- |void| **set_color_default**\ (\ value\: :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>`\ )
- :ref:`ColorDefault<enum_VisualShaderNodeTextureParameter_ColorDefault>` **get_color_default**\ (\ )
Sets the default color if no texture is assigned to the uniform.
.. rst-class:: classref-item-separator
----
.. _class_VisualShaderNodeTextureParameter_property_texture_filter:
.. rst-class:: classref-property
:ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **texture_filter** = ``0`` :ref:`🔗<class_VisualShaderNodeTextureParameter_property_texture_filter>`
.. rst-class:: classref-property-setget
- |void| **set_texture_filter**\ (\ value\: :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>`\ )
- :ref:`TextureFilter<enum_VisualShaderNodeTextureParameter_TextureFilter>` **get_texture_filter**\ (\ )
Sets the texture filtering mode.
.. rst-class:: classref-item-separator
----
.. _class_VisualShaderNodeTextureParameter_property_texture_repeat:
.. rst-class:: classref-property
:ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **texture_repeat** = ``0`` :ref:`🔗<class_VisualShaderNodeTextureParameter_property_texture_repeat>`
.. rst-class:: classref-property-setget
- |void| **set_texture_repeat**\ (\ value\: :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>`\ )
- :ref:`TextureRepeat<enum_VisualShaderNodeTextureParameter_TextureRepeat>` **get_texture_repeat**\ (\ )
Sets the texture repeating mode.
.. rst-class:: classref-item-separator
----
.. _class_VisualShaderNodeTextureParameter_property_texture_source:
.. rst-class:: classref-property
:ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **texture_source** = ``0`` :ref:`🔗<class_VisualShaderNodeTextureParameter_property_texture_source>`
.. rst-class:: classref-property-setget
- |void| **set_texture_source**\ (\ value\: :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>`\ )
- :ref:`TextureSource<enum_VisualShaderNodeTextureParameter_TextureSource>` **get_texture_source**\ (\ )
Sets the texture source mode. Used for reading from the screen, depth, or normal_roughness texture.
.. rst-class:: classref-item-separator
----
.. _class_VisualShaderNodeTextureParameter_property_texture_type:
.. rst-class:: classref-property
:ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **texture_type** = ``0`` :ref:`🔗<class_VisualShaderNodeTextureParameter_property_texture_type>`
.. rst-class:: classref-property-setget
- |void| **set_texture_type**\ (\ value\: :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>`\ )
- :ref:`TextureType<enum_VisualShaderNodeTextureParameter_TextureType>` **get_texture_type**\ (\ )
Defines the type of data provided by the source texture.
.. |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.)`