BaseMaterial3D

Inherits:Material<Resource<RefCounted<Object

Inherited By:ORMMaterial3D,StandardMaterial3D

Abstract base class for defining the 3D rendering properties of meshes.

Description

This class serves as 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

Color

albedo_color

Color(1,1,1,1)

Texture2D

albedo_texture

bool

albedo_texture_force_srgb

false

bool

albedo_texture_msdf

false

float

alpha_antialiasing_edge

AlphaAntiAliasing

alpha_antialiasing_mode

float

alpha_hash_scale

float

alpha_scissor_threshold

float

anisotropy

0.0

bool

anisotropy_enabled

false

Texture2D

anisotropy_flowmap

bool

ao_enabled

false

float

ao_light_affect

0.0

bool

ao_on_uv2

false

Texture2D

ao_texture

TextureChannel

ao_texture_channel

0

Color

backlight

Color(0,0,0,1)

bool

backlight_enabled

false

Texture2D

backlight_texture

bool

billboard_keep_scale

false

BillboardMode

billboard_mode

0

BlendMode

blend_mode

0

float

clearcoat

1.0

bool

clearcoat_enabled

false

float

clearcoat_roughness

0.5

Texture2D

clearcoat_texture

CullMode

cull_mode

0

DepthDrawMode

depth_draw_mode

0

Texture2D

detail_albedo

BlendMode

detail_blend_mode

0

bool

detail_enabled

false

Texture2D

detail_mask

Texture2D

detail_normal

DetailUV

detail_uv_layer

0

DiffuseMode

diffuse_mode

0

bool

disable_ambient_light

false

bool

disable_fog

false

bool

disable_receive_shadows

false

float

distance_fade_max_distance

10.0

float

distance_fade_min_distance

0.0

DistanceFadeMode

distance_fade_mode

0

Color

emission

Color(0,0,0,1)

bool

emission_enabled

false

float

emission_energy_multiplier

1.0

float

emission_intensity

bool

emission_on_uv2

false

EmissionOperator

emission_operator

0

Texture2D

emission_texture

bool

fixed_size

false

bool

grow

false

float

grow_amount

0.0

bool

heightmap_deep_parallax

false

bool

heightmap_enabled

false

bool

heightmap_flip_binormal

false

bool

heightmap_flip_tangent

false

bool

heightmap_flip_texture

false

int

heightmap_max_layers

int

heightmap_min_layers

float

heightmap_scale

5.0

Texture2D

heightmap_texture

float

metallic

0.0

float

metallic_specular

0.5

Texture2D

metallic_texture

TextureChannel

metallic_texture_channel

0

float

msdf_outline_size

0.0

float

msdf_pixel_range

4.0

bool

no_depth_test

false

bool

normal_enabled

false

float

normal_scale

1.0

Texture2D

normal_texture

Texture2D

orm_texture

int

particles_anim_h_frames

bool

particles_anim_loop

int

particles_anim_v_frames

float

point_size

1.0

float

proximity_fade_distance

1.0

bool

proximity_fade_enabled

false

bool

refraction_enabled

false

float

refraction_scale

0.05

Texture2D

refraction_texture

TextureChannel

refraction_texture_channel

0

float

rim

1.0

bool

rim_enabled

false

Texture2D

rim_texture

float

rim_tint

0.5

float

roughness

1.0

Texture2D

roughness_texture

TextureChannel

roughness_texture_channel

0

ShadingMode

shading_mode

1

bool

shadow_to_opacity

false

SpecularMode

specular_mode

0

bool

subsurf_scatter_enabled

false

bool

subsurf_scatter_skin_mode

false

float

subsurf_scatter_strength

0.0

Texture2D

subsurf_scatter_texture

float

subsurf_scatter_transmittance_boost

0.0

Color

subsurf_scatter_transmittance_color

Color(1,1,1,1)

float

subsurf_scatter_transmittance_depth

0.1

bool

subsurf_scatter_transmittance_enabled

false

Texture2D

subsurf_scatter_transmittance_texture

TextureFilter

texture_filter

3

bool

texture_repeat

true

Transparency

transparency

0

bool

use_particle_trails

false

bool

use_point_size

false

Vector3

uv1_offset

Vector3(0,0,0)

Vector3

uv1_scale

Vector3(1,1,1)

bool

uv1_triplanar

false

float

uv1_triplanar_sharpness

1.0

bool

uv1_world_triplanar

false

Vector3

uv2_offset

Vector3(0,0,0)

Vector3

uv2_scale

Vector3(1,1,1)

bool

uv2_triplanar

false

float

uv2_triplanar_sharpness

1.0

bool

uv2_world_triplanar

false

bool

vertex_color_is_srgb

false

bool

vertex_color_use_as_albedo

false

Methods

bool

get_feature(feature:Feature)const

bool

get_flag(flag:Flags)const

Texture2D

get_texture(param:TextureParam)const

void

set_feature(feature:Feature, enable:bool)

void

set_flag(flag:Flags, enable:bool)

void

set_texture(param:TextureParam, texture:Texture2D)


Enumerations

enumTextureParam:🔗

TextureParamTEXTURE_ALBEDO =0

Texture specifying per-pixel color.

TextureParamTEXTURE_METALLIC =1

Texture specifying per-pixel metallic value.

TextureParamTEXTURE_ROUGHNESS =2

Texture specifying per-pixel roughness value.

TextureParamTEXTURE_EMISSION =3

Texture specifying per-pixel emission color.

TextureParamTEXTURE_NORMAL =4

Texture specifying per-pixel normal vector.

TextureParamTEXTURE_RIM =5

Texture specifying per-pixel rim value.

TextureParamTEXTURE_CLEARCOAT =6

Texture specifying per-pixel clearcoat value.

TextureParamTEXTURE_FLOWMAP =7

Texture specifying per-pixel flowmap direction for use withanisotropy.

TextureParamTEXTURE_AMBIENT_OCCLUSION =8

Texture specifying per-pixel ambient occlusion value.

TextureParamTEXTURE_HEIGHTMAP =9

Texture specifying per-pixel height.

TextureParamTEXTURE_SUBSURFACE_SCATTERING =10

Texture specifying per-pixel subsurface scattering.

TextureParamTEXTURE_SUBSURFACE_TRANSMITTANCE =11

Texture specifying per-pixel transmittance for subsurface scattering.

TextureParamTEXTURE_BACKLIGHT =12

Texture specifying per-pixel backlight color.

TextureParamTEXTURE_REFRACTION =13

Texture specifying per-pixel refraction strength.

TextureParamTEXTURE_DETAIL_MASK =14

Texture specifying per-pixel detail mask blending value.

TextureParamTEXTURE_DETAIL_ALBEDO =15

Texture specifying per-pixel detail color.

TextureParamTEXTURE_DETAIL_NORMAL =16

Texture specifying per-pixel detail normal.

TextureParamTEXTURE_ORM =17

Texture holding ambient occlusion, roughness, and metallic.

TextureParamTEXTURE_MAX =18

Represents the size of theTextureParam enum.


enumTextureFilter:🔗

TextureFilterTEXTURE_FILTER_NEAREST =0

The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled).

TextureFilterTEXTURE_FILTER_LINEAR =1

The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled).

TextureFilterTEXTURE_FILTER_NEAREST_WITH_MIPMAPS =2

The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap ifProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter istrue). This makes the texture look pixelated from up close, and smooth from a distance.

TextureFilterTEXTURE_FILTER_LINEAR_WITH_MIPMAPS =3

The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap ifProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter istrue). This makes the texture look smooth from up close, and smooth from a distance.

TextureFilterTEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC =4

The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap ifProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter istrue) 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 adjustingProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level.

TextureFilterTEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC =5

The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap ifProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter istrue) 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 adjustingProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level.

TextureFilterTEXTURE_FILTER_MAX =6

Represents the size of theTextureFilter enum.


enumDetailUV:🔗

DetailUVDETAIL_UV_1 =0

UseUV with the detail texture.

DetailUVDETAIL_UV_2 =1

UseUV2 with the detail texture.


enumTransparency:🔗

TransparencyTRANSPARENCY_DISABLED =0

The material will not use transparency. This is the fastest to render.

TransparencyTRANSPARENCY_ALPHA =1

The material will use the texture's alpha values for transparency. This is the slowest to render, and disables shadow casting.

TransparencyTRANSPARENCY_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.

TransparencyTRANSPARENCY_ALPHA_HASH =3

The material will cut off all values below a spatially-deterministic threshold, the rest will remain opaque. This is faster to render than alpha blending, but slower than opaque rendering. This also supports casting shadows. Alpha hashing is suited for hair rendering.

TransparencyTRANSPARENCY_ALPHA_DEPTH_PRE_PASS =4

The material will use the texture's alpha value for transparency, but will discard fragments with an alpha of less than 0.99 during the depth prepass and fragments with an alpha less than 0.1 during the shadow pass. This also supports casting shadows.

TransparencyTRANSPARENCY_MAX =5

Represents the size of theTransparency enum.


enumShadingMode:🔗

ShadingModeSHADING_MODE_UNSHADED =0

The object will not receive shadows. This is the fastest to render, but it disables all interactions with lights.

ShadingModeSHADING_MODE_PER_PIXEL =1

The object will be shaded per pixel. Useful for realistic shading effects.

ShadingModeSHADING_MODE_PER_VERTEX =2

The object will be shaded per vertex. Useful when you want cheaper shaders and do not care about visual quality.

ShadingModeSHADING_MODE_MAX =3

Represents the size of theShadingMode enum.


enumFeature:🔗

FeatureFEATURE_EMISSION =0

Constant for settingemission_enabled.

FeatureFEATURE_NORMAL_MAPPING =1

Constant for settingnormal_enabled.

FeatureFEATURE_RIM =2

Constant for settingrim_enabled.

FeatureFEATURE_CLEARCOAT =3

Constant for settingclearcoat_enabled.

FeatureFEATURE_ANISOTROPY =4

Constant for settinganisotropy_enabled.

FeatureFEATURE_AMBIENT_OCCLUSION =5

Constant for settingao_enabled.

FeatureFEATURE_HEIGHT_MAPPING =6

Constant for settingheightmap_enabled.

FeatureFEATURE_SUBSURFACE_SCATTERING =7

Constant for settingsubsurf_scatter_enabled.

FeatureFEATURE_SUBSURFACE_TRANSMITTANCE =8

Constant for settingsubsurf_scatter_transmittance_enabled.

FeatureFEATURE_BACKLIGHT =9

Constant for settingbacklight_enabled.

FeatureFEATURE_REFRACTION =10

Constant for settingrefraction_enabled.

FeatureFEATURE_DETAIL =11

Constant for settingdetail_enabled.

FeatureFEATURE_MAX =12

Represents the size of theFeature enum.


enumBlendMode:🔗

BlendModeBLEND_MODE_MIX =0

Default blend mode. The color of the object is blended over the background based on the object's alpha value.

BlendModeBLEND_MODE_ADD =1

The color of the object is added to the background.

BlendModeBLEND_MODE_SUB =2

The color of the object is subtracted from the background.

BlendModeBLEND_MODE_MUL =3

The color of the object is multiplied by the background.

BlendModeBLEND_MODE_PREMULT_ALPHA =4

The color of the object is added to the background and the alpha channel is used to mask out the background. This is effectively a hybrid of the blend mix and add modes, useful for effects like fire where you want the flame to add but the smoke to mix. By default, this works with unshaded materials using premultiplied textures. For shaded materials, use thePREMUL_ALPHA_FACTOR built-in so that lighting can be modulated as well.


enumAlphaAntiAliasing:🔗

AlphaAntiAliasingALPHA_ANTIALIASING_OFF =0

Disables Alpha AntiAliasing for the material.

AlphaAntiAliasingALPHA_ANTIALIASING_ALPHA_TO_COVERAGE =1

Enables AlphaToCoverage. Alpha values in the material are passed to the AntiAliasing sample mask.

AlphaAntiAliasingALPHA_ANTIALIASING_ALPHA_TO_COVERAGE_AND_TO_ONE =2

Enables AlphaToCoverage and forces all non-zero alpha values to1. Alpha values in the material are passed to the AntiAliasing sample mask.


enumDepthDrawMode:🔗

DepthDrawModeDEPTH_DRAW_OPAQUE_ONLY =0

Default depth draw mode. Depth is drawn only for opaque objects during the opaque prepass (if any) and during the opaque pass.

DepthDrawModeDEPTH_DRAW_ALWAYS =1

Objects will write to depth during the opaque and the transparent passes. Transparent objects that are close to the camera may obscure other transparent objects behind them.

Note: This does not influence whether transparent objects are included in the depth prepass or not. For that, seeTransparency.

DepthDrawModeDEPTH_DRAW_DISABLED =2

Objects will not write their depth to the depth buffer, even during the depth prepass (if enabled).


enumCullMode:🔗

CullModeCULL_BACK =0

Default cull mode. The back of the object is culled when not visible. Back face triangles will be culled when facing the camera. This results in only the front side of triangles being drawn. For closed-surface meshes, this means that only the exterior of the mesh will be visible.

CullModeCULL_FRONT =1

Front face triangles will be culled when facing the camera. This results in only the back side of triangles being drawn. For closed-surface meshes, this means that the interior of the mesh will be drawn instead of the exterior.

CullModeCULL_DISABLED =2

No face culling is performed; both the front face and back face will be visible.


enumFlags:🔗

FlagsFLAG_DISABLE_DEPTH_TEST =0

Disables the depth test, so this object is drawn on top of all others drawn before it. This puts the object in the transparent draw pass where it is sorted based on distance to camera. Objects drawn after it in the draw order may cover it. This also disables writing to depth.

FlagsFLAG_ALBEDO_FROM_VERTEX_COLOR =1

SetALBEDO to the per-vertex color specified in the mesh.

FlagsFLAG_SRGB_VERTEX_COLOR =2

Vertex colors are considered to be stored in sRGB color space and are converted to linear color space during rendering. See alsovertex_color_is_srgb.

Note: Only effective when using the Forward+ and Mobile rendering methods.

FlagsFLAG_USE_POINT_SIZE =3

Uses point size to alter the size of primitive points. Also changes the albedo texture lookup to usePOINT_COORD instead ofUV.

FlagsFLAG_FIXED_SIZE =4

Object is scaled by depth so that it always appears the same size on screen.

FlagsFLAG_BILLBOARD_KEEP_SCALE =5

Shader will keep the scale set for the mesh. Otherwise the scale is lost when billboarding. Only applies whenbillboard_mode isBILLBOARD_ENABLED.

FlagsFLAG_UV1_USE_TRIPLANAR =6

Use triplanar texture lookup for all texture lookups that would normally useUV.

FlagsFLAG_UV2_USE_TRIPLANAR =7

Use triplanar texture lookup for all texture lookups that would normally useUV2.

FlagsFLAG_UV1_USE_WORLD_TRIPLANAR =8

Use triplanar texture lookup for all texture lookups that would normally useUV.

FlagsFLAG_UV2_USE_WORLD_TRIPLANAR =9

Use triplanar texture lookup for all texture lookups that would normally useUV2.

FlagsFLAG_AO_ON_UV2 =10

UseUV2 coordinates to look up from theao_texture.

FlagsFLAG_EMISSION_ON_UV2 =11

UseUV2 coordinates to look up from theemission_texture.

FlagsFLAG_ALBEDO_TEXTURE_FORCE_SRGB =12

Forces the shader to convert albedo from sRGB space to linear space. See alsoalbedo_texture_force_srgb.

FlagsFLAG_DONT_RECEIVE_SHADOWS =13

Disables receiving shadows from other objects.

FlagsFLAG_DISABLE_AMBIENT_LIGHT =14

Disables receiving ambient light.

FlagsFLAG_USE_SHADOW_TO_OPACITY =15

Enables the shadow to opacity feature.

FlagsFLAG_USE_TEXTURE_REPEAT =16

Enables the texture to repeat when UV coordinates are outside the 0-1 range. If using one of the linear filtering modes, this can result in artifacts at the edges of a texture when the sampler filters across the edges of the texture.

FlagsFLAG_INVERT_HEIGHTMAP =17

Invert values read from a depth texture to convert them to height values (heightmap).

FlagsFLAG_SUBSURFACE_MODE_SKIN =18

Enables the skin mode for subsurface scattering which is used to improve the look of subsurface scattering when used for human skin.

FlagsFLAG_PARTICLE_TRAILS_MODE =19

Enables parts of the shader required forGPUParticles3D trails to function. This also requires using a mesh with appropriate skinning, such asRibbonTrailMesh orTubeTrailMesh. Enabling this feature outside of materials used inGPUParticles3D meshes will break material rendering.

FlagsFLAG_ALBEDO_TEXTURE_MSDF =20

Enables multichannel signed distance field rendering shader.

FlagsFLAG_DISABLE_FOG =21

Disables receiving depth-based or volumetric fog.

FlagsFLAG_MAX =22

Represents the size of theFlags enum.


enumDiffuseMode:🔗

DiffuseModeDIFFUSE_BURLEY =0

Default diffuse scattering algorithm.

DiffuseModeDIFFUSE_LAMBERT =1

Diffuse scattering ignores roughness.

DiffuseModeDIFFUSE_LAMBERT_WRAP =2

Extends Lambert to cover more than 90 degrees when roughness increases.

DiffuseModeDIFFUSE_TOON =3

Uses a hard cut for lighting, with smoothing affected by roughness.


enumSpecularMode:🔗

SpecularModeSPECULAR_SCHLICK_GGX =0

Default specular blob.

SpecularModeSPECULAR_TOON =1

Toon blob which changes size based on roughness.

SpecularModeSPECULAR_DISABLED =2

No specular blob. This is slightly faster to render than other specular modes.


enumBillboardMode:🔗

BillboardModeBILLBOARD_DISABLED =0

Billboard mode is disabled.

BillboardModeBILLBOARD_ENABLED =1

The object's Z axis will always face the camera.

BillboardModeBILLBOARD_FIXED_Y =2

The object's X axis will always face the camera.

BillboardModeBILLBOARD_PARTICLES =3

Used for particle systems when assigned toGPUParticles3D andCPUParticles3D nodes (flipbook animation). Enablesparticles_anim_* properties.

TheParticleProcessMaterial.anim_speed_min orCPUParticles3D.anim_speed_min should also be set to a value bigger than zero for the animation to play.


enumTextureChannel:🔗

TextureChannelTEXTURE_CHANNEL_RED =0

Used to read from the red channel of a texture.

TextureChannelTEXTURE_CHANNEL_GREEN =1

Used to read from the green channel of a texture.

TextureChannelTEXTURE_CHANNEL_BLUE =2

Used to read from the blue channel of a texture.

TextureChannelTEXTURE_CHANNEL_ALPHA =3

Used to read from the alpha channel of a texture.

TextureChannelTEXTURE_CHANNEL_GRAYSCALE =4

Used to read from the linear (non-perceptual) average of the red, green and blue channels of a texture.


enumEmissionOperator:🔗

EmissionOperatorEMISSION_OP_ADD =0

Adds the emission color to the color from the emission texture.

EmissionOperatorEMISSION_OP_MULTIPLY =1

Multiplies the emission color by the color from the emission texture.


enumDistanceFadeMode:🔗

DistanceFadeModeDISTANCE_FADE_DISABLED =0

Do not use distance fade.

DistanceFadeModeDISTANCE_FADE_PIXEL_ALPHA =1

Smoothly fades the object out based on each pixel's distance from the camera using the alpha channel.

DistanceFadeModeDISTANCE_FADE_PIXEL_DITHER =2

Smoothly fades the object out based on each pixel's distance from the camera using a dithering approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware, this can be faster thanDISTANCE_FADE_PIXEL_ALPHA.

DistanceFadeModeDISTANCE_FADE_OBJECT_DITHER =3

Smoothly fades the object out based on the object's distance from the camera using a dithering approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware, this can be faster thanDISTANCE_FADE_PIXEL_ALPHA andDISTANCE_FADE_PIXEL_DITHER.


Property Descriptions

Coloralbedo_color =Color(1,1,1,1)🔗

The material's base color.

Note: Ifdetail_enabled istrue and adetail_albedo texture is specified,albedo_color willnot modulate the detail texture. This can be used to color partial areas of a material by not specifying an albedo texture and using a transparentdetail_albedo texture instead.


Texture2Dalbedo_texture🔗

Texture to multiply byalbedo_color. Used for basic texturing of objects.

If the texture appears unexpectedly too dark or too bright, checkalbedo_texture_force_srgb.


boolalbedo_texture_force_srgb =false🔗

Iftrue, forces a conversion of thealbedo_texture from sRGB color space to linear color space. See alsovertex_color_is_srgb.

This should only be enabled when needed (typically when using aViewportTexture asalbedo_texture). Ifalbedo_texture_force_srgb istrue when it shouldn't be, the texture will appear to be too dark. Ifalbedo_texture_force_srgb isfalse when it shouldn't be, the texture will appear to be too bright.


boolalbedo_texture_msdf =false🔗

Enables multichannel signed distance field rendering shader. Usemsdf_pixel_range andmsdf_outline_size to configure MSDF parameters.


floatalpha_antialiasing_edge🔗

Threshold at which antialiasing will be applied on the alpha channel.


AlphaAntiAliasingalpha_antialiasing_mode🔗

The type of alpha antialiasing to apply. SeeAlphaAntiAliasing.


floatalpha_hash_scale🔗

The hashing scale for Alpha Hash. Recommended values between0 and2.


floatalpha_scissor_threshold🔗

Threshold at which the alpha scissor will discard values. Higher values will result in more pixels being discarded. If the material becomes too opaque at a distance, try increasingalpha_scissor_threshold. If the material disappears at a distance, try decreasingalpha_scissor_threshold.


floatanisotropy =0.0🔗

The strength of the anisotropy effect. This is multiplied byanisotropy_flowmap's alpha channel if a texture is defined there and the texture contains an alpha channel.


boolanisotropy_enabled =false🔗

Iftrue, anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminum and hair reflections.

Note: Mesh tangents are needed for anisotropy to work. If the mesh does not contain tangents, the anisotropy effect will appear broken.

Note: Material anisotropy should not to be confused with anisotropic texture filtering, which can be enabled by settingtexture_filter toTEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC.


Texture2Danisotropy_flowmap🔗

Texture that offsets the tangent map for anisotropy calculations and optionally controls the anisotropy effect (if an alpha channel is present). The flowmap texture is expected to be a derivative map, with the red channel representing distortion on the X axis and green channel representing distortion on the Y axis. Values below 0.5 will result in negative distortion, whereas values above 0.5 will result in positive distortion.

If present, the texture's alpha channel will be used to multiply the strength of theanisotropy effect. Fully opaque pixels will keep the anisotropy effect's original strength while fully transparent pixels will disable the anisotropy effect entirely. The flowmap texture's blue channel is ignored.


boolao_enabled =false🔗

Iftrue, ambient occlusion is enabled. Ambient occlusion darkens areas based on theao_texture.


floatao_light_affect =0.0🔗

Amount that ambient occlusion affects lighting from lights. If0, ambient occlusion only affects ambient light. If1, ambient occlusion affects lights just as much as it affects ambient light. This can be used to impact the strength of the ambient occlusion effect, but typically looks unrealistic.


boolao_on_uv2 =false🔗

Iftrue, useUV2 coordinates to look up from theao_texture.


Texture2Dao_texture🔗

Texture that defines the amount of ambient occlusion for a given point on the object.


TextureChannelao_texture_channel =0🔗

Specifies the channel of theao_texture in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.


Colorbacklight =Color(0,0,0,1)🔗

The color used by the backlight effect. Represents the light passing through an object.


boolbacklight_enabled =false🔗

Iftrue, the backlight effect is enabled. See alsosubsurf_scatter_transmittance_enabled.


Texture2Dbacklight_texture🔗

Texture used to control the backlight effect per-pixel. Added tobacklight.


boolbillboard_keep_scale =false🔗

Iftrue, the shader will keep the scale set for the mesh. Otherwise, the scale is lost when billboarding. Only applies whenbillboard_mode is notBILLBOARD_DISABLED.


BillboardModebillboard_mode =0🔗

Controls how the object faces the camera. SeeBillboardMode.

Note: Billboard mode is not suitable for VR because the left-right vector of the camera is not horizontal when the screen is attached to your head instead of on the table. SeeGitHub issue #41567 for details.


BlendModeblend_mode =0🔗

The material's blend mode.

Note: Values other thanMix force the object into the transparent pipeline. SeeBlendMode.


floatclearcoat =1.0🔗

Sets the strength of the clearcoat effect. Setting to0 looks the same as disabling the clearcoat effect.


boolclearcoat_enabled =false🔗

Iftrue, clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can be either glossy or rough.

Note: Clearcoat rendering is not visible if the material'sshading_mode isSHADING_MODE_UNSHADED.


floatclearcoat_roughness =0.5🔗

Sets the roughness of the clearcoat pass. A higher value results in a rougher clearcoat while a lower value results in a smoother clearcoat.


Texture2Dclearcoat_texture🔗

Texture that defines the strength of the clearcoat effect and the glossiness of the clearcoat. Strength is specified in the red channel while glossiness is specified in the green channel.


CullModecull_mode =0🔗

Determines which side of the triangle to cull depending on whether the triangle faces towards or away from the camera. SeeCullMode.


DepthDrawModedepth_draw_mode =0🔗

Determines when depth rendering takes place. SeeDepthDrawMode. See alsotransparency.


Texture2Ddetail_albedo🔗

Texture that specifies the color of the detail overlay.detail_albedo's alpha channel is used as a mask, even when the material is opaque. To use a dedicated texture as a mask, seedetail_mask.

Note:detail_albedo isnot modulated byalbedo_color.


BlendModedetail_blend_mode =0🔗

Specifies how thedetail_albedo should blend with the currentALBEDO. SeeBlendMode for options.


booldetail_enabled =false🔗

Iftrue, enables the detail overlay. Detail is a second texture that gets mixed over the surface of the object based ondetail_mask anddetail_albedo's alpha channel. This can be used to add variation to objects, or to blend between two different albedo/normal textures.


Texture2Ddetail_mask🔗

Texture used to specify how the detail textures get blended with the base textures.detail_mask can be used together withdetail_albedo's alpha channel (if any).


Texture2Ddetail_normal🔗

Texture that specifies the per-pixel normal of the detail overlay. Thedetail_normal texture only uses the red and green channels; the blue and alpha channels are ignored. The normal read fromdetail_normal is oriented around the surface normal provided by theMesh.

Note: Godot expects the normal map to use X+, Y+, and Z+ coordinates. Seethis page for a comparison of normal map coordinates expected by popular engines.


DetailUVdetail_uv_layer =0🔗

Specifies whether to useUV orUV2 for the detail layer. SeeDetailUV for options.


DiffuseModediffuse_mode =0🔗

The algorithm used for diffuse light scattering. SeeDiffuseMode.


booldisable_ambient_light =false🔗

Iftrue, the object receives no ambient light.


booldisable_fog =false🔗

Iftrue, the object will not be affected by fog (neither volumetric nor depth fog). This is useful for unshaded or transparent materials (e.g. particles), which without this setting will be affected even if fully transparent.


booldisable_receive_shadows =false🔗

Iftrue, the object receives no shadow that would otherwise be cast onto it.


floatdistance_fade_max_distance =10.0🔗

Distance at which the object appears fully opaque.

Note: Ifdistance_fade_max_distance is less thandistance_fade_min_distance, the behavior will be reversed. The object will start to fade away atdistance_fade_max_distance and will fully disappear once it reachesdistance_fade_min_distance.


floatdistance_fade_min_distance =0.0🔗

Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible.

Note: Ifdistance_fade_min_distance is greater thandistance_fade_max_distance, the behavior will be reversed. The object will start to fade away atdistance_fade_max_distance and will fully disappear once it reachesdistance_fade_min_distance.


DistanceFadeModedistance_fade_mode =0🔗

Specifies which type of fade to use. Can be any of theDistanceFadeModes.


Coloremission =Color(0,0,0,1)🔗

The emitted light's color. Seeemission_enabled.


boolemission_enabled =false🔗

Iftrue, the body emits light. Emitting light makes the object appear brighter. The object can also cast light on other objects if aVoxelGI, SDFGI, orLightmapGI is used and this object is used in baked lighting.


floatemission_energy_multiplier =1.0🔗

Multiplier for emitted light. Seeemission_enabled.


floatemission_intensity🔗

Luminance of emitted light, measured in nits (candela per square meter). Only available whenProjectSettings.rendering/lights_and_shadows/use_physical_light_units is enabled. The default is roughly equivalent to an indoor lightbulb.


boolemission_on_uv2 =false🔗

UseUV2 to read from theemission_texture.


EmissionOperatoremission_operator =0🔗

Sets howemission interacts withemission_texture. Can either add or multiply. SeeEmissionOperator for options.


Texture2Demission_texture🔗

Texture that specifies how much surface emits light at a given point.


boolfixed_size =false🔗

Iftrue, the object is rendered at the same size regardless of distance.


boolgrow =false🔗

Iftrue, enables the vertex grow setting. This can be used to create mesh-based outlines using a second material pass and itscull_mode set toCULL_FRONT. See alsogrow_amount.

Note: Vertex growth cannot create new vertices, which means that visible gaps may occur in sharp corners. This can be alleviated by designing the mesh to use smooth normals exclusively usingface weighted normals in the 3D authoring software. In this case, grow will be able to join every outline together, just like in the original mesh.


floatgrow_amount =0.0🔗

Grows object vertices in the direction of their normals. Only effective ifgrow istrue.


boolheightmap_deep_parallax =false🔗

Iftrue, uses parallax occlusion mapping to represent depth in the material instead of simple offset mapping (seeheightmap_enabled). This results in a more convincing depth effect, but is much more expensive on the GPU. Only enable this on materials where it makes a significant visual difference.


boolheightmap_enabled =false🔗

Iftrue, height mapping is enabled (also called "parallax mapping" or "depth mapping"). See alsonormal_enabled. Height mapping is a demanding feature on the GPU, so it should only be used on materials where it makes a significant visual difference.

Note: Height mapping is not supported if triplanar mapping is used on the same material. The value ofheightmap_enabled will be ignored ifuv1_triplanar is enabled.


boolheightmap_flip_binormal =false🔗

Iftrue, flips the mesh's binormal vectors when interpreting the height map. If the heightmap effect looks strange when the camera moves (even with a reasonableheightmap_scale), try setting this totrue.


boolheightmap_flip_tangent =false🔗

Iftrue, flips the mesh's tangent vectors when interpreting the height map. If the heightmap effect looks strange when the camera moves (even with a reasonableheightmap_scale), try setting this totrue.


boolheightmap_flip_texture =false🔗

Iftrue, interprets the height map texture as a depth map, with brighter values appearing to be "lower" in altitude compared to darker values.

This can be enabled for compatibility with some materials authored for Godot 3.x. This is not necessary if the Invert import option was used to invert the depth map in Godot 3.x, in which caseheightmap_flip_texture should remainfalse.


intheightmap_max_layers🔗

The number of layers to use for parallax occlusion mapping when the camera is up close to the material. Higher values result in a more convincing depth effect, especially in materials that have steep height changes. Higher values have a significant cost on the GPU, so it should only be increased on materials where it makes a significant visual difference.

Note: Only effective ifheightmap_deep_parallax istrue.


intheightmap_min_layers🔗

The number of layers to use for parallax occlusion mapping when the camera is far away from the material. Higher values result in a more convincing depth effect, especially in materials that have steep height changes. Higher values have a significant cost on the GPU, so it should only be increased on materials where it makes a significant visual difference.

Note: Only effective ifheightmap_deep_parallax istrue.


floatheightmap_scale =5.0🔗

The heightmap scale to use for the parallax effect (seeheightmap_enabled). The default value is tuned so that the highest point (value = 255) appears to be 5 cm higher than the lowest point (value = 0). Higher values result in a deeper appearance, but may result in artifacts appearing when looking at the material from oblique angles, especially when the camera moves. Negative values can be used to invert the parallax effect, but this is different from inverting the texture usingheightmap_flip_texture as the material will also appear to be "closer" to the camera. In most cases,heightmap_scale should be kept to a positive value.

Note: If the height map effect looks strange regardless of this value, try adjustingheightmap_flip_binormal andheightmap_flip_tangent. See alsoheightmap_texture for recommendations on authoring heightmap textures, as the way the heightmap texture is authored affects howheightmap_scale behaves.


Texture2Dheightmap_texture🔗

The texture to use as a height map. See alsoheightmap_enabled.

For best results, the texture should be normalized (withheightmap_scale reduced to compensate). InGIMP, this can be done usingColors > Auto > Equalize. If the texture only uses a small part of its available range, the parallax effect may look strange, especially when the camera moves.

Note: To reduce memory usage and improve loading times, you may be able to use a lower-resolution heightmap texture as most heightmaps are only comprised of low-frequency data.


floatmetallic =0.0🔗

A high value makes the material appear more like a metal. Non-metals use their albedo as the diffuse color and add diffuse to the specular reflection. With non-metals, the reflection appears on top of the albedo color. Metals use their albedo as a multiplier to the specular reflection and set the diffuse color to black resulting in a tinted reflection. Materials work better when fully metal or fully non-metal, values between0 and1 should only be used for blending between metal and non-metal sections. To alter the amount of reflection useroughness.


floatmetallic_specular =0.5🔗

Adjusts the strength of specular reflections. Specular reflections are composed of scene reflections and the specular lobe which is the bright spot that is reflected from light sources. When set to0.0, no specular reflections will be visible. This differs from theSPECULAR_DISABLEDSpecularMode asSPECULAR_DISABLED only applies to the specular lobe from the light source.

Note: Unlikemetallic, this is not energy-conserving, so it should be left at0.5 in most cases. See alsoroughness.


Texture2Dmetallic_texture🔗

Texture used to specify metallic for an object. This is multiplied bymetallic.


TextureChannelmetallic_texture_channel =0🔗

Specifies the channel of themetallic_texture in which the metallic information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.


floatmsdf_outline_size =0.0🔗

The width of the shape outline.


floatmsdf_pixel_range =4.0🔗

The width of the range around the shape between the minimum and maximum representable signed distance.


boolno_depth_test =false🔗

Iftrue, depth testing is disabled and the object will be drawn in render order.


boolnormal_enabled =false🔗

Iftrue, normal mapping is enabled. This has a slight performance cost, especially on mobile GPUs.


floatnormal_scale =1.0🔗

The strength of the normal map's effect.


Texture2Dnormal_texture🔗

Texture used to specify the normal at a given pixel. Thenormal_texture only uses the red and green channels; the blue and alpha channels are ignored. The normal read fromnormal_texture is oriented around the surface normal provided by theMesh.

Note: The mesh must have both normals and tangents defined in its vertex data. Otherwise, the normal map won't render correctly and will only appear to darken the whole surface. If creating geometry withSurfaceTool, you can useSurfaceTool.generate_normals() andSurfaceTool.generate_tangents() to automatically generate normals and tangents respectively.

Note: Godot expects the normal map to use X+, Y+, and Z+ coordinates. Seethis page for a comparison of normal map coordinates expected by popular engines.

Note: Ifdetail_enabled istrue, thedetail_albedo texture is drawnbelow thenormal_texture. To display a normal mapabove thedetail_albedo texture, usedetail_normal instead.


Texture2Dorm_texture🔗

The Occlusion/Roughness/Metallic texture to use. This is a more efficient replacement ofao_texture,roughness_texture andmetallic_texture inORMMaterial3D. Ambient occlusion is stored in the red channel. Roughness map is stored in the green channel. Metallic map is stored in the blue channel. The alpha channel is ignored.


intparticles_anim_h_frames🔗

The number of horizontal frames in the particle sprite sheet. Only enabled when usingBILLBOARD_PARTICLES. Seebillboard_mode.


boolparticles_anim_loop🔗

Iftrue, particle animations are looped. Only enabled when usingBILLBOARD_PARTICLES. Seebillboard_mode.


intparticles_anim_v_frames🔗

The number of vertical frames in the particle sprite sheet. Only enabled when usingBILLBOARD_PARTICLES. Seebillboard_mode.


floatpoint_size =1.0🔗

The point size in pixels. Seeuse_point_size.


floatproximity_fade_distance =1.0🔗

Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade.


boolproximity_fade_enabled =false🔗

Iftrue, the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object.


boolrefraction_enabled =false🔗

Iftrue, the refraction effect is enabled. Distorts transparency based on light from behind the object.

Note: Refraction is implemented using the screen texture. Only opaque materials will appear in the refraction, since transparent materials do not appear in the screen texture.


floatrefraction_scale =0.05🔗

The strength of the refraction effect.


Texture2Drefraction_texture🔗

Texture that controls the strength of the refraction per-pixel. Multiplied byrefraction_scale.


TextureChannelrefraction_texture_channel =0🔗

Specifies the channel of therefraction_texture in which the refraction information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored refraction in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.


floatrim =1.0🔗

Sets the strength of the rim lighting effect.


boolrim_enabled =false🔗

Iftrue, rim effect is enabled. Rim lighting increases the brightness at glancing angles on an object.

Note: Rim lighting is not visible if the material'sshading_mode isSHADING_MODE_UNSHADED.


Texture2Drim_texture🔗

Texture used to set the strength of the rim lighting effect per-pixel. Multiplied byrim.


floatrim_tint =0.5🔗

The amount of to blend light and albedo color when rendering rim effect. If0 the light color is used, while1 means albedo color is used. An intermediate value generally works best.


floatroughness =1.0🔗

Surface reflection. A value of0 represents a perfect mirror while a value of1 completely blurs the reflection. See alsometallic.


Texture2Droughness_texture🔗

Texture used to control the roughness per-pixel. Multiplied byroughness.


TextureChannelroughness_texture_channel =0🔗

Specifies the channel of theroughness_texture in which the roughness information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use.


ShadingModeshading_mode =1🔗

Sets whether the shading takes place, per-pixel, per-vertex or unshaded. Per-vertex lighting is faster, making it the best choice for mobile applications, however it looks considerably worse than per-pixel. Unshaded rendering is the fastest, but disables all interactions with lights.


boolshadow_to_opacity =false🔗

Iftrue, enables the "shadow to opacity" render mode where lighting modifies the alpha so shadowed areas are opaque and non-shadowed areas are transparent. Useful for overlaying shadows onto a camera feed in AR.


SpecularModespecular_mode =0🔗

The method for rendering the specular blob. SeeSpecularMode.

Note:specular_mode only applies to the specular blob. It does not affect specular reflections from the sky, screen-space reflections,VoxelGI, SDFGI orReflectionProbes. To disable reflections from these sources as well, setmetallic_specular to0.0 instead.


boolsubsurf_scatter_enabled =false🔗

Iftrue, subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges. Subsurface scattering quality is controlled byProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_quality.


boolsubsurf_scatter_skin_mode =false🔗

Iftrue, subsurface scattering will use a special mode optimized for the color and density of human skin, such as boosting the intensity of the red channel in subsurface scattering.


floatsubsurf_scatter_strength =0.0🔗

The strength of the subsurface scattering effect. The depth of the effect is also controlled byProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_scale, which is set globally.


Texture2Dsubsurf_scatter_texture🔗

Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied bysubsurf_scatter_strength.


floatsubsurf_scatter_transmittance_boost =0.0🔗

The intensity of the subsurface scattering transmittance effect.


Colorsubsurf_scatter_transmittance_color =Color(1,1,1,1)🔗

The color to multiply the subsurface scattering transmittance effect with. Ignored ifsubsurf_scatter_skin_mode istrue.


floatsubsurf_scatter_transmittance_depth =0.1🔗

The depth of the subsurface scattering transmittance effect.


boolsubsurf_scatter_transmittance_enabled =false🔗

Iftrue, enables subsurface scattering transmittance. Only effective ifsubsurf_scatter_enabled istrue. See alsobacklight_enabled.


Texture2Dsubsurf_scatter_transmittance_texture🔗

The texture to use for multiplying the intensity of the subsurface scattering transmittance intensity. See alsosubsurf_scatter_texture. Ignored ifsubsurf_scatter_skin_mode istrue.


TextureFiltertexture_filter =3🔗

Filter flags for the texture. SeeTextureFilter for options.

Note:heightmap_texture is always sampled with linear filtering, even if nearest-neighbor filtering is selected here. This is to ensure the heightmap effect looks as intended. If you need sharper height transitions between pixels, resize the heightmap texture in an image editor with nearest-neighbor filtering.


booltexture_repeat =true🔗

Repeat flags for the texture. SeeTextureFilter for options.


Transparencytransparency =0🔗

The material's transparency mode. Some transparency modes will disable shadow casting. Any transparency mode other thanTRANSPARENCY_DISABLED has a greater performance impact compared to opaque rendering. See alsoblend_mode.


booluse_particle_trails =false🔗

Iftrue, enables parts of the shader required forGPUParticles3D trails to function. This also requires using a mesh with appropriate skinning, such asRibbonTrailMesh orTubeTrailMesh. Enabling this feature outside of materials used inGPUParticles3D meshes will break material rendering.


booluse_point_size =false🔗

Iftrue, render point size can be changed.

Note: This is only effective for objects whose geometry is point-based rather than triangle-based. See alsopoint_size.


Vector3uv1_offset =Vector3(0,0,0)🔗

How much to offset theUV coordinates. This amount will be added toUV in the vertex function. This can be used to offset a texture. The Z component is used whenuv1_triplanar is enabled, but it is not used anywhere else.


Vector3uv1_scale =Vector3(1,1,1)🔗

How much to scale theUV coordinates. This is multiplied byUV in the vertex function. The Z component is used whenuv1_triplanar is enabled, but it is not used anywhere else.


booluv1_triplanar =false🔗

Iftrue, instead of usingUV textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing.


floatuv1_triplanar_sharpness =1.0🔗

A lower number blends the texture more softly while a higher number blends the texture more sharply.

Note:uv1_triplanar_sharpness is clamped between0.0 and150.0 (inclusive) as values outside that range can look broken depending on the mesh.


booluv1_world_triplanar =false🔗

Iftrue, triplanar mapping forUV is calculated in world space rather than object local space. See alsouv1_triplanar.


Vector3uv2_offset =Vector3(0,0,0)🔗

How much to offset theUV2 coordinates. This amount will be added toUV2 in the vertex function. This can be used to offset a texture. The Z component is used whenuv2_triplanar is enabled, but it is not used anywhere else.


Vector3uv2_scale =Vector3(1,1,1)🔗

How much to scale theUV2 coordinates. This is multiplied byUV2 in the vertex function. The Z component is used whenuv2_triplanar is enabled, but it is not used anywhere else.


booluv2_triplanar =false🔗

Iftrue, instead of usingUV2 textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing.


floatuv2_triplanar_sharpness =1.0🔗

A lower number blends the texture more softly while a higher number blends the texture more sharply.

Note:uv2_triplanar_sharpness is clamped between0.0 and150.0 (inclusive) as values outside that range can look broken depending on the mesh.


booluv2_world_triplanar =false🔗

Iftrue, triplanar mapping forUV2 is calculated in world space rather than object local space. See alsouv2_triplanar.


boolvertex_color_is_srgb =false🔗

Iftrue, vertex colors are considered to be stored in sRGB color space and are converted to linear color space during rendering. Iffalse, vertex colors are considered to be stored in linear color space and are rendered as-is. See alsoalbedo_texture_force_srgb.

Note: Only effective when using the Forward+ and Mobile rendering methods, not Compatibility.


boolvertex_color_use_as_albedo =false🔗

Iftrue, the vertex color is used as albedo color.


Method Descriptions

boolget_feature(feature:Feature)const🔗

Returnstrue, if the specifiedFeature is enabled.


boolget_flag(flag:Flags)const🔗

Returnstrue, if the specified flag is enabled. SeeFlags enumerator for options.


Texture2Dget_texture(param:TextureParam)const🔗

Returns theTexture2D associated with the specifiedTextureParam.


voidset_feature(feature:Feature, enable:bool)🔗

Iftrue, enables the specifiedFeature. Many features that are available inBaseMaterial3Ds need to be enabled before use. This way the cost for using the feature is only incurred when specified. Features can also be enabled by setting the corresponding member totrue.


voidset_flag(flag:Flags, enable:bool)🔗

Iftrue, enables the specified flag. Flags are optional behavior that can be turned on and off. Only one flag can be enabled at a time with this function, the flag enumerators cannot be bit-masked together to enable or disable multiple flags at once. Flags can also be enabled by setting the corresponding member totrue. SeeFlags enumerator for options.


voidset_texture(param:TextureParam, texture:Texture2D)🔗

Sets the texture for the slot specified byparam. SeeTextureParam for available slots.


User-contributed notes

Please read theUser-contributed notes policy before submitting a comment.