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...
BaseMaterial3D¶
继承: Material < Resource < RefCounted < Object
派生: ORMMaterial3D, StandardMaterial3D
用于定义网格 3D 渲染属性的抽象基类。
描述¶
这个类提供了默认的材质,具有多种渲染功能和属性,无需编写着色器代码。详情见下面的教程。
教程¶
属性¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
方法¶
get_feature(feature: Feature) const |
|
get_texture(param: TextureParam) const |
|
void |
set_feature(feature: Feature, enable: bool) |
void |
|
void |
set_texture(param: TextureParam, texture: Texture2D) |
枚举¶
enum TextureParam: 🔗
TextureParam TEXTURE_ALBEDO = 0
指定每个像素颜色的纹理。
TextureParam TEXTURE_METALLIC = 1
指定每个像素金属度值的纹理。
TextureParam TEXTURE_ROUGHNESS = 2
指定每个像素粗糙度值的纹理。
TextureParam TEXTURE_EMISSION = 3
指定每个像素自发光颜色的纹理。
TextureParam TEXTURE_NORMAL = 4
指定每个像素法向量的纹理。
TextureParam TEXTURE_RIM = 5
指定每个像素边缘值的纹理。
TextureParam TEXTURE_CLEARCOAT = 6
指定每个像素清漆值的纹理。
TextureParam TEXTURE_FLOWMAP = 7
指定每个像素流图方向的纹理,用于 anisotropy。
TextureParam TEXTURE_AMBIENT_OCCLUSION = 8
指定每个像素环境光遮蔽的纹理。
TextureParam TEXTURE_HEIGHTMAP = 9
指定每个像素高度的纹理。
TextureParam TEXTURE_SUBSURFACE_SCATTERING = 10
指定每个像素次表面散射的纹理。
TextureParam TEXTURE_SUBSURFACE_TRANSMITTANCE = 11
指定每个像素用于次表面散射的透射率的纹理。
TextureParam TEXTURE_BACKLIGHT = 12
指定每个像素背光颜色的纹理。
TextureParam TEXTURE_REFRACTION = 13
指定每个像素折射强度的纹理。
TextureParam TEXTURE_DETAIL_MASK = 14
指定每个像素细节蒙版混合值的纹理。
TextureParam TEXTURE_DETAIL_ALBEDO = 15
指定每个像素细节颜色的纹理。
TextureParam TEXTURE_DETAIL_NORMAL = 16
指定每个像素细节法线的纹理。
TextureParam TEXTURE_ORM = 17
保存环境光遮蔽、粗糙度和金属度信息的纹理。
TextureParam TEXTURE_MAX = 18
代表 TextureParam 枚举的大小。
enum TextureFilter: 🔗
TextureFilter TEXTURE_FILTER_NEAREST = 0
纹理过滤仅从最近的像素读取。这使得纹理从近距离看是像素化的,从远处看是颗粒状的(由于多级渐远纹理没有被采样)。
TextureFilter TEXTURE_FILTER_LINEAR = 1
纹理过滤在最近的 4 个像素之间进行混合。这使得纹理从近处看起来很平滑,从远处看起来却有颗粒感(由于多级渐远纹理没有被采样)。
TextureFilter TEXTURE_FILTER_NEAREST_WITH_MIPMAPS = 2
纹理过滤从最近的像素读取并在最近的 2 个多级渐远纹理之间进行混合(或者如果 ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter 为 true
,则使用最近的多级渐远纹理)。这使得纹理从近处看起来像素化,从远处看起来平滑。
TextureFilter TEXTURE_FILTER_LINEAR_WITH_MIPMAPS = 3