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:
TEXTURE_ALBEDO = 0 --- Texture specifying per-pixel color.
TEXTURE_METALLIC = 1 --- Texture specifying per-pixel metallic value.
TEXTURE_ROUGHNESS = 2 --- Texture specifying per-pixel roughness value.
TEXTURE_EMISSION = 3 --- Texture specifying per-pixel emission color.
TEXTURE_NORMAL = 4 --- Texture specifying per-pixel normal vector.
TEXTURE_RIM = 5 --- Texture specifying per-pixel rim value.
TEXTURE_CLEARCOAT = 6 --- Texture specifying per-pixel clearcoat value.
TEXTURE_FLOWMAP = 7 --- Texture specifying per-pixel flowmap direction for use with anisotropy.
TEXTURE_AMBIENT_OCCLUSION = 8 --- Texture specifying per-pixel ambient occlusion value.
TEXTURE_HEIGHTMAP = 9 --- Texture specifying per-pixel height.
TEXTURE_SUBSURFACE_SCATTERING = 10 --- Texture specifying per-pixel subsurface scattering.
TEXTURE_SUBSURFACE_TRANSMITTANCE = 11 --- Texture specifying per-pixel transmittance for subsurface scattering.
TEXTURE_BACKLIGHT = 12 --- Texture specifying per-pixel backlight color.
TEXTURE_REFRACTION = 13 --- Texture specifying per-pixel refraction strength.
TEXTURE_DETAIL_MASK = 14 --- Texture specifying per-pixel detail mask blending value.
TEXTURE_DETAIL_ALBEDO = 15 --- Texture specifying per-pixel detail color.
TEXTURE_DETAIL_NORMAL = 16 --- Texture specifying per-pixel detail normal.
TEXTURE_ORM = 17 --- Texture holding ambient occlusion, roughness, and metallic.
TEXTURE_MAX = 18 --- Represents the size of the TextureParam enum.
enum 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.
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.
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.
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.
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.
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.
TEXTURE_FILTER_MAX = 6 --- Represents the size of the TextureFilter enum.
enum DetailUV:
DETAIL_UV_1 = 0 --- Use
UV
with the detail texture.DETAIL_UV_2 = 1 --- Use
UV2
with the detail texture.
enum Transparency:
TRANSPARENCY_DISABLED = 0 --- The material will not use transparency.
TRANSPARENCY_ALPHA = 1 --- The material will use the texture's alpha values for transparency.
TRANSPARENCY_ALPHA_SCISSOR = 2 --- The material will cut off all values below a threshold, the rest will remain opaque.
TRANSPARENCY_ALPHA_HASH = 3 --- The material will cut off all values below a spatially-deterministic threshold, the rest will remain opaque.
TRANSPARENCY_ALPHA_DEPTH_PRE_PASS = 4 --- The material will use the texture's alpha value for transparency, but will still be rendered in the pre-pass.
TRANSPARENCY_MAX = 5 --- Represents the size of the Transparency enum.
enum ShadingMode:
SHADING_MODE_UNSHADED = 0 --- The object will not receive shadows.
SHADING_MODE_PER_PIXEL = 1 --- The object will be shaded per pixel. Useful for realistic shading effect.
SHADING_MODE_PER_VERTEX = 2 --- The object will be shaded per vertex. Useful when you want cheaper shaders and do not care about visual quality.
SHADING_MODE_MAX = 3 --- Represents the size of the ShadingMode enum.
enum Feature:
FEATURE_EMISSION = 0 --- Constant for setting emission_enabled.
FEATURE_NORMAL_MAPPING = 1 --- Constant for setting normal_enabled.
FEATURE_RIM = 2 --- Constant for setting rim_enabled.
FEATURE_CLEARCOAT = 3 --- Constant for setting clearcoat_enabled.
FEATURE_ANISOTROPY = 4 --- Constant for setting anisotropy_enabled.
FEATURE_AMBIENT_OCCLUSION = 5 --- Constant for setting ao_enabled.
FEATURE_HEIGHT_MAPPING = 6 --- Constant for setting heightmap_enabled.
FEATURE_SUBSURFACE_SCATTERING = 7 --- Constant for setting subsurf_scatter_enabled.
FEATURE_SUBSURFACE_TRANSMITTANCE = 8 --- Constant for setting subsurf_scatter_transmittance_enabled.
FEATURE_BACKLIGHT = 9 --- Constant for setting backlight_enabled.
FEATURE_REFRACTION = 10 --- Constant for setting refraction_enabled.
FEATURE_DETAIL = 11 --- Constant for setting detail_enabled.
FEATURE_MAX = 12 --- Represents the size of the Feature enum.
enum BlendMode:
BLEND_MODE_MIX = 0 --- Default blend mode. The color of the object is blended over the background based on the object's alpha value.
BLEND_MODE_ADD = 1 --- The color of the object is added to the background.
BLEND_MODE_SUB = 2 --- The color of the object is subtracted from the background.
BLEND_MODE_MUL = 3 --- The color of the object is multiplied by the background.
enum AlphaAntiAliasing:
ALPHA_ANTIALIASING_OFF = 0 --- Disables Alpha AntiAliasing for the material.
ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE = 1 --- Enables AlphaToCoverage. Alpha values in the material are passed to the AntiAliasing sample mask.
ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE_AND_TO_ONE = 2 --- Enables AlphaToCoverage and forces all non-zero alpha values to
1
. Alpha values in the material are passed to the AntiAliasing sample mask.
enum DepthDrawMode:
DEPTH_DRAW_OPAQUE_ONLY = 0 --- Default depth draw mode. Depth is drawn only for opaque objects.
DEPTH_DRAW_ALWAYS = 1 --- Depth draw is calculated for both opaque and transparent objects.
DEPTH_DRAW_DISABLED = 2 --- No depth draw.
enum CullMode:
CULL_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.
CULL_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.
CULL_DISABLED = 2 --- No culling is performed.
enum Flags:
FLAG_DISABLE_DEPTH_TEST = 0 --- Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it.
FLAG_ALBEDO_FROM_VERTEX_COLOR = 1 --- Set
ALBEDO
to the per-vertex color specified in the mesh.FLAG_SRGB_VERTEX_COLOR = 2 --- Vertex color is in sRGB space and needs to be converted to linear. Only applies in the Vulkan renderer.
FLAG_USE_POINT_SIZE = 3 --- Uses point size to alter the size of primitive points. Also changes the albedo texture lookup to use
POINT_COORD
instead ofUV
.FLAG_FIXED_SIZE = 4 --- Object is scaled by depth so that it always appears the same size on screen.
FLAG_BILLBOARD_KEEP_SCALE = 5 --- Shader will keep the scale set for the mesh. Otherwise the scale is lost when billboarding. Only applies when billboard_mode is BILLBOARD_ENABLED.
FLAG_UV1_USE_TRIPLANAR = 6 --- Use triplanar texture lookup for all texture lookups that would normally use
UV
.FLAG_UV2_USE_TRIPLANAR = 7 --- Use triplanar texture lookup for all texture lookups that would normally use
UV2
.FLAG_UV1_USE_WORLD_TRIPLANAR = 8 --- Use triplanar texture lookup for all texture lookups that would normally use
UV
.FLAG_UV2_USE_WORLD_TRIPLANAR = 9 --- Use triplanar texture lookup for all texture lookups that would normally use
UV2
.FLAG_AO_ON_UV2 = 10 --- Use
UV2
coordinates to look up from the ao_texture.FLAG_EMISSION_ON_UV2 = 11 --- Use
UV2
coordinates to look up from the emission_texture.FLAG_ALBEDO_TEXTURE_FORCE_SRGB = 12 --- Forces the shader to convert albedo from sRGB space to linear space.
FLAG_DONT_RECEIVE_SHADOWS = 13 --- Disables receiving shadows from other objects.
FLAG_DISABLE_AMBIENT_LIGHT = 14 --- Disables receiving ambient light.
FLAG_USE_SHADOW_TO_OPACITY = 15 --- Enables the shadow to opacity feature.
FLAG_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.
FLAG_INVERT_HEIGHTMAP = 17 --- Invert values read from a depth texture to convert them to height values (heightmap).
FLAG_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.
FLAG_PARTICLE_TRAILS_MODE = 19
FLAG_MAX = 20 --- Represents the size of the Flags enum.
enum DiffuseMode:
DIFFUSE_BURLEY = 0 --- Default diffuse scattering algorithm.
DIFFUSE_LAMBERT = 1 --- Diffuse scattering ignores roughness.
DIFFUSE_LAMBERT_WRAP = 2 --- Extends Lambert to cover more than 90 degrees when roughness increases.
DIFFUSE_TOON = 3 --- Uses a hard cut for lighting, with smoothing affected by roughness.
enum SpecularMode:
SPECULAR_SCHLICK_GGX = 0 --- Default specular blob.
SPECULAR_TOON = 1 --- Toon blob which changes size based on roughness.
SPECULAR_DISABLED = 2 --- No specular blob.
enum BillboardMode:
BILLBOARD_DISABLED = 0 --- Billboard mode is disabled.
BILLBOARD_ENABLED = 1 --- The object's Z axis will always face the camera.
BILLBOARD_FIXED_Y = 2 --- The object's X axis will always face the camera.
BILLBOARD_PARTICLES = 3 --- Used for particle systems when assigned to GPUParticles3D and CPUParticles3D nodes. Enables
particles_anim_*
properties.
The ParticlesMaterial.anim_speed_min or CPUParticles3D.anim_speed_min should also be set to a value bigger than zero for the animation to play.
enum TextureChannel:
TEXTURE_CHANNEL_RED = 0 --- Used to read from the red channel of a texture.
TEXTURE_CHANNEL_GREEN = 1 --- Used to read from the green channel of a texture.
TEXTURE_CHANNEL_BLUE = 2 --- Used to read from the blue channel of a texture.
TEXTURE_CHANNEL_ALPHA = 3 --- Used to read from the alpha channel of a texture.
TEXTURE_CHANNEL_GRAYSCALE = 4 --- Currently unused.
enum EmissionOperator:
EMISSION_OP_ADD = 0 --- Adds the emission color to the color from the emission texture.
EMISSION_OP_MULTIPLY = 1 --- Multiplies the emission color by the color from the emission texture.
enum DistanceFadeMode:
DISTANCE_FADE_DISABLED = 0 --- Do not use distance fade.
DISTANCE_FADE_PIXEL_ALPHA = 1 --- Smoothly fades the object out based on each pixel's distance from the camera using the alpha channel.
DISTANCE_FADE_PIXEL_DITHER = 2 --- Smoothly fades the object out based on each pixel's distance from the camera using a dither approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware this can be faster than DISTANCE_FADE_PIXEL_ALPHA.
DISTANCE_FADE_OBJECT_DITHER = 3 --- Smoothly fades the object out based on the object's distance from the camera using a dither approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware this can be faster than DISTANCE_FADE_PIXEL_ALPHA.
Property Descriptions¶
Color albedo_color
Default |
|
Setter |
set_albedo(value) |
Getter |
get_albedo() |
The material's base color.
bool albedo_tex_force_srgb
Default |
|
Setter |
set_flag(value) |
Getter |
get_flag() |
Forces a conversion of the albedo_texture from sRGB space to linear space.
Texture2D albedo_texture
Setter |
set_texture(value) |
Getter |
get_texture() |
Texture to multiply by albedo_color. Used for basic texturing of objects.
float alpha_antialiasing_edge
Setter |
set_alpha_antialiasing_edge(value) |
Getter |
get_alpha_antialiasing_edge() |
Threshold at which antialiasing will be applied on the alpha channel.
AlphaAntiAliasing alpha_antialiasing_mode
Setter |
set_alpha_antialiasing(value) |
Getter |
get_alpha_antialiasing() |
The type of alpha antialiasing to apply. See AlphaAntiAliasing.
float alpha_hash_scale
Setter |
set_alpha_hash_scale(value) |
Getter |
get_alpha_hash_scale() |
The hashing scale for Alpha Hash. Recommended values between 0
and 2
.
float alpha_scissor_threshold
Setter |
set_alpha_scissor_threshold(value) |
Getter |
get_alpha_scissor_threshold() |
Threshold at which the alpha scissor will discard values.
float anisotropy
Default |
|
Setter |
set_anisotropy(value) |
Getter |
get_anisotropy() |
The strength of the anisotropy effect. This is multiplied by anisotropy_flowmap's alpha channel if a texture is defined there and the texture contains an alpha channel.
bool anisotropy_enabled
Default |
|
Setter |
set_feature(value) |
Getter |
get_feature() |
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 texture_filter to TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC.
Texture2D anisotropy_flowmap
Setter |
set_texture(value) |
Getter |
get_texture() |
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.
bool ao_enabled
Default |
|
Setter |
set_feature(value) |
Getter |
get_feature() |
If true
, ambient occlusion is enabled. Ambient occlusion darkens areas based on the ao_texture.
float ao_light_affect
Default |
|
Setter |
set_ao_light_affect(value) |
Getter |
get_ao_light_affect() |
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.
bool ao_on_uv2
Default |
|
Setter |
set_flag(value) |
Getter |
get_flag() |
If true
, use UV2
coordinates to look up from the ao_texture.
Texture2D ao_texture
Setter |
set_texture(value) |
Getter |
get_texture() |
Texture that defines the amount of ambient occlusion for a given point on the object.
TextureChannel ao_texture_channel
Default |
|
Setter |
set_ao_texture_channel(value) |
Getter |
get_ao_texture_channel() |
Specifies the channel of the ao_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.
Color backlight
Default |
|
Setter |
set_backlight(value) |
Getter |
get_backlight() |
The color used by the backlight effect. Represents the light passing through an object.
bool backlight_enabled
Default |
|
Setter |
set_feature(value) |
Getter |
get_feature() |
If true
, the backlight effect is enabled.
Texture2D backlight_texture
Setter |
set_texture(value) |
Getter |
get_texture() |
Texture used to control the backlight effect per-pixel. Added to backlight.
bool billboard_keep_scale
Default |
|
Setter |
set_flag(value) |
Getter |
get_flag() |
If true
, the shader will keep the scale set for the mesh. Otherwise, the scale is lost when billboarding. Only applies when billboard_mode is BILLBOARD_ENABLED.
BillboardMode billboard_mode
Default |
|
Setter |
set_billboard_mode(value) |
Getter |
get_billboard_mode() |
Controls how the object faces the camera. See BillboardMode.
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.
BlendMode blend_mode
Default |
|
Setter |
set_blend_mode(value) |
Getter |
get_blend_mode() |
The material's blend mode.
Note: Values other than Mix
force the object into the transparent pipeline. See BlendMode.
float clearcoat
Default |
|
Setter |
set_clearcoat(value) |
Getter |
get_clearcoat() |
Sets the strength of the clearcoat effect. Setting to 0
looks the same as disabling the clearcoat effect.
bool clearcoat_enabled
Default |
|
Setter |
set_feature(value) |
Getter |
get_feature() |
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 shading_mode is SHADING_MODE_UNSHADED.
float clearcoat_roughness
Default |
|
Setter |
set_clearcoat_roughness(value) |
Getter |
get_clearcoat_roughness() |
Sets the roughness of the clearcoat pass. A higher value results in a rougher clearcoat while a lower value results in a smoother clearcoat.
Texture2D clearcoat_texture
Setter |
set_texture(value) |
Getter |
get_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.
CullMode cull_mode
Default |
|
Setter |
set_cull_mode(value) |
Getter |
get_cull_mode() |
Determines which side of the triangle to cull depending on whether the triangle faces towards or away from the camera. See CullMode.
DepthDrawMode depth_draw_mode
Default |
|
Setter |
set_depth_draw_mode(value) |
Getter |
get_depth_draw_mode() |
Determines when depth rendering takes place. See DepthDrawMode. See also transparency.
Texture2D detail_albedo
Setter |
set_texture(value) |
Getter |
get_texture() |
Texture that specifies the color of the detail overlay.
BlendMode detail_blend_mode
Default |
|
Setter |
set_detail_blend_mode(value) |
Getter |
get_detail_blend_mode() |
Specifies how the detail_albedo should blend with the current ALBEDO
. See BlendMode for options.
bool detail_enabled
Default |
|
Setter |
set_feature(value) |
Getter |
get_feature() |
If true
, enables the detail overlay. Detail is a second texture that gets mixed over the surface of the object based on detail_mask. This can be used to add variation to objects, or to blend between two different albedo/normal textures.
Texture2D detail_mask
Setter |
set_texture(value) |
Getter |
get_texture() |
Texture used to specify how the detail textures get blended with the base textures.
Texture2D detail_normal
Setter |
set_texture(value) |
Getter |
get_texture() |
Texture that specifies the per-pixel normal of the detail overlay.
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.
DetailUV detail_uv_layer
Default |
|
Setter |
set_detail_uv(value) |
Getter |
get_detail_uv() |
Specifies whether to use UV
or UV2
for the detail layer. See DetailUV for options.
DiffuseMode diffuse_mode
Default |
|
Setter |
set_diffuse_mode(value) |
Getter |
get_diffuse_mode() |
The algorithm used for diffuse light scattering. See DiffuseMode.
bool disable_ambient_light
Default |
|
Setter |
set_flag(value) |
Getter |
get_flag() |
If true
, the object receives no ambient light.
bool disable_receive_shadows
Default |
|
Setter |
set_flag(value) |
Getter |
get_flag() |
If true
, the object receives no shadow that would otherwise be cast onto it.
float distance_fade_max_distance
Default |
|
Setter |
set_distance_fade_max_distance(value) |
Getter |
get_distance_fade_max_distance() |
Distance at which the object appears fully opaque.
Note: If distance_fade_max_distance
is less than distance_fade_min_distance
, the behavior will be reversed. The object will start to fade away at distance_fade_max_distance
and will fully disappear once it reaches distance_fade_min_distance
.
float distance_fade_min_distance
Default |
|
Setter |
set_distance_fade_min_distance(value) |
Getter |
get_distance_fade_min_distance() |
Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible.
Note: If distance_fade_min_distance
is greater than distance_fade_max_distance
, the behavior will be reversed. The object will start to fade away at distance_fade_max_distance
and will fully disappear once it reaches distance_fade_min_distance
.
DistanceFadeMode distance_fade_mode
Default |
|
Setter |
set_distance_fade(value) |
Getter |
get_distance_fade() |
Specifies which type of fade to use. Can be any of the DistanceFadeModes.
Color emission
Default |
|
Setter |
set_emission(value) |
Getter |
get_emission() |
The emitted light's color. See emission_enabled.
bool emission_enabled
Default |
|
Setter |
set_feature(value) |
Getter |
get_feature() |
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 is used and this object is used in baked lighting.
float emission_energy
Default |
|
Setter |
set_emission_energy(value) |
Getter |
get_emission_energy() |
The emitted light's strength. See emission_enabled.
bool emission_on_uv2
Default |
|
Setter |
set_flag(value) |
Getter |
get_flag() |
Use UV2
to read from the emission_texture.
EmissionOperator emission_operator
Default |
|
Setter |
set_emission_operator(value) |
Getter |
get_emission_operator() |
Sets how emission interacts with emission_texture. Can either add or multiply. See EmissionOperator for options.
Texture2D emission_texture
Setter |
set_texture(value) |
Getter |
get_texture() |
Texture that specifies how much surface emits light at a given point.
bool fixed_size
Default |
|
Setter |
set_flag(value) |
Getter |
get_flag() |
If true
, the object is rendered at the same size regardless of distance.
bool grow
Default |
|
Setter |
set_grow_enabled(value) |
Getter |
is_grow_enabled() |
If true
, enables the vertex grow setting. See grow_amount.
float grow_amount
Default |
|
Setter |
set_grow(value) |
Getter |
get_grow() |
Grows object vertices in the direction of their normals.
bool heightmap_deep_parallax
Default |
|
Setter |
set_heightmap_deep_parallax(value) |
Getter |
is_heightmap_deep_parallax_enabled() |
bool heightmap_enabled
Default |
|
Setter |
set_feature(value) |
Getter |
get_feature() |
If true
, height mapping is enabled (also called "parallax mapping" or "depth mapping"). See also normal_enabled.
Note: Height mapping is not supported if triplanar mapping is used on the same material. The value of heightmap_enabled will be ignored if uv1_triplanar is enabled.
bool heightmap_flip_binormal
Default |
|
Setter |
set_heightmap_deep_parallax_flip_binormal(value) |
Getter |
get_heightmap_deep_parallax_flip_binormal() |
bool heightmap_flip_tangent
Default |
|
Setter |
set_heightmap_deep_parallax_flip_tangent(value) |
Getter |
get_heightmap_deep_parallax_flip_tangent() |
bool heightmap_flip_texture
Default |
|
Setter |
set_flag(value) |
Getter |
get_flag() |
int heightmap_max_layers
Setter |
set_heightmap_deep_parallax_max_layers(value) |
Getter |
get_heightmap_deep_parallax_max_layers() |
int heightmap_min_layers
Setter |
set_heightmap_deep_parallax_min_layers(value) |
Getter |
get_heightmap_deep_parallax_min_layers() |
float heightmap_scale
Default |
|
Setter |
set_heightmap_scale(value) |
Getter |
get_heightmap_scale() |
Texture2D heightmap_texture
Setter |
set_texture(value) |
Getter |
get_texture() |
float metallic
Default |
|
Setter |
set_metallic(value) |
Getter |
get_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.
float metallic_specular
Default |
|
Setter |
set_specular(value) |
Getter |
get_specular() |
Sets the size of the specular lobe. The specular lobe is the bright spot that is reflected from light sources.
Note: Unlike metallic, this is not energy-conserving, so it should be left at 0.5
in most cases. See also roughness.
Texture2D metallic_texture
Setter |
set_texture(value) |
Getter |
get_texture() |
Texture used to specify metallic for an object. This is multiplied by metallic.
TextureChannel metallic_texture_channel
Default |
|
Setter |
set_metallic_texture_channel(value) |
Getter |
get_metallic_texture_channel() |
Specifies the channel of the metallic_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.
bool no_depth_test
Default |
|
Setter |
set_flag(value) |
Getter |
get_flag() |
If true
, depth testing is disabled and the object will be drawn in render order.
bool normal_enabled
Default |
|
Setter |
set_feature(value) |
Getter |
get_feature() |
If true
, normal mapping is enabled.
float normal_scale
Default |
|
Setter |
set_normal_scale(value) |
Getter |
get_normal_scale() |
The strength of the normal map's effect.
Texture2D normal_texture
Setter |
set_texture(value) |
Getter |
get_texture() |
Texture used to specify the normal at a given pixel. The normal_texture
only uses the red and green channels; the blue and alpha channels are ignored. The normal read from normal_texture
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 SurfaceTool.generate_normals and SurfaceTool.generate_tangents 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.
Texture2D orm_texture
Setter |
set_texture(value) |
Getter |
get_texture() |
int particles_anim_h_frames
Setter |
set_particles_anim_h_frames(value) |
Getter |
get_particles_anim_h_frames() |
The number of horizontal frames in the particle sprite sheet. Only enabled when using BILLBOARD_PARTICLES. See billboard_mode.
bool particles_anim_loop
Setter |
set_particles_anim_loop(value) |
Getter |
get_particles_anim_loop() |
If true
, particle animations are looped. Only enabled when using BILLBOARD_PARTICLES. See billboard_mode.
int particles_anim_v_frames
Setter |
set_particles_anim_v_frames(value) |
Getter |
get_particles_anim_v_frames() |
The number of vertical frames in the particle sprite sheet. Only enabled when using BILLBOARD_PARTICLES. See billboard_mode.
float point_size
Default |
|
Setter |
set_point_size(value) |
Getter |
get_point_size() |
The point size in pixels. See use_point_size.
float proximity_fade_distance
Default |
|
Setter |
set_proximity_fade_distance(value) |
Getter |
get_proximity_fade_distance() |
Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade.
bool proximity_fade_enable
Default |
|
Setter |
set_proximity_fade(value) |
Getter |
is_proximity_fade_enabled() |
If true
, the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object.
bool refraction_enabled
Default |
|
Setter |
set_feature(value) |
Getter |
get_feature() |
If true
, the refraction effect is enabled. Distorts transparency based on light from behind the object.
float refraction_scale
Default |
|
Setter |
set_refraction(value) |
Getter |
get_refraction() |
The strength of the refraction effect.
Texture2D refraction_texture
Setter |
set_texture(value) |
Getter |
get_texture() |
Texture that controls the strength of the refraction per-pixel. Multiplied by refraction_scale.
TextureChannel refraction_texture_channel
Default |
|
Setter |
set_refraction_texture_channel(value) |
Getter |
get_refraction_texture_channel() |
Specifies the channel of the ao_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.
float rim
Default |
|
Setter |
set_rim(value) |
Getter |
get_rim() |
Sets the strength of the rim lighting effect.
bool rim_enabled
Default |
|
Setter |
set_feature(value) |
Getter |
get_feature() |
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 shading_mode is SHADING_MODE_UNSHADED.
Texture2D rim_texture
Setter |
set_texture(value) |
Getter |
get_texture() |
Texture used to set the strength of the rim lighting effect per-pixel. Multiplied by rim.
float rim_tint
Default |
|
Setter |
set_rim_tint(value) |
Getter |
get_rim_tint() |
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.
float roughness
Default |
|
Setter |
set_roughness(value) |
Getter |
get_roughness() |
Surface reflection. A value of 0
represents a perfect mirror while a value of 1
completely blurs the reflection. See also metallic.
Texture2D roughness_texture
Setter |
set_texture(value) |
Getter |
get_texture() |
Texture used to control the roughness per-pixel. Multiplied by roughness.
TextureChannel roughness_texture_channel
Default |
|
Setter |
set_roughness_texture_channel(value) |
Getter |
get_roughness_texture_channel() |
Specifies the channel of the ao_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.
ShadingMode shading_mode
Default |
|
Setter |
set_shading_mode(value) |
Getter |
get_shading_mode() |
Sets whether the shading takes place per-pixel or per-vertex. Per-vertex lighting is faster, making it the best choice for mobile applications, however it looks considerably worse than per-pixel.
bool shadow_to_opacity
Default |
|
Setter |
set_flag(value) |
Getter |
get_flag() |
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.
SpecularMode specular_mode
Default |
|
Setter |
set_specular_mode(value) |
Getter |
get_specular_mode() |
The method for rendering the specular blob. See SpecularMode.
Note: Only applies to the specular blob. Does not affect specular reflections from the Sky, SSR, or ReflectionProbes.
bool subsurf_scatter_enabled
Default |
|
Setter |
set_feature(value) |
Getter |
get_feature() |
If true
, subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges.
bool subsurf_scatter_skin_mode
Default |
|
Setter |
set_flag(value) |
Getter |
get_flag() |
If true
, subsurface scattering will use a special mode optimized for the color and density of human skin.
float subsurf_scatter_strength
Default |
|
Setter |
set_subsurface_scattering_strength(value) |
Getter |
get_subsurface_scattering_strength() |
The strength of the subsurface scattering effect.
Texture2D subsurf_scatter_texture
Setter |
set_texture(value) |
Getter |
get_texture() |
Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied by subsurf_scatter_strength.
float subsurf_scatter_transmittance_boost
Default |
|
Setter |
set_transmittance_boost(value) |
Getter |
get_transmittance_boost() |
Color subsurf_scatter_transmittance_color
Default |
|
Setter |
set_transmittance_color(value) |
Getter |
get_transmittance_color() |
float subsurf_scatter_transmittance_depth
Default |
|
Setter |
set_transmittance_depth(value) |
Getter |
get_transmittance_depth() |
bool subsurf_scatter_transmittance_enabled
Default |
|
Setter |
set_feature(value) |
Getter |
get_feature() |
Texture2D subsurf_scatter_transmittance_texture
Setter |
set_texture(value) |
Getter |
get_texture() |
TextureFilter texture_filter
Default |
|
Setter |
set_texture_filter(value) |
Getter |
get_texture_filter() |
Filter flags for the texture. See TextureFilter for options.
bool texture_repeat
Default |
|
Setter |
set_flag(value) |
Getter |
get_flag() |
Repeat flags for the texture. See TextureFilter for options.
Transparency transparency