Up to date
This page is up to date for Godot 4.1
.
If you still find outdated information, please open an issue.
BaseMaterial3D¶
Inherits: Material < Resource < RefCounted < Object
Inherited By: ORMMaterial3D, StandardMaterial3D
Default 3D rendering material.
Description¶
This provides a default material with a wide variety of rendering features and properties without the need to write shader code. See the tutorial below for details.
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods¶
get_feature ( Feature feature ) const |
|
get_texture ( TextureParam param ) const |
|
void |
set_feature ( Feature feature, bool enable ) |
void |
|
void |
set_texture ( TextureParam param, Texture2D texture ) |
Enumerations¶
enum TextureParam:
TextureParam TEXTURE_ALBEDO = 0
Texture specifying per-pixel color.
TextureParam TEXTURE_METALLIC = 1
Texture specifying per-pixel metallic value.
TextureParam TEXTURE_ROUGHNESS = 2
Texture specifying per-pixel roughness value.
TextureParam TEXTURE_EMISSION = 3
Texture specifying per-pixel emission color.
TextureParam TEXTURE_NORMAL = 4
Texture specifying per-pixel normal vector.
TextureParam TEXTURE_RIM = 5
Texture specifying per-pixel rim value.
TextureParam TEXTURE_CLEARCOAT = 6
Texture specifying per-pixel clearcoat value.
TextureParam TEXTURE_FLOWMAP = 7
Texture specifying per-pixel flowmap direction for use with anisotropy.
TextureParam TEXTURE_AMBIENT_OCCLUSION = 8
Texture specifying per-pixel ambient occlusion value.
TextureParam TEXTURE_HEIGHTMAP = 9
Texture specifying per-pixel height.
TextureParam TEXTURE_SUBSURFACE_SCATTERING = 10
Texture specifying per-pixel subsurface scattering.
TextureParam TEXTURE_SUBSURFACE_TRANSMITTANCE = 11
Texture specifying per-pixel transmittance for subsurface scattering.
TextureParam TEXTURE_BACKLIGHT = 12
Texture specifying per-pixel backlight color.
TextureParam TEXTURE_REFRACTION = 13
Texture specifying per-pixel refraction strength.
TextureParam TEXTURE_DETAIL_MASK = 14
Texture specifying per-pixel detail mask blending value.
TextureParam TEXTURE_DETAIL_ALBEDO = 15
Texture specifying per-pixel detail color.
TextureParam TEXTURE_DETAIL_NORMAL = 16
Texture specifying per-pixel detail normal.
TextureParam TEXTURE_ORM = 17
Texture holding ambient occlusion, roughness, and metallic.
TextureParam TEXTURE_MAX = 18
Represents the size of the TextureParam enum.
enum TextureFilter:
TextureFilter TEXTURE_FILTER_NEAREST = 0
The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering, but the texture will look pixelized.
TextureFilter TEXTURE_FILTER_LINEAR = 1
The texture filter blends between the nearest 4 pixels. Use this when you want to avoid a pixelated style, but do not want mipmaps.
TextureFilter TEXTURE_FILTER_NEAREST_WITH_MIPMAPS = 2
The texture filter reads from the nearest pixel in the nearest mipmap. The fastest way to read from textures with mipmaps.
TextureFilter TEXTURE_FILTER_LINEAR_WITH_MIPMAPS = 3
The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. Use this for most cases as mipmaps are important to smooth out pixels that are far from the camera.
TextureFilter TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC = 4
The texture filter reads from the nearest pixel, but selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. The anisotropic filtering level can be changed by adjusting ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level.
TextureFilter TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC = 5
The texture filter blends between the nearest 4 pixels and selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. This is the slowest of the filtering options, but results in the highest quality texturing. The anisotropic filtering level can be changed by adjusting ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level.
TextureFilter TEXTURE_FILTER_MAX = 6
Represents the size of the TextureFilter enum.
enum DetailUV:
DetailUV DETAIL_UV_1 = 0
Use UV
with the detail texture.
DetailUV DETAIL_UV_2 = 1
Use UV2
with the detail texture.
enum Transparency:
Transparency TRANSPARENCY_DISABLED = 0
The material will not use transparency. This is the fastest to render.
Transparency TRANSPARENCY_ALPHA = 1
The material will use the texture's alpha values for transparency. This is the slowest to render, and disables shadow casting.
Transparency TRANSPARENCY_ALPHA_SCISSOR = 2
The material will cut off all values below a threshold, the rest will remain opaque. The opaque portions will be rendered in the depth prepass. This is faster to render than alpha blending, but slower than opaque rendering. This also supports casting shadows.