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.
Checking the stable version of the documentation...
VisualShaderNodeTexture
继承: VisualShaderNode < Resource < RefCounted < Object
在可视化着色器图中,执行 2D 纹理查找。
描述
对提供的纹理进行查找操作,支持从多个纹理源选择。
属性
|
||
|
枚举
enum Source: 🔗
Source SOURCE_TEXTURE = 0
使用给定的纹理作为此函数的参数。
Source SOURCE_SCREEN = 1
使用当前视口的纹理作为源。
Source SOURCE_2D_TEXTURE = 2
使用该着色器内置纹理中的纹理(例如 Sprite2D 的纹理)。
Source SOURCE_2D_NORMAL = 3
使用该着色器内置的法线贴图的纹理。
Source SOURCE_DEPTH = 4
使用在深度预处理过程中捕获的深度纹理。只有在使用深度预处理时才可用(即在空间着色器和 forward_plus 或 gl_compatibility 渲染器中)。
Source SOURCE_PORT = 5
将输入端口中提供的纹理用于此函数。
Source SOURCE_3D_NORMAL = 6
使用在深度预处理过程中捕获的法线缓冲区。只有在法线粗糙度缓冲区可用时才可用(即在空间着色器和 forward_plus 渲染器中)。
Source SOURCE_ROUGHNESS = 7
使用在深度预处理过程中捕获的粗糙度缓冲区。仅当法线粗糙度缓冲区可用时才可用(即在空间着色器和 forward_plus 渲染器中)。
Source SOURCE_MAX = 8
代表 Source 枚举的大小。
enum TextureType: 🔗
TextureType TYPE_DATA = 0
在uniform声明中未添加提示。
TextureType TYPE_COLOR = 1
向该 uniform 声明添加 source_color
提示,用于进行正确的 sRGB 到线性颜色空间的转换。
TextureType TYPE_NORMAL_MAP = 2
将 hint_normal
作为提示添加到 uniform 声明中,该声明在内部将纹理转换为法线贴图。
TextureType TYPE_MAX = 3
代表 TextureType 枚举的大小。
属性说明
确定查询的源。有关选项,请参阅 Source。
源纹理,如果需要的话,用于选定的source。
TextureType texture_type = 0
🔗
void set_texture_type(value: TextureType)
TextureType get_texture_type()
如果source被设置为SOURCE_TEXTURE,则指定纹理的类型。有关选项,请参阅 TextureType。