Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

VisualShaderNodeTextureParameter

繼承: VisualShaderNodeParameter < VisualShaderNode < Resource < RefCounted < Object

被繼承: VisualShaderNodeCubemapParameter, VisualShaderNodeTexture2DArrayParameter, VisualShaderNodeTexture2DParameter, VisualShaderNodeTexture3DParameter, VisualShaderNodeTextureParameterTriplanar

在視覺化著色器圖中執行 uniform 的紋理搜尋。

說明

對作為 uniform 著色器提供的紋理進行搜尋操作。

屬性

ColorDefault

color_default

0

TextureFilter

texture_filter

0

TextureRepeat

texture_repeat

0

TextureSource

texture_source

0

TextureType

texture_type

0


列舉

enum TextureType: 🔗

TextureType TYPE_DATA = 0

在uniform宣告中未新增提示。

TextureType TYPE_COLOR = 1

Adds source_color as hint to the uniform declaration for proper conversion from nonlinear sRGB encoding to linear encoding.

TextureType TYPE_NORMAL_MAP = 2

hint_normal 作為提示新增到 uniform 宣告中,該宣告在內部將紋理轉換為法線貼圖。

TextureType TYPE_ANISOTROPY = 3

向該 uniform 宣告新增 hint_anisotropy 提示,用於流向圖。

TextureType TYPE_MAX = 4

代表 TextureType 列舉的大小。


enum ColorDefault: 🔗

ColorDefault COLOR_DEFAULT_WHITE = 0

預設為完全不透明的白色。

ColorDefault COLOR_DEFAULT_BLACK = 1

預設為完全不透明的黑色。

ColorDefault COLOR_DEFAULT_TRANSPARENT = 2

預設為完全透明的黑色。

ColorDefault COLOR_DEFAULT_MAX = 3

代表 ColorDefault 列舉的大小。


enum TextureFilter: 🔗

TextureFilter FILTER_DEFAULT = 0

使用由該著色器所附加到的節點決定的篩檢程式對紋理進行取樣。

TextureFilter FILTER_NEAREST = 1

紋理僅取最鄰近像素,近看呈現馬賽克,遠處因未取樣 mipmap 而顯得顆粒。

TextureFilter FILTER_LINEAR = 2

紋理在最鄰近 4 像素間插值,近看平滑,遠處因未取樣 mipmap 仍顆粒。

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 ProjectSettings.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 Camera2D zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.

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 ProjectSettings.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 Camera2D zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.

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 ProjectSettings.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 ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level.

Note: This texture filter is rarely useful in 2D projects. FILTER_NEAREST_MIPMAP is usually more appropriate in this case.

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 ProjectSettings.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 ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level.

Note: This texture filter is rarely useful in 2D projects. FILTER_LINEAR_MIPMAP is usually more appropriate in this case.

TextureFilter FILTER_MAX = 7

代表 TextureFilter 列舉的大小。


enum TextureRepeat: 🔗

TextureRepeat REPEAT_DEFAULT = 0

使用由該著色器所附加到的節點決定的重複模式對該紋理進行取樣。

TextureRepeat REPEAT_ENABLED = 1

紋理將正常重複。

TextureRepeat REPEAT_DISABLED = 2

紋理不會重複。

TextureRepeat REPEAT_MAX = 3

代表 TextureRepeat 列舉的大小。


enum TextureSource: 🔗

TextureSource SOURCE_NONE = 0

著色器中未指定紋理源。

TextureSource SOURCE_SCREEN = 1

紋理源為螢幕紋理,捕獲了本影格中繪製的所有不透明物件。

TextureSource SOURCE_DEPTH = 2

紋理源為深度預處理階段的深度紋理。

TextureSource SOURCE_NORMAL_ROUGHNESS = 3

紋理源為深度預處理階段的法線粗糙度緩衝區。

TextureSource SOURCE_MAX = 4

代表 TextureSource 列舉的大小。


屬性說明

ColorDefault color_default = 0 🔗

如果沒有給 uniform 分配紋理,則設定預設顏色。


TextureFilter texture_filter = 0 🔗

Sets the texture filtering mode.


TextureRepeat texture_repeat = 0 🔗

Sets the texture repeating mode.


TextureSource texture_source = 0 🔗

Sets the texture source mode. Used for reading from the screen, depth, or normal_roughness texture.


TextureType texture_type = 0 🔗

Defines the type of data provided by the source texture.