VisualShaderNodeTexture

Inherits: VisualShaderNode < Resource < RefCounted < Object

Performs a 2D texture lookup within the visual shader graph.

Description

Performs a lookup operation on the provided texture, with support for multiple texture sources to choose from.

Properties

Source

source

0

Texture2D

texture

TextureType

texture_type

0

Enumerations

enum Source:

  • SOURCE_TEXTURE = 0 --- Use the texture given as an argument for this function.

  • SOURCE_SCREEN = 1 --- Use the current viewport's texture as the source.

  • SOURCE_2D_TEXTURE = 2 --- Use the texture from this shader's texture built-in (e.g. a texture of a Sprite2D).

  • SOURCE_2D_NORMAL = 3 --- Use the texture from this shader's normal map built-in.

  • SOURCE_DEPTH = 4 --- Use the depth texture available for this shader.

  • SOURCE_PORT = 5 --- Use the texture provided in the input port for this function.

  • SOURCE_MAX = 6 --- Represents the size of the Source enum.


enum TextureType:

  • TYPE_DATA = 0 --- No hints are added to the uniform declaration.

  • TYPE_COLOR = 1 --- Adds hint_albedo as hint to the uniform declaration for proper sRGB to linear conversion.

  • TYPE_NORMAL_MAP = 2 --- Adds hint_normal as hint to the uniform declaration, which internally converts the texture for proper usage as normal map.

  • TYPE_MAX = 3 --- Represents the size of the TextureType enum.

Property Descriptions

Default

0

Setter

set_source(value)

Getter

get_source()

Determines the source for the lookup. See Source for options.


Setter

set_texture(value)

Getter

get_texture()

The source texture, if needed for the selected source.


Default

0

Setter

set_texture_type(value)

Getter

get_texture_type()

Specifies the type of the texture if source is set to SOURCE_TEXTURE. See TextureType for options.