github_url: | hide |
---|
Inherits: :ref:`Material<class_Material>` < :ref:`Resource<class_Resource>` < :ref:`Reference<class_Reference>` < :ref:`Object<class_Object>`
Inherited By: :ref:`ORMMaterial3D<class_ORMMaterial3D>`, :ref:`StandardMaterial3D<class_StandardMaterial3D>`
Default 3D rendering material.
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.
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 :ref:`anisotropy<class_BaseMaterial3D_property_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_TRANSMISSION = 11 --- Texture specifying per-pixel transmission color.
- TEXTURE_REFRACTION = 12 --- Texture specifying per-pixel refraction strength.
- TEXTURE_DETAIL_MASK = 13 --- Texture specifying per-pixel detail mask blending value.
- TEXTURE_DETAIL_ALBEDO = 14 --- Texture specifying per-pixel detail color.
- TEXTURE_DETAIL_NORMAL = 15 --- Texture specifying per-pixel detail normal.
- TEXTURE_ORM = 16
- TEXTURE_MAX = 17 --- Represents the size of the :ref:`TextureParam<enum_BaseMaterial3D_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 four pixels. Use this for most cases where you want to avoid a pixelated style.
- TEXTURE_FILTER_NEAREST_WITH_MIPMAPS = 2
- TEXTURE_FILTER_LINEAR_WITH_MIPMAPS = 3
- TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC = 4
- TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC = 5
- TEXTURE_FILTER_MAX = 6 --- Represents the size of the :ref:`TextureFilter<enum_BaseMaterial3D_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
- TRANSPARENCY_ALPHA_DEPTH_PRE_PASS = 3
- TRANSPARENCY_MAX = 4 --- Represents the size of the :ref:`Transparency<enum_BaseMaterial3D_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 :ref:`ShadingMode<enum_BaseMaterial3D_ShadingMode>` enum.
enum Feature:
- FEATURE_EMISSION = 0 --- Constant for setting :ref:`emission_enabled<class_BaseMaterial3D_property_emission_enabled>`.
- FEATURE_NORMAL_MAPPING = 1 --- Constant for setting :ref:`normal_enabled<class_BaseMaterial3D_property_normal_enabled>`.
- FEATURE_RIM = 2 --- Constant for setting :ref:`rim_enabled<class_BaseMaterial3D_property_rim_enabled>`.
- FEATURE_CLEARCOAT = 3 --- Constant for setting :ref:`clearcoat_enabled<class_BaseMaterial3D_property_clearcoat_enabled>`.
- FEATURE_ANISOTROPY = 4 --- Constant for setting :ref:`anisotropy_enabled<class_BaseMaterial3D_property_anisotropy_enabled>`.
- FEATURE_AMBIENT_OCCLUSION = 5 --- Constant for setting :ref:`ao_enabled<class_BaseMaterial3D_property_ao_enabled>`.
- FEATURE_HEIGHT_MAPPING = 6
- FEATURE_SUBSURACE_SCATTERING = 7 --- Constant for setting :ref:`subsurf_scatter_enabled<class_BaseMaterial3D_property_subsurf_scatter_enabled>`.
- FEATURE_TRANSMISSION = 8 --- Constant for setting :ref:`transmission_enabled<class_BaseMaterial3D_property_transmission_enabled>`.
- FEATURE_REFRACTION = 9 --- Constant for setting :ref:`refraction_enabled<class_BaseMaterial3D_property_refraction_enabled>`.
- FEATURE_DETAIL = 10 --- Constant for setting :ref:`detail_enabled<class_BaseMaterial3D_property_detail_enabled>`.
- FEATURE_MAX = 11 --- Represents the size of the :ref:`Feature<enum_BaseMaterial3D_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 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.
- CULL_FRONT = 1 --- The front of the object is culled when not visible.
- 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 :ref:`billboard_mode<class_BaseMaterial3D_property_billboard_mode>` is :ref:`BILLBOARD_ENABLED<class_BaseMaterial3D_constant_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 :ref:`ao_texture<class_BaseMaterial3D_property_ao_texture>`. - FLAG_EMISSION_ON_UV2 = 11 --- Use
UV2
coordinates to look up from the :ref:`emission_texture<class_BaseMaterial3D_property_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
- FLAG_INVERT_HEIGHTMAP = 17 --- Invert values read from a depth texture to convert them to height values (heightmap).
- FLAG_MAX = 18 --- Represents the size of the :ref:`Flags<enum_BaseMaterial3D_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_OREN_NAYAR = 3 --- Attempts to use roughness to emulate microsurfacing.
- DIFFUSE_TOON = 4 --- Uses a hard cut for lighting, with smoothing affected by roughness.
enum SpecularMode:
- SPECULAR_SCHLICK_GGX = 0 --- Default specular blob.
- SPECULAR_BLINN = 1 --- Older specular algorithm, included for compatibility.
- SPECULAR_PHONG = 2 --- Older specular algorithm, included for compatibility.
- SPECULAR_TOON = 3 --- Toon blob which changes size based on roughness.
- SPECULAR_DISABLED = 4 --- 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 :ref:`Particles<class_Particles>` and :ref:`CPUParticles<class_CPUParticles>` nodes. Enables
particles_anim_*
properties.
The :ref:`ParticlesMaterial.anim_speed<class_ParticlesMaterial_property_anim_speed>` or :ref:`CPUParticles.anim_speed<class_CPUParticles_property_anim_speed>` should also be set to a positive value 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 :ref:`DISTANCE_FADE_PIXEL_ALPHA<class_BaseMaterial3D_constant_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 :ref:`DISTANCE_FADE_PIXEL_ALPHA<class_BaseMaterial3D_constant_DISTANCE_FADE_PIXEL_ALPHA>`.
- :ref:`Color<class_Color>` albedo_color
Default | Color( 1, 1, 1, 1 ) |
Setter | set_albedo(value) |
Getter | get_albedo() |
The material's base color.
- :ref:`bool<class_bool>` albedo_tex_force_srgb
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
Forces a conversion of the :ref:`albedo_texture<class_BaseMaterial3D_property_albedo_texture>` from sRGB space to linear space.
- :ref:`Texture2D<class_Texture2D>` albedo_texture
Setter | set_texture(value) |
Getter | get_texture() |
Texture to multiply by :ref:`albedo_color<class_BaseMaterial3D_property_albedo_color>`. Used for basic texturing of objects.
- :ref:`float<class_float>` alpha_scissor_threshold
Setter | set_alpha_scissor_threshold(value) |
Getter | get_alpha_scissor_threshold() |
Threshold at which the alpha scissor will discard values.
- :ref:`float<class_float>` anisotropy
Setter | set_anisotropy(value) |
Getter | get_anisotropy() |
The strength of the anisotropy effect.
- :ref:`bool<class_bool>` anisotropy_enabled
Default | false |
Setter | set_feature(value) |
Getter | get_feature() |
If true
, anisotropy is enabled. Changes the shape of the specular blob and aligns it to tangent space. Mesh tangents are needed for this to work. If the mesh does not contain tangents the anisotropy effect will appear broken.
- :ref:`Texture2D<class_Texture2D>` anisotropy_flowmap
Setter | set_texture(value) |
Getter | get_texture() |
Texture that offsets the tangent map for anisotropy calculations.
- :ref:`bool<class_bool>` ao_enabled
Default | false |
Setter | set_feature(value) |
Getter | get_feature() |
If true
, ambient occlusion is enabled. Ambient occlusion darkens areas based on the :ref:`ao_texture<class_BaseMaterial3D_property_ao_texture>`.
- :ref:`float<class_float>` ao_light_affect
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.
- :ref:`bool<class_bool>` ao_on_uv2
Setter | set_flag(value) |
Getter | get_flag() |
If true
, use UV2
coordinates to look up from the :ref:`ao_texture<class_BaseMaterial3D_property_ao_texture>`.
- :ref:`Texture2D<class_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.
- :ref:`TextureChannel<enum_BaseMaterial3D_TextureChannel>` ao_texture_channel
Setter | set_ao_texture_channel(value) |
Getter | get_ao_texture_channel() |
Specifies the channel of the :ref:`ao_texture<class_BaseMaterial3D_property_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.
- :ref:`bool<class_bool>` billboard_keep_scale
Default | false |
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 :ref:`billboard_mode<class_BaseMaterial3D_property_billboard_mode>` is :ref:`BILLBOARD_ENABLED<class_BaseMaterial3D_constant_BILLBOARD_ENABLED>`.
- :ref:`BillboardMode<enum_BaseMaterial3D_BillboardMode>` billboard_mode
Default | 0 |
Setter | set_billboard_mode(value) |
Getter | get_billboard_mode() |
Controls how the object faces the camera. See :ref:`BillboardMode<enum_BaseMaterial3D_BillboardMode>`.
Default | 0 |
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 :ref:`BlendMode<enum_BaseMaterial3D_BlendMode>`.
- :ref:`float<class_float>` clearcoat
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.
- :ref:`bool<class_bool>` clearcoat_enabled
Default | false |
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.
- :ref:`float<class_float>` clearcoat_gloss
Setter | set_clearcoat_gloss(value) |
Getter | get_clearcoat_gloss() |
Sets the roughness of the clearcoat pass. A higher value results in a smoother clearcoat while a lower value results in a rougher clearcoat.
- :ref:`Texture2D<class_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.
Default | 0 |
Setter | set_cull_mode(value) |
Getter | get_cull_mode() |
Which side of the object is not drawn when backfaces are rendered. See :ref:`CullMode<enum_BaseMaterial3D_CullMode>`.
- :ref:`DepthDrawMode<enum_BaseMaterial3D_DepthDrawMode>` depth_draw_mode
Default | 0 |
Setter | set_depth_draw_mode(value) |
Getter | get_depth_draw_mode() |
Determines when depth rendering takes place. See :ref:`DepthDrawMode<enum_BaseMaterial3D_DepthDrawMode>`. See also :ref:`transparency<class_BaseMaterial3D_property_transparency>`.
- :ref:`Texture2D<class_Texture2D>` detail_albedo
Setter | set_texture(value) |
Getter | get_texture() |
Texture that specifies the color of the detail overlay.
- :ref:`BlendMode<enum_BaseMaterial3D_BlendMode>` detail_blend_mode
Setter | set_detail_blend_mode(value) |
Getter | get_detail_blend_mode() |
Specifies how the :ref:`detail_albedo<class_BaseMaterial3D_property_detail_albedo>` should blend with the current ALBEDO
. See :ref:`BlendMode<enum_BaseMaterial3D_BlendMode>` for options.
- :ref:`bool<class_bool>` detail_enabled
Default | false |
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 :ref:`detail_mask<class_BaseMaterial3D_property_detail_mask>`. This can be used to add variation to objects, or to blend between two different albedo/normal textures.
- :ref:`Texture2D<class_Texture2D>` detail_mask
Setter | set_texture(value) |
Getter | get_texture() |
Texture used to specify how the detail textures get blended with the base textures.
- :ref:`Texture2D<class_Texture2D>` detail_normal
Setter | set_texture(value) |
Getter | get_texture() |
Texture that specifies the per-pixel normal of the detail overlay.
- :ref:`DetailUV<enum_BaseMaterial3D_DetailUV>` detail_uv_layer
Setter | set_detail_uv(value) |
Getter | get_detail_uv() |
Specifies whether to use UV
or UV2
for the detail layer. See :ref:`DetailUV<enum_BaseMaterial3D_DetailUV>` for options.
- :ref:`DiffuseMode<enum_BaseMaterial3D_DiffuseMode>` diffuse_mode
Default | 0 |
Setter | set_diffuse_mode(value) |
Getter | get_diffuse_mode() |
The algorithm used for diffuse light scattering. See :ref:`DiffuseMode<enum_BaseMaterial3D_DiffuseMode>`.
- :ref:`bool<class_bool>` disable_ambient_light
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
If true
, the object receives no ambient light.
- :ref:`bool<class_bool>` disable_receive_shadows
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
If true
, the object receives no shadow that would otherwise be cast onto it.
- :ref:`float<class_float>` distance_fade_max_distance
Setter | set_distance_fade_max_distance(value) |
Getter | get_distance_fade_max_distance() |
Distance at which the object fades fully and is no longer visible.
- :ref:`float<class_float>` distance_fade_min_distance
Setter | set_distance_fade_min_distance(value) |
Getter | get_distance_fade_min_distance() |
Distance at which the object starts to fade. If the object is less than this distance away it will appear normal.
- :ref:`DistanceFadeMode<enum_BaseMaterial3D_DistanceFadeMode>` distance_fade_mode
Default | 0 |
Setter | set_distance_fade(value) |
Getter | get_distance_fade() |
Specifies which type of fade to use. Can be any of the :ref:`DistanceFadeMode<enum_BaseMaterial3D_DistanceFadeMode>`s.
- :ref:`Color<class_Color>` emission
Setter | set_emission(value) |
Getter | get_emission() |
The emitted light's color. See :ref:`emission_enabled<class_BaseMaterial3D_property_emission_enabled>`.
- :ref:`bool<class_bool>` emission_enabled
Default | false |
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 :ref:`GIProbe<class_GIProbe>` is used and this object is used in baked lighting.
- :ref:`float<class_float>` emission_energy
Setter | set_emission_energy(value) |
Getter | get_emission_energy() |
The emitted light's strength. See :ref:`emission_enabled<class_BaseMaterial3D_property_emission_enabled>`.
- :ref:`bool<class_bool>` emission_on_uv2
Setter | set_flag(value) |
Getter | get_flag() |
Use UV2
to read from the :ref:`emission_texture<class_BaseMaterial3D_property_emission_texture>`.
- :ref:`EmissionOperator<enum_BaseMaterial3D_EmissionOperator>` emission_operator
Setter | set_emission_operator(value) |
Getter | get_emission_operator() |
Sets how :ref:`emission<class_BaseMaterial3D_property_emission>` interacts with :ref:`emission_texture<class_BaseMaterial3D_property_emission_texture>`. Can either add or multiply. See :ref:`EmissionOperator<enum_BaseMaterial3D_EmissionOperator>` for options.
- :ref:`Texture2D<class_Texture2D>` emission_texture
Setter | set_texture(value) |
Getter | get_texture() |
Texture that specifies how much surface emits light at a given point.
- :ref:`bool<class_bool>` fixed_size
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
If true
, the object is rendered at the same size regardless of distance.
Default | false |
Setter | set_grow_enabled(value) |
Getter | is_grow_enabled() |
If true
, enables the vertex grow setting. See :ref:`grow_amount<class_BaseMaterial3D_property_grow_amount>`.
- :ref:`float<class_float>` grow_amount
Default | 0.0 |
Setter | set_grow(value) |
Getter | get_grow() |
Grows object vertices in the direction of their normals.
- :ref:`bool<class_bool>` heightmap_deep_parallax
Setter | set_heightmap_deep_parallax(value) |
Getter | is_heightmap_deep_parallax_enabled() |
- :ref:`bool<class_bool>` heightmap_enabled
Default | false |
Setter | set_feature(value) |
Getter | get_feature() |
- :ref:`bool<class_bool>` heightmap_flip_binormal
Setter | set_heightmap_deep_parallax_flip_binormal(value) |
Getter | get_heightmap_deep_parallax_flip_binormal() |
- :ref:`bool<class_bool>` heightmap_flip_tangent
Setter | set_heightmap_deep_parallax_flip_tangent(value) |
Getter | get_heightmap_deep_parallax_flip_tangent() |
- :ref:`bool<class_bool>` heightmap_flip_texture
Setter | set_flag(value) |
Getter | get_flag() |
- :ref:`int<class_int>` heightmap_max_layers
Setter | set_heightmap_deep_parallax_max_layers(value) |
Getter | get_heightmap_deep_parallax_max_layers() |
- :ref:`int<class_int>` heightmap_min_layers
Setter | set_heightmap_deep_parallax_min_layers(value) |
Getter | get_heightmap_deep_parallax_min_layers() |
- :ref:`float<class_float>` heightmap_scale
Setter | set_heightmap_scale(value) |
Getter | get_heightmap_scale() |
- :ref:`Texture2D<class_Texture2D>` heightmap_texture
Setter | set_texture(value) |
Getter | get_texture() |
- :ref:`float<class_float>` metallic
Default | 0.0 |
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 :ref:`roughness<class_BaseMaterial3D_property_roughness>`.
- :ref:`float<class_float>` metallic_specular
Default | 0.5 |
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 :ref:`metallic<class_BaseMaterial3D_property_metallic>`, this is not energy-conserving, so it should be left at 0.5
in most cases. See also :ref:`roughness<class_BaseMaterial3D_property_roughness>`.
- :ref:`Texture2D<class_Texture2D>` metallic_texture
Setter | set_texture(value) |
Getter | get_texture() |
Texture used to specify metallic for an object. This is multiplied by :ref:`metallic<class_BaseMaterial3D_property_metallic>`.
- :ref:`TextureChannel<enum_BaseMaterial3D_TextureChannel>` metallic_texture_channel
Default | 0 |
Setter | set_metallic_texture_channel(value) |
Getter | get_metallic_texture_channel() |
Specifies the channel of the :ref:`metallic_texture<class_BaseMaterial3D_property_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.
- :ref:`bool<class_bool>` no_depth_test
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
If true
, depth testing is disabled and the object will be drawn in render order.
- :ref:`bool<class_bool>` normal_enabled
Default | false |
Setter | set_feature(value) |
Getter | get_feature() |
If true
, normal mapping is enabled.
- :ref:`float<class_float>` normal_scale
Setter | set_normal_scale(value) |
Getter | get_normal_scale() |
The strength of the normal map's effect.
- :ref:`Texture2D<class_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 normal read from normal_texture
is oriented around the surface normal provided by the :ref:`Mesh<class_Mesh>`.
- :ref:`Texture2D<class_Texture2D>` orm_texture
Setter | set_texture(value) |
Getter | get_texture() |
- :ref:`int<class_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 :ref:`BILLBOARD_PARTICLES<class_BaseMaterial3D_constant_BILLBOARD_PARTICLES>`. See :ref:`billboard_mode<class_BaseMaterial3D_property_billboard_mode>`.
- :ref:`bool<class_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 :ref:`BILLBOARD_PARTICLES<class_BaseMaterial3D_constant_BILLBOARD_PARTICLES>`. See :ref:`billboard_mode<class_BaseMaterial3D_property_billboard_mode>`.
- :ref:`int<class_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 :ref:`BILLBOARD_PARTICLES<class_BaseMaterial3D_constant_BILLBOARD_PARTICLES>`. See :ref:`billboard_mode<class_BaseMaterial3D_property_billboard_mode>`.
- :ref:`float<class_float>` point_size
Default | 1.0 |
Setter | set_point_size(value) |
Getter | get_point_size() |
The point size in pixels. See :ref:`use_point_size<class_BaseMaterial3D_property_use_point_size>`.
- :ref:`float<class_float>` proximity_fade_distance
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.
- :ref:`bool<class_bool>` proximity_fade_enable
Default | false |
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.
- :ref:`bool<class_bool>` refraction_enabled
Default | false |
Setter | set_feature(value) |
Getter | get_feature() |
If true
, the refraction effect is enabled. Distorts transparency based on light from behind the object.
- :ref:`float<class_float>` refraction_scale
Setter | set_refraction(value) |
Getter | get_refraction() |
The strength of the refraction effect.
- :ref:`Texture2D<class_Texture2D>` refraction_texture
Setter | set_texture(value) |
Getter | get_texture() |
Texture that controls the strength of the refraction per-pixel. Multiplied by :ref:`refraction_scale<class_BaseMaterial3D_property_refraction_scale>`.
- :ref:`TextureChannel<enum_BaseMaterial3D_TextureChannel>` refraction_texture_channel
Setter | set_refraction_texture_channel(value) |
Getter | get_refraction_texture_channel() |
Specifies the channel of the :ref:`ao_texture<class_BaseMaterial3D_property_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.
Setter | set_rim(value) |
Getter | get_rim() |
Sets the strength of the rim lighting effect.
- :ref:`bool<class_bool>` rim_enabled
Default | false |
Setter | set_feature(value) |
Getter | get_feature() |
If true
, rim effect is enabled. Rim lighting increases the brightness at glancing angles on an object.
- :ref:`Texture2D<class_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 :ref:`rim<class_BaseMaterial3D_property_rim>`.
- :ref:`float<class_float>` rim_tint
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.
- :ref:`float<class_float>` roughness
Default | 1.0 |
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 :ref:`metallic<class_BaseMaterial3D_property_metallic>`.
- :ref:`Texture2D<class_Texture2D>` roughness_texture
Setter | set_texture(value) |
Getter | get_texture() |
Texture used to control the roughness per-pixel. Multiplied by :ref:`roughness<class_BaseMaterial3D_property_roughness>`.
- :ref:`TextureChannel<enum_BaseMaterial3D_TextureChannel>` roughness_texture_channel
Default | 0 |
Setter | set_roughness_texture_channel(value) |
Getter | get_roughness_texture_channel() |
Specifies the channel of the :ref:`ao_texture<class_BaseMaterial3D_property_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.
- :ref:`ShadingMode<enum_BaseMaterial3D_ShadingMode>` shading_mode
Default | 1 |
Setter | set_shading_mode(value) |
Getter | get_shading_mode() |
- :ref:`bool<class_bool>` shadow_to_opacity
Default | false |
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.
- :ref:`SpecularMode<enum_BaseMaterial3D_SpecularMode>` specular_mode
Default | 0 |
Setter | set_specular_mode(value) |
Getter | get_specular_mode() |
The method for rendering the specular blob. See :ref:`SpecularMode<enum_BaseMaterial3D_SpecularMode>`.
- :ref:`bool<class_bool>` subsurf_scatter_enabled
Default | false |
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.
- :ref:`float<class_float>` subsurf_scatter_strength
Setter | set_subsurface_scattering_strength(value) |
Getter | get_subsurface_scattering_strength() |
The strength of the subsurface scattering effect.
- :ref:`Texture2D<class_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 :ref:`subsurf_scatter_strength<class_BaseMaterial3D_property_subsurf_scatter_strength>`.
- :ref:`TextureFilter<enum_BaseMaterial3D_TextureFilter>` texture_filter
Default | 3 |
Setter | set_texture_filter(value) |
Getter | get_texture_filter() |
Filter flags for the texture. See :ref:`TextureFilter<enum_BaseMaterial3D_TextureFilter>` for options.
- :ref:`bool<class_bool>` texture_repeat
Default | true |
Setter | set_flag(value) |
Getter | get_flag() |
Repeat flags for the texture. See :ref:`TextureFilter<enum_BaseMaterial3D_TextureFilter>` for options.
- :ref:`Color<class_Color>` transmission
Setter | set_transmission(value) |
Getter | get_transmission() |
The color used by the transmission effect. Represents the light passing through an object.
- :ref:`bool<class_bool>` transmission_enabled
Default | false |
Setter | set_feature(value) |
Getter | get_feature() |
If true
, the transmission effect is enabled.
- :ref:`Texture2D<class_Texture2D>` transmission_texture
Setter | set_texture(value) |
Getter | get_texture() |
Texture used to control the transmission effect per-pixel. Added to :ref:`transmission<class_BaseMaterial3D_property_transmission>`.
Default | 0 |
Setter | set_transparency(value) |
Getter | get_transparency() |
If true
, transparency is enabled on the body. See also :ref:`blend_mode<class_BaseMaterial3D_property_blend_mode>`.
- :ref:`bool<class_bool>` use_point_size
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
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 :ref:`point_size<class_BaseMaterial3D_property_point_size>`.
- :ref:`Vector3<class_Vector3>` uv1_offset
Default | Vector3( 0, 0, 0 ) |
Setter | set_uv1_offset(value) |
Getter | get_uv1_offset() |
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.
- :ref:`Vector3<class_Vector3>` uv1_scale
Default | Vector3( 1, 1, 1 ) |
Setter | set_uv1_scale(value) |
Getter | get_uv1_scale() |
How much to scale the UV
coordinates. This is multiplied by UV
in the vertex function.
- :ref:`bool<class_bool>` uv1_triplanar
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
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.
- :ref:`float<class_float>` uv1_triplanar_sharpness
Default | 1.0 |
Setter | set_uv1_triplanar_blend_sharpness(value) |
Getter | get_uv1_triplanar_blend_sharpness() |
A lower number blends the texture more softly while a higher number blends the texture more sharply.
- :ref:`bool<class_bool>` uv1_world_triplanar
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
If true
, triplanar mapping for UV
is calculated in world space rather than object local space. See also :ref:`uv1_triplanar<class_BaseMaterial3D_property_uv1_triplanar>`.
- :ref:`Vector3<class_Vector3>` uv2_offset
Default | Vector3( 0, 0, 0 ) |
Setter | set_uv2_offset(value) |
Getter | get_uv2_offset() |
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.
- :ref:`Vector3<class_Vector3>` uv2_scale
Default | Vector3( 1, 1, 1 ) |
Setter | set_uv2_scale(value) |
Getter | get_uv2_scale() |
How much to scale the UV2
coordinates. This is multiplied by UV2
in the vertex function.
- :ref:`bool<class_bool>` uv2_triplanar
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
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.
- :ref:`float<class_float>` uv2_triplanar_sharpness
Default | 1.0 |
Setter | set_uv2_triplanar_blend_sharpness(value) |
Getter | get_uv2_triplanar_blend_sharpness() |
A lower number blends the texture more softly while a higher number blends the texture more sharply.
- :ref:`bool<class_bool>` uv2_world_triplanar
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
If true
, triplanar mapping for UV2
is calculated in world space rather than object local space. See also :ref:`uv2_triplanar<class_BaseMaterial3D_property_uv2_triplanar>`.
- :ref:`bool<class_bool>` vertex_color_is_srgb
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
If true
, the model's vertex colors are processed as sRGB mode.
- :ref:`bool<class_bool>` vertex_color_use_as_albedo
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
If true
, the vertex color is used as albedo color.
- :ref:`bool<class_bool>` get_feature ( :ref:`Feature<enum_BaseMaterial3D_Feature>` feature ) const
Returns true
, if the specified :ref:`Feature<enum_BaseMaterial3D_Feature>` is enabled.
- :ref:`bool<class_bool>` get_flag ( :ref:`Flags<enum_BaseMaterial3D_Flags>` flag ) const
Returns true
, if the specified flag is enabled. See :ref:`Flags<enum_BaseMaterial3D_Flags>` enumerator for options.
- :ref:`Texture2D<class_Texture2D>` get_texture ( :ref:`TextureParam<enum_BaseMaterial3D_TextureParam>` param ) const
Returns the :ref:`Texture<class_Texture>` associated with the specified :ref:`TextureParam<enum_BaseMaterial3D_TextureParam>`.
- void set_feature ( :ref:`Feature<enum_BaseMaterial3D_Feature>` feature, :ref:`bool<class_bool>` enable )
If true
, enables the specified :ref:`Feature<enum_BaseMaterial3D_Feature>`. Many features that are available in BaseMaterial3D
s 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 to true
.
- void set_flag ( :ref:`Flags<enum_BaseMaterial3D_Flags>` flag, :ref:`bool<class_bool>` enable )
If true
, 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 to true
. See :ref:`Flags<enum_BaseMaterial3D_Flags>` enumerator for options.
- void set_texture ( :ref:`TextureParam<enum_BaseMaterial3D_TextureParam>` param, :ref:`Texture2D<class_Texture2D>` texture )
Sets the texture for the slot specified by param
. See :ref:`TextureParam<enum_BaseMaterial3D_TextureParam>` for available slots.