SpatialMaterial

Inherits: Material < Resource < Reference < Object

Category: Core

Brief Description

Default 3D rendering material.

Properties

Coloralbedo_color
Texturealbedo_texture
floatanisotropy
boolanisotropy_enabled
Textureanisotropy_flowmap
boolao_enabled
floatao_light_affect
boolao_on_uv2
Textureao_texture
TextureChannelao_texture_channel
floatclearcoat
boolclearcoat_enabled
floatclearcoat_gloss
Textureclearcoat_texture
booldepth_deep_parallax
booldepth_enabled
booldepth_flip_binormal
booldepth_flip_tangent
intdepth_max_layers
intdepth_min_layers
floatdepth_scale
Texturedepth_texture
Texturedetail_albedo
BlendModedetail_blend_mode
booldetail_enabled
Texturedetail_mask
Texturedetail_normal
DetailUVdetail_uv_layer
floatdistance_fade_max_distance
floatdistance_fade_min_distance
DistanceFadeModedistance_fade_mode
Coloremission
boolemission_enabled
floatemission_energy
boolemission_on_uv2
EmissionOperatoremission_operator
Textureemission_texture
boolflags_albedo_tex_force_srgb
boolflags_disable_ambient_light
boolflags_do_not_receive_shadows
boolflags_ensure_correct_normals
boolflags_fixed_size
boolflags_no_depth_test
boolflags_transparent
boolflags_unshaded
boolflags_use_point_size
boolflags_vertex_lighting
boolflags_world_triplanar
floatmetallic
floatmetallic_specular
Texturemetallic_texture
TextureChannelmetallic_texture_channel
boolnormal_enabled
floatnormal_scale
Texturenormal_texture
floatparams_alpha_scissor_threshold
boolparams_billboard_keep_scale
BillboardModeparams_billboard_mode
BlendModeparams_blend_mode
CullModeparams_cull_mode
DepthDrawModeparams_depth_draw_mode
DiffuseModeparams_diffuse_mode
boolparams_grow
floatparams_grow_amount
floatparams_line_width
floatparams_point_size
SpecularModeparams_specular_mode
boolparams_use_alpha_scissor
intparticles_anim_h_frames
boolparticles_anim_loop
intparticles_anim_v_frames
floatproximity_fade_distance
boolproximity_fade_enable
boolrefraction_enabled
floatrefraction_scale
Texturerefraction_texture
TextureChannelrefraction_texture_channel
floatrim
boolrim_enabled
Texturerim_texture
floatrim_tint
floatroughness
Textureroughness_texture
TextureChannelroughness_texture_channel
boolsubsurf_scatter_enabled
floatsubsurf_scatter_strength
Texturesubsurf_scatter_texture
Colortransmission
booltransmission_enabled
Texturetransmission_texture
Vector3uv1_offset
Vector3uv1_scale
booluv1_triplanar
floatuv1_triplanar_sharpness
Vector3uv2_offset
Vector3uv2_scale
booluv2_triplanar
floatuv2_triplanar_sharpness
boolvertex_color_is_srgb
boolvertex_color_use_as_albedo

Enumerations

enum TextureParam:

  • TEXTURE_ALBEDO = 0
  • TEXTURE_METALLIC = 1
  • TEXTURE_ROUGHNESS = 2
  • TEXTURE_EMISSION = 3
  • TEXTURE_NORMAL = 4
  • TEXTURE_RIM = 5
  • TEXTURE_CLEARCOAT = 6
  • TEXTURE_FLOWMAP = 7
  • TEXTURE_AMBIENT_OCCLUSION = 8
  • TEXTURE_DEPTH = 9
  • TEXTURE_SUBSURFACE_SCATTERING = 10
  • TEXTURE_TRANSMISSION = 11
  • TEXTURE_REFRACTION = 12
  • TEXTURE_DETAIL_MASK = 13
  • TEXTURE_DETAIL_ALBEDO = 14
  • TEXTURE_DETAIL_NORMAL = 15
  • TEXTURE_MAX = 16 — Represents the size of the TextureParam enum.

enum DetailUV:

  • DETAIL_UV_1 = 0
  • DETAIL_UV_2 = 1

enum Feature:

  • FEATURE_TRANSPARENT = 0
  • FEATURE_EMISSION = 1
  • FEATURE_NORMAL_MAPPING = 2
  • FEATURE_RIM = 3
  • FEATURE_CLEARCOAT = 4
  • FEATURE_ANISOTROPY = 5
  • FEATURE_AMBIENT_OCCLUSION = 6
  • FEATURE_DEPTH_MAPPING = 7
  • FEATURE_SUBSURACE_SCATTERING = 8
  • FEATURE_TRANSMISSION = 9
  • FEATURE_REFRACTION = 10
  • FEATURE_DETAIL = 11
  • FEATURE_MAX = 12 — Represents the size of the Feature enum.

enum BlendMode:

  • BLEND_MODE_MIX = 0 — Default blend mode.
  • BLEND_MODE_ADD = 1
  • BLEND_MODE_SUB = 2
  • BLEND_MODE_MUL = 3

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.
  • DEPTH_DRAW_ALPHA_OPAQUE_PREPASS = 3 — For transparent objects, an opaque pass is made first with the opaque parts, then transparency is drawn.

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_UNSHADED = 0
  • FLAG_USE_VERTEX_LIGHTING = 1
  • FLAG_DISABLE_DEPTH_TEST = 2
  • FLAG_ALBEDO_FROM_VERTEX_COLOR = 3
  • FLAG_SRGB_VERTEX_COLOR = 4
  • FLAG_USE_POINT_SIZE = 5
  • FLAG_FIXED_SIZE = 6
  • FLAG_BILLBOARD_KEEP_SCALE = 7
  • FLAG_UV1_USE_TRIPLANAR = 8
  • FLAG_UV2_USE_TRIPLANAR = 9
  • FLAG_AO_ON_UV2 = 11
  • FLAG_EMISSION_ON_UV2 = 12
  • FLAG_USE_ALPHA_SCISSOR = 13
  • FLAG_TRIPLANAR_USE_WORLD = 10
  • FLAG_ALBEDO_TEXTURE_FORCE_SRGB = 14
  • FLAG_DONT_RECEIVE_SHADOWS = 15
  • FLAG_DISABLE_AMBIENT_LIGHT = 17
  • FLAG_ENSURE_CORRECT_NORMALS = 16
  • FLAG_MAX = 18 — 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_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 — Default value.
  • 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. Enables particle animation options.

enum TextureChannel:

  • TEXTURE_CHANNEL_RED = 0
  • TEXTURE_CHANNEL_GREEN = 1
  • TEXTURE_CHANNEL_BLUE = 2
  • TEXTURE_CHANNEL_ALPHA = 3
  • TEXTURE_CHANNEL_GRAYSCALE = 4

enum EmissionOperator:

  • EMISSION_OP_ADD = 0
  • EMISSION_OP_MULTIPLY = 1

enum DistanceFadeMode:

  • DISTANCE_FADE_DISABLED = 0
  • DISTANCE_FADE_PIXEL_ALPHA = 1
  • DISTANCE_FADE_PIXEL_DITHER = 2
  • DISTANCE_FADE_OBJECT_DITHER = 3

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

Property Descriptions

Setterset_albedo(value)
Getterget_albedo()

The material’s base color.


Setterset_texture(value)
Getterget_texture()

Setterset_anisotropy(value)
Getterget_anisotropy()

The strength of the anisotropy effect.


  • bool anisotropy_enabled
Setterset_feature(value)
Getterget_feature()

If true, anisotropy is enabled. Changes the shape of the specular blob and aligns it to tangent space. Default value: false.


Setterset_texture(value)
Getterget_texture()

Setterset_feature(value)
Getterget_feature()

If true, ambient occlusion is enabled.


Setterset_ao_light_affect(value)
Getterget_ao_light_affect()

Setterset_flag(value)
Getterget_flag()

Setterset_texture(value)
Getterget_texture()

Setterset_ao_texture_channel(value)
Getterget_ao_texture_channel()

Setterset_clearcoat(value)
Getterget_clearcoat()

  • bool clearcoat_enabled
Setterset_feature(value)
Getterget_feature()

If true, clearcoat rendering is enabled. Adds a secondary transparent pass to the material. Default value: false.


Setterset_clearcoat_gloss(value)
Getterget_clearcoat_gloss()

Setterset_texture(value)
Getterget_texture()

  • bool depth_deep_parallax
Setterset_depth_deep_parallax(value)
Getteris_depth_deep_parallax_enabled()

Setterset_feature(value)
Getterget_feature()

If true, Depth mapping is enabled. See also normal_enabled.


  • bool depth_flip_binormal
Setterset_depth_deep_parallax_flip_binormal(value)
Getterget_depth_deep_parallax_flip_binormal()

  • bool depth_flip_tangent
Setterset_depth_deep_parallax_flip_tangent(value)
Getterget_depth_deep_parallax_flip_tangent()

  • int depth_max_layers
Setterset_depth_deep_parallax_max_layers(value)
Getterget_depth_deep_parallax_max_layers()

  • int depth_min_layers
Setterset_depth_deep_parallax_min_layers(value)
Getterget_depth_deep_parallax_min_layers()

Setterset_depth_scale(value)
Getterget_depth_scale()

Setterset_texture(value)
Getterget_texture()

Setterset_texture(value)
Getterget_texture()

Setterset_detail_blend_mode(value)
Getterget_detail_blend_mode()

  • bool detail_enabled
Setterset_feature(value)
Getterget_feature()

Setterset_texture(value)
Getterget_texture()

Setterset_texture(value)
Getterget_texture()

Setterset_detail_uv(value)
Getterget_detail_uv()

  • float distance_fade_max_distance
Setterset_distance_fade_max_distance(value)
Getterget_distance_fade_max_distance()

  • float distance_fade_min_distance
Setterset_distance_fade_min_distance(value)
Getterget_distance_fade_min_distance()

Setterset_distance_fade(value)
Getterget_distance_fade()

Setterset_emission(value)
Getterget_emission()

The emitted light’s color. See emission_enabled.


  • bool emission_enabled
Setterset_feature(value)
Getterget_feature()

If true, the body emits light.


Setterset_emission_energy(value)
Getterget_emission_energy()

The emitted light’s strength. See emission_enabled.


  • bool emission_on_uv2
Setterset_flag(value)
Getterget_flag()

Setterset_emission_operator(value)
Getterget_emission_operator()

Setterset_texture(value)
Getterget_texture()

  • bool flags_albedo_tex_force_srgb
Setterset_flag(value)
Getterget_flag()

  • bool flags_disable_ambient_light
Setterset_flag(value)
Getterget_flag()

If true, the object receives no ambient light. Default value: false.


  • bool flags_do_not_receive_shadows
Setterset_flag(value)
Getterget_flag()

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


  • bool flags_ensure_correct_normals
Setterset_flag(value)
Getterget_flag()

  • bool flags_fixed_size
Setterset_flag(value)
Getterget_flag()

If true, the object is rendered at the same size regardless of distance. Default value: false.


  • bool flags_no_depth_test
Setterset_flag(value)
Getterget_flag()

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


  • bool flags_transparent
Setterset_feature(value)
Getterget_feature()

If true, transparency is enabled on the body. Default value: false. See also params_blend_mode.


  • bool flags_unshaded
Setterset_flag(value)
Getterget_flag()

If true, the object is unaffected by lighting. Default value: false.


  • bool flags_use_point_size
Setterset_flag(value)
Getterget_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 params_point_size.


  • bool flags_vertex_lighting
Setterset_flag(value)
Getterget_flag()

If true, lighting is calculated per vertex rather than per pixel. This may increase performance on low-end devices. Default value: false.


  • bool flags_world_triplanar
Setterset_flag(value)
Getterget_flag()

If true, triplanar mapping is calculated in world space rather than object local space. See also uv1_triplanar. Default value: false.


Setterset_metallic(value)
Getterget_metallic()

The reflectivity of the object’s surface. The higher the value the more light is reflected.


Setterset_specular(value)
Getterget_specular()

General reflectivity amount. Note: unlike metallic, this is not energy-conserving, so it should be left at 0.5 in most cases. See also roughness.


Setterset_texture(value)
Getterget_texture()

Setterset_metallic_texture_channel(value)
Getterget_metallic_texture_channel()

  • bool normal_enabled
Setterset_feature(value)
Getterget_feature()

If true, normal mapping is enabled.


Setterset_normal_scale(value)
Getterget_normal_scale()

The strength of the normal map’s effect.


Setterset_texture(value)
Getterget_texture()

  • float params_alpha_scissor_threshold
Setterset_alpha_scissor_threshold(value)
Getterget_alpha_scissor_threshold()

  • bool params_billboard_keep_scale
Setterset_flag(value)
Getterget_flag()

Setterset_billboard_mode(value)
Getterget_billboard_mode()

Controls how the object faces the camera. See BillboardMode.


Setterset_blend_mode(value)
Getterget_blend_mode()

The material’s blend mode. Note that values other than Mix force the object into the transparent pipeline. See BlendMode.


Setterset_cull_mode(value)
Getterget_cull_mode()

Which side of the object is not drawn when backfaces are rendered. See CullMode.


Setterset_depth_draw_mode(value)
Getterget_depth_draw_mode()

Determines when depth rendering takes place. See DepthDrawMode. See also flags_transparent.


Setterset_diffuse_mode(value)
Getterget_diffuse_mode()

The algorithm used for diffuse light scattering. See DiffuseMode.


Setterset_grow_enabled(value)
Getteris_grow_enabled()

If true, enables the vertex grow setting. See params_grow_amount.


  • float params_grow_amount
Setterset_grow(value)
Getterget_grow()

Grows object vertices in the direction of their normals.


Setterset_line_width(value)
Getterget_line_width()

Setterset_point_size(value)
Getterget_point_size()

The point size in pixels. See flags_use_point_size.


Setterset_specular_mode(value)
Getterget_specular_mode()

The method for rendering the specular blob. See SpecularMode.


  • bool params_use_alpha_scissor
Setterset_flag(value)
Getterget_flag()

  • int particles_anim_h_frames
Setterset_particles_anim_h_frames(value)
Getterget_particles_anim_h_frames()

The number of horizontal frames in the particle spritesheet. Only enabled when using BillboardMode.BILLBOARD_PARTICLES. See params_billboard_mode.


  • bool particles_anim_loop
Setterset_particles_anim_loop(value)
Getterget_particles_anim_loop()

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


  • int particles_anim_v_frames
Setterset_particles_anim_v_frames(value)
Getterget_particles_anim_v_frames()

The number of vertical frames in the particle spritesheet. Only enabled when using BillboardMode.BILLBOARD_PARTICLES. See params_billboard_mode.


  • float proximity_fade_distance
Setterset_proximity_fade_distance(value)
Getterget_proximity_fade_distance()

  • bool proximity_fade_enable
Setterset_proximity_fade(value)
Getteris_proximity_fade_enabled()

If true, the proximity and distance fade effect is enabled. Default value: false.


  • bool refraction_enabled
Setterset_feature(value)
Getterget_feature()

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


Setterset_refraction(value)
Getterget_refraction()

The strength of the refraction effect.


Setterset_texture(value)
Getterget_texture()

Setterset_refraction_texture_channel(value)
Getterget_refraction_texture_channel()

Setterset_rim(value)
Getterget_rim()

Setterset_feature(value)
Getterget_feature()

If true, rim effect is enabled. Default value: false.


Setterset_texture(value)
Getterget_texture()

Setterset_rim_tint(value)
Getterget_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.


Setterset_roughness(value)
Getterget_roughness()

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


Setterset_texture(value)
Getterget_texture()

Setterset_roughness_texture_channel(value)
Getterget_roughness_texture_channel()

  • bool subsurf_scatter_enabled
Setterset_feature(value)
Getterget_feature()

If true, subsurface scattering is enabled. Emulates light that penetrates an object’s surface, is scattered, and then emerges.


  • float subsurf_scatter_strength
Setterset_subsurface_scattering_strength(value)
Getterget_subsurface_scattering_strength()

The strength of the subsurface scattering effect.


Setterset_texture(value)
Getterget_texture()

Setterset_transmission(value)
Getterget_transmission()

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


  • bool transmission_enabled
Setterset_feature(value)
Getterget_feature()

If true, the transmission effect is enabled. Default value: false.


Setterset_texture(value)
Getterget_texture()

Setterset_uv1_offset(value)
Getterget_uv1_offset()

Setterset_uv1_scale(value)
Getterget_uv1_scale()

Setterset_flag(value)
Getterget_flag()

  • float uv1_triplanar_sharpness
Setterset_uv1_triplanar_blend_sharpness(value)
Getterget_uv1_triplanar_blend_sharpness()

Setterset_uv2_offset(value)
Getterget_uv2_offset()

Setterset_uv2_scale(value)
Getterget_uv2_scale()

Setterset_flag(value)
Getterget_flag()

  • float uv2_triplanar_sharpness
Setterset_uv2_triplanar_blend_sharpness(value)
Getterget_uv2_triplanar_blend_sharpness()

  • bool vertex_color_is_srgb
Setterset_flag(value)
Getterget_flag()

If true, the model’s vertex colors are processed as sRGB mode. Default value: false.


  • bool vertex_color_use_as_albedo
Setterset_flag(value)
Getterget_flag()

If true, the vertex color is used as albedo color. Default value: false.