Table of Contents

Class BaseMaterial3D

Namespace
Godot
Assembly
GodotSharp.dll

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.

public class BaseMaterial3D : Material, IDisposable
Inheritance
BaseMaterial3D
Implements
Derived
Inherited Members

Properties

AOEnabled

If true, ambient occlusion is enabled. Ambient occlusion darkens areas based on the AOTexture.

public bool AOEnabled { get; set; }

Property Value

bool

AOLightAffect

Amount that ambient occlusion affects lighting from lights. If 0, ambient occlusion only affects ambient light. If 1, 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.

public float AOLightAffect { get; set; }

Property Value

float

AOOnUV2

If true, use UV2 coordinates to look up from the AOTexture.

public bool AOOnUV2 { get; set; }

Property Value

bool

AOTexture

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

public Texture2D AOTexture { get; set; }

Property Value

Texture2D

AOTextureChannel

Specifies the channel of the AOTexture 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.

public BaseMaterial3D.TextureChannel AOTextureChannel { get; set; }

Property Value

BaseMaterial3D.TextureChannel

AlbedoColor

The material's base color.

Note: If DetailEnabled is true and a DetailAlbedo texture is specified, AlbedoColor will not modulate the detail texture. This can be used to color partial areas of a material by not specifying an albedo texture and using a transparent DetailAlbedo texture instead.

public Color AlbedoColor { get; set; }

Property Value

Color

AlbedoTexture

Texture to multiply by AlbedoColor. Used for basic texturing of objects.

If the texture appears unexpectedly too dark or too bright, check AlbedoTextureForceSrgb.

public Texture2D AlbedoTexture { get; set; }

Property Value

Texture2D

AlbedoTextureForceSrgb

If true, forces a conversion of the AlbedoTexture from sRGB color space to linear color space. See also VertexColorIsSrgb.

This should only be enabled when needed (typically when using a ViewportTexture as AlbedoTexture). If AlbedoTextureForceSrgb is true when it shouldn't be, the texture will appear to be too dark. If AlbedoTextureForceSrgb is false when it shouldn't be, the texture will appear to be too bright.

public bool AlbedoTextureForceSrgb { get; set; }

Property Value

bool

AlbedoTextureMsdf

Enables multichannel signed distance field rendering shader. Use MsdfPixelRange and MsdfOutlineSize to configure MSDF parameters.

public bool AlbedoTextureMsdf { get; set; }

Property Value

bool

AlphaAntialiasingEdge

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

public float AlphaAntialiasingEdge { get; set; }

Property Value

float

AlphaAntialiasingMode

The type of alpha antialiasing to apply. See BaseMaterial3D.AlphaAntiAliasing.

public BaseMaterial3D.AlphaAntiAliasing AlphaAntialiasingMode { get; set; }

Property Value

BaseMaterial3D.AlphaAntiAliasing

AlphaHashScale

The hashing scale for Alpha Hash. Recommended values between 0 and 2.

public float AlphaHashScale { get; set; }

Property Value

float

AlphaScissorThreshold

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 increasing AlphaScissorThreshold. If the material disappears at a distance, try decreasing AlphaScissorThreshold.

public float AlphaScissorThreshold { get; set; }

Property Value

float

Anisotropy

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

public float Anisotropy { get; set; }

Property Value

float

AnisotropyEnabled

If true, anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminium 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 setting TextureFilter to LinearWithMipmapsAnisotropic.

public bool AnisotropyEnabled { get; set; }

Property Value

bool

AnisotropyFlowmap

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 the Anisotropy 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.

public Texture2D AnisotropyFlowmap { get; set; }

Property Value

Texture2D

Backlight

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

public Color Backlight { get; set; }

Property Value

Color

BacklightEnabled

If true, the backlight effect is enabled. See also SubsurfScatterTransmittanceEnabled.

public bool BacklightEnabled { get; set; }

Property Value

bool

BacklightTexture

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

public Texture2D BacklightTexture { get; set; }

Property Value

Texture2D

BillboardKeepScale

If true, the shader will keep the scale set for the mesh. Otherwise, the scale is lost when billboarding. Only applies when BillboardMode is not Disabled.

public bool BillboardKeepScale { get; set; }

Property Value

bool

BillboardMode

Controls how the object faces the camera. See BaseMaterial3D.BillboardModeEnum.

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. See GitHub issue #41567 for details.

public BaseMaterial3D.BillboardModeEnum BillboardMode { get; set; }

Property Value

BaseMaterial3D.BillboardModeEnum

BlendMode

The material's blend mode.

Note: Values other than Mix force the object into the transparent pipeline. See BaseMaterial3D.BlendModeEnum.

public BaseMaterial3D.BlendModeEnum BlendMode { get; set; }

Property Value

BaseMaterial3D.BlendModeEnum

Clearcoat

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

public float Clearcoat { get; set; }

Property Value

float

ClearcoatEnabled

If true, 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's ShadingMode is Unshaded.

public bool ClearcoatEnabled { get; set; }

Property Value

bool

ClearcoatRoughness

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

public float ClearcoatRoughness { get; set; }

Property Value

float

ClearcoatTexture

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.

public Texture2D ClearcoatTexture { get; set; }

Property Value

Texture2D

CullMode

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

public BaseMaterial3D.CullModeEnum CullMode { get; set; }

Property Value

BaseMaterial3D.CullModeEnum

DepthDrawMode

Determines when depth rendering takes place. See BaseMaterial3D.DepthDrawModeEnum. See also Transparency.

public BaseMaterial3D.DepthDrawModeEnum DepthDrawMode { get; set; }

Property Value

BaseMaterial3D.DepthDrawModeEnum

DetailAlbedo

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

Note: DetailAlbedo is not modulated by AlbedoColor.

public Texture2D DetailAlbedo { get; set; }

Property Value

Texture2D

DetailBlendMode

Specifies how the DetailAlbedo should blend with the current ALBEDO. See BaseMaterial3D.BlendModeEnum for options.

public BaseMaterial3D.BlendModeEnum DetailBlendMode { get; set; }

Property Value

BaseMaterial3D.BlendModeEnum

DetailEnabled

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

public bool DetailEnabled { get; set; }

Property Value

bool

DetailMask

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

public Texture2D DetailMask { get; set; }

Property Value

Texture2D

DetailNormal

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

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

public Texture2D DetailNormal { get; set; }

Property Value

Texture2D

DetailUVLayer

Specifies whether to use UV or UV2 for the detail layer. See BaseMaterial3D.DetailUV for options.

public BaseMaterial3D.DetailUV DetailUVLayer { get; set; }

Property Value

BaseMaterial3D.DetailUV

DiffuseMode

The algorithm used for diffuse light scattering. See BaseMaterial3D.DiffuseModeEnum.

public BaseMaterial3D.DiffuseModeEnum DiffuseMode { get; set; }

Property Value

BaseMaterial3D.DiffuseModeEnum

DisableAmbientLight

If true, the object receives no ambient light.

public bool DisableAmbientLight { get; set; }

Property Value

bool

DisableFog

If true, 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.

public bool DisableFog { get; set; }

Property Value

bool

DisableReceiveShadows

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

public bool DisableReceiveShadows { get; set; }

Property Value

bool

DistanceFadeMaxDistance

Distance at which the object appears fully opaque.

Note: If DistanceFadeMaxDistance is less than DistanceFadeMinDistance, the behavior will be reversed. The object will start to fade away at DistanceFadeMaxDistance and will fully disappear once it reaches DistanceFadeMinDistance.

public float DistanceFadeMaxDistance { get; set; }

Property Value

float

DistanceFadeMinDistance

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

Note: If DistanceFadeMinDistance is greater than DistanceFadeMaxDistance, the behavior will be reversed. The object will start to fade away at DistanceFadeMaxDistance and will fully disappear once it reaches DistanceFadeMinDistance.

public float DistanceFadeMinDistance { get; set; }

Property Value

float

DistanceFadeMode

Specifies which type of fade to use. Can be any of the BaseMaterial3D.DistanceFadeModeEnums.

public BaseMaterial3D.DistanceFadeModeEnum DistanceFadeMode { get; set; }

Property Value

BaseMaterial3D.DistanceFadeModeEnum

Emission

The emitted light's color. See EmissionEnabled.

public Color Emission { get; set; }

Property Value

Color

EmissionEnabled

If true, the body emits light. Emitting light makes the object appear brighter. The object can also cast light on other objects if a VoxelGI, SDFGI, or LightmapGI is used and this object is used in baked lighting.

public bool EmissionEnabled { get; set; }

Property Value

bool

EmissionEnergyMultiplier

Multiplier for emitted light. See EmissionEnabled.

public float EmissionEnergyMultiplier { get; set; }

Property Value

float

EmissionIntensity

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

public float EmissionIntensity { get; set; }

Property Value

float

EmissionOnUV2

Use UV2 to read from the EmissionTexture.

public bool EmissionOnUV2 { get; set; }

Property Value

bool

EmissionOperator

Sets how Emission interacts with EmissionTexture. Can either add or multiply. See BaseMaterial3D.EmissionOperatorEnum for options.

public BaseMaterial3D.EmissionOperatorEnum EmissionOperator { get; set; }

Property Value

BaseMaterial3D.EmissionOperatorEnum

EmissionTexture

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

public Texture2D EmissionTexture { get; set; }

Property Value

Texture2D

FixedSize

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

public bool FixedSize { get; set; }

Property Value

bool

Grow

If true, enables the vertex grow setting. This can be used to create mesh-based outlines using a second material pass and its CullMode set to Front. See also GrowAmount.

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 using face 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.

public bool Grow { get; set; }

Property Value

bool

GrowAmount

Grows object vertices in the direction of their normals. Only effective if Grow is true.

public float GrowAmount { get; set; }

Property Value

float

HeightmapDeepParallax

If true, uses parallax occlusion mapping to represent depth in the material instead of simple offset mapping (see HeightmapEnabled). 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.

public bool HeightmapDeepParallax { get; set; }

Property Value

bool

HeightmapEnabled

If true, height mapping is enabled (also called "parallax mapping" or "depth mapping"). See also NormalEnabled. 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 of HeightmapEnabled will be ignored if Uv1Triplanar is enabled.

public bool HeightmapEnabled { get; set; }

Property Value

bool

HeightmapFlipBinormal

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

public bool HeightmapFlipBinormal { get; set; }

Property Value

bool

HeightmapFlipTangent

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

public bool HeightmapFlipTangent { get; set; }

Property Value

bool

HeightmapFlipTexture

If true, 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 case HeightmapFlipTexture should remain false.

public bool HeightmapFlipTexture { get; set; }

Property Value

bool

HeightmapMaxLayers

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 if HeightmapDeepParallax is true.

public int HeightmapMaxLayers { get; set; }

Property Value

int

HeightmapMinLayers

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 if HeightmapDeepParallax is true.

public int HeightmapMinLayers { get; set; }

Property Value

int

HeightmapScale

The heightmap scale to use for the parallax effect (see HeightmapEnabled). 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 using HeightmapFlipTexture as the material will also appear to be "closer" to the camera. In most cases, HeightmapScale should be kept to a positive value.

Note: If the height map effect looks strange regardless of this value, try adjusting HeightmapFlipBinormal and HeightmapFlipTangent. See also HeightmapTexture for recommendations on authoring heightmap textures, as the way the heightmap texture is authored affects how HeightmapScale behaves.

public float HeightmapScale { get; set; }

Property Value

float

HeightmapTexture

The texture to use as a height map. See also HeightmapEnabled.

For best results, the texture should be normalized (with HeightmapScale reduced to compensate). In GIMP, this can be done using Colors > 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.

public Texture2D HeightmapTexture { get; set; }

Property Value

Texture2D

Metallic

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 between 0 and 1 should only be used for blending between metal and non-metal sections. To alter the amount of reflection use Roughness.

public float Metallic { get; set; }

Property Value

float

MetallicSpecular

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 to 0.0, no specular reflections will be visible. This differs from the DisabledBaseMaterial3D.SpecularModeEnum as Disabled only applies to the specular lobe from the light source.

Note: Unlike Metallic, this is not energy-conserving, so it should be left at 0.5 in most cases. See also Roughness.

public float MetallicSpecular { get; set; }

Property Value

float

MetallicTexture

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

public Texture2D MetallicTexture { get; set; }

Property Value

Texture2D

MetallicTextureChannel

Specifies the channel of the MetallicTexture 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.

public BaseMaterial3D.TextureChannel MetallicTextureChannel { get; set; }

Property Value

BaseMaterial3D.TextureChannel

MsdfOutlineSize

The width of the shape outline.

public float MsdfOutlineSize { get; set; }

Property Value

float

MsdfPixelRange

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

public float MsdfPixelRange { get; set; }

Property Value

float

NoDepthTest

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

public bool NoDepthTest { get; set; }

Property Value

bool

NormalEnabled

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

public bool NormalEnabled { get; set; }

Property Value

bool

NormalScale

The strength of the normal map's effect.

public float NormalScale { get; set; }

Property Value

float

NormalTexture

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

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 with SurfaceTool, you can use GenerateNormals(bool) and GenerateTangents() to automatically generate normals and tangents respectively.

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

Note: If DetailEnabled is true, the DetailAlbedo texture is drawn below the NormalTexture. To display a normal map above the DetailAlbedo texture, use DetailNormal instead.

public Texture2D NormalTexture { get; set; }

Property Value

Texture2D

OrmTexture

The Occlusion/Roughness/Metallic texture to use. This is a more efficient replacement of AOTexture, RoughnessTexture and MetallicTexture in OrmMaterial3D. 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.

public Texture2D OrmTexture { get; set; }

Property Value

Texture2D

ParticlesAnimHFrames

The number of horizontal frames in the particle sprite sheet. Only enabled when using Particles. See BillboardMode.

public int ParticlesAnimHFrames { get; set; }

Property Value

int

ParticlesAnimLoop

If true, particle animations are looped. Only enabled when using Particles. See BillboardMode.

public bool ParticlesAnimLoop { get; set; }

Property Value

bool

ParticlesAnimVFrames

The number of vertical frames in the particle sprite sheet. Only enabled when using Particles. See BillboardMode.

public int ParticlesAnimVFrames { get; set; }

Property Value

int

PointSize

The point size in pixels. See UsePointSize.

public float PointSize { get; set; }

Property Value

float

ProximityFadeDistance

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

public float ProximityFadeDistance { get; set; }

Property Value

float

ProximityFadeEnabled

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

public bool ProximityFadeEnabled { get; set; }

Property Value

bool

RefractionEnabled

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

public bool RefractionEnabled { get; set; }

Property Value

bool

RefractionScale

The strength of the refraction effect.

public float RefractionScale { get; set; }

Property Value

float

RefractionTexture

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

public Texture2D RefractionTexture { get; set; }

Property Value

Texture2D

RefractionTextureChannel

Specifies the channel of the RefractionTexture 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.

public BaseMaterial3D.TextureChannel RefractionTextureChannel { get; set; }

Property Value

BaseMaterial3D.TextureChannel

Rim

Sets the strength of the rim lighting effect.

public float Rim { get; set; }

Property Value

float

RimEnabled

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

Note: Rim lighting is not visible if the material's ShadingMode is Unshaded.

public bool RimEnabled { get; set; }

Property Value

bool

RimTexture

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

public Texture2D RimTexture { get; set; }

Property Value

Texture2D

RimTint

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

public float RimTint { get; set; }

Property Value

float

Roughness

Surface reflection. A value of 0 represents a perfect mirror while a value of 1 completely blurs the reflection. See also Metallic.

public float Roughness { get; set; }

Property Value

float

RoughnessTexture

Texture used to control the roughness per-pixel. Multiplied by Roughness.

public Texture2D RoughnessTexture { get; set; }

Property Value

Texture2D

RoughnessTextureChannel

Specifies the channel of the RoughnessTexture 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.

public BaseMaterial3D.TextureChannel RoughnessTextureChannel { get; set; }

Property Value

BaseMaterial3D.TextureChannel

ShadingMode

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.

Note: Setting the shading mode vertex shading currently has no effect, as vertex shading is not implemented yet.

public BaseMaterial3D.ShadingModeEnum ShadingMode { get; set; }

Property Value

BaseMaterial3D.ShadingModeEnum

ShadowToOpacity

If true, 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.

public bool ShadowToOpacity { get; set; }

Property Value

bool

SpecularMode

The method for rendering the specular blob. See BaseMaterial3D.SpecularModeEnum.

Note: SpecularMode only applies to the specular blob. It does not affect specular reflections from the sky, screen-space reflections, VoxelGI, SDFGI or ReflectionProbes. To disable reflections from these sources as well, set MetallicSpecular to 0.0 instead.

public BaseMaterial3D.SpecularModeEnum SpecularMode { get; set; }

Property Value

BaseMaterial3D.SpecularModeEnum

SubsurfScatterEnabled

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

public bool SubsurfScatterEnabled { get; set; }

Property Value

bool

SubsurfScatterSkinMode

If true, 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.

public bool SubsurfScatterSkinMode { get; set; }

Property Value

bool

SubsurfScatterStrength

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

public float SubsurfScatterStrength { get; set; }

Property Value

float

SubsurfScatterTexture

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

public Texture2D SubsurfScatterTexture { get; set; }

Property Value

Texture2D

SubsurfScatterTransmittanceBoost

The intensity of the subsurface scattering transmittance effect.

public float SubsurfScatterTransmittanceBoost { get; set; }

Property Value

float

SubsurfScatterTransmittanceColor

The color to multiply the subsurface scattering transmittance effect with. Ignored if SubsurfScatterSkinMode is true.

public Color SubsurfScatterTransmittanceColor { get; set; }

Property Value

Color

SubsurfScatterTransmittanceDepth

The depth of the subsurface scattering transmittance effect.

public float SubsurfScatterTransmittanceDepth { get; set; }

Property Value

float

SubsurfScatterTransmittanceEnabled

If true, enables subsurface scattering transmittance. Only effective if SubsurfScatterEnabled is true. See also BacklightEnabled.

public bool SubsurfScatterTransmittanceEnabled { get; set; }

Property Value

bool

SubsurfScatterTransmittanceTexture

The texture to use for multiplying the intensity of the subsurface scattering transmittance intensity. See also SubsurfScatterTexture. Ignored if SubsurfScatterSkinMode is true.

public Texture2D SubsurfScatterTransmittanceTexture { get; set; }

Property Value

Texture2D

TextureFilter

Filter flags for the texture. See BaseMaterial3D.TextureFilterEnum for options.

Note: HeightmapTexture 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.

public BaseMaterial3D.TextureFilterEnum TextureFilter { get; set; }

Property Value

BaseMaterial3D.TextureFilterEnum

TextureRepeat

Repeat flags for the texture. See BaseMaterial3D.TextureFilterEnum for options.

public bool TextureRepeat { get; set; }

Property Value

bool

Transparency

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

public BaseMaterial3D.TransparencyEnum Transparency { get; set; }

Property Value

BaseMaterial3D.TransparencyEnum

UV2Offset

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

public Vector3 UV2Offset { get; set; }

Property Value

Vector3

UV2Scale

How much to scale the UV2 coordinates. This is multiplied by UV2 in the vertex function. The Z component is used when UV2Triplanar is enabled, but it is not used anywhere else.

public Vector3 UV2Scale { get; set; }

Property Value

Vector3

UV2Triplanar

If true, instead of using UV2 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.

public bool UV2Triplanar { get; set; }

Property Value

bool

UV2TriplanarSharpness

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

Note: UV2TriplanarSharpness is clamped between 0.0 and 150.0 (inclusive) as values outside that range can look broken depending on the mesh.

public float UV2TriplanarSharpness { get; set; }

Property Value

float

UV2WorldTriplanar

If true, triplanar mapping for UV2 is calculated in world space rather than object local space. See also UV2Triplanar.

public bool UV2WorldTriplanar { get; set; }

Property Value

bool

UseParticleTrails

If true, enables parts of the shader required for GpuParticles3D trails to function. This also requires using a mesh with appropriate skinning, such as RibbonTrailMesh or TubeTrailMesh. Enabling this feature outside of materials used in GpuParticles3D meshes will break material rendering.

public bool UseParticleTrails { get; set; }

Property Value

bool

UsePointSize

If true, render point size can be changed.

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

public bool UsePointSize { get; set; }

Property Value

bool

Uv1Offset

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

public Vector3 Uv1Offset { get; set; }

Property Value

Vector3

Uv1Scale

How much to scale the UV coordinates. This is multiplied by UV in the vertex function. The Z component is used when Uv1Triplanar is enabled, but it is not used anywhere else.

public Vector3 Uv1Scale { get; set; }

Property Value

Vector3

Uv1Triplanar

If true, instead of using UV 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.

public bool Uv1Triplanar { get; set; }

Property Value

bool

Uv1TriplanarSharpness

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

Note: Uv1TriplanarSharpness is clamped between 0.0 and 150.0 (inclusive) as values outside that range can look broken depending on the mesh.

public float Uv1TriplanarSharpness { get; set; }

Property Value

float

Uv1WorldTriplanar

If true, triplanar mapping for UV is calculated in world space rather than object local space. See also Uv1Triplanar.

public bool Uv1WorldTriplanar { get; set; }

Property Value

bool

VertexColorIsSrgb

If true, vertex colors are considered to be stored in sRGB color space and are converted to linear color space during rendering. If false, vertex colors are considered to be stored in linear color space and are rendered as-is. See also AlbedoTextureForceSrgb.

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

public bool VertexColorIsSrgb { get; set; }

Property Value

bool

VertexColorUseAsAlbedo

If true, the vertex color is used as albedo color.

public bool VertexColorUseAsAlbedo { get; set; }

Property Value

bool

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool