Struct gdnative_bindings_lily::spatial_material::SpatialMaterial [−][src]
pub struct SpatialMaterial { /* fields omitted */ }
Expand description
core class SpatialMaterial
inherits Material
(reference counted).
Official documentation
See the documentation of this class in the Godot engine’s official documentation. The method descriptions are generated from it and typically contain code samples in GDScript, not Rust.
Memory management
The lifetime of this object is automatically managed through reference counting.
Class hierarchy
SpatialMaterial inherits methods from:
Safety
All types in the Godot API have “interior mutability” in Rust parlance.
To enforce that the official thread-safety guidelines are
followed, the typestate pattern is used in the Ref
and TRef
smart pointers,
and the Instance
API. The typestate Access
in these types tracks whether the
access is unique, shared, or exclusive to the current thread. For more information,
see the type-level documentation on Ref
.
Implementations
Constants
Creates a new instance of this object.
This is a reference-counted type. The returned object is automatically managed
by Ref
.
Threshold at which the alpha scissor will discard values.
The strength of the anisotropy effect.
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.
Specifies the channel of the [member 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.
Controls how the object faces the camera. See [enum BillboardMode].
The material’s blend mode.
Note: Values other than Mix
force the object into the transparent pipeline. See [enum BlendMode].
Sets the strength of the clearcoat effect. Setting to 0
looks the same as disabling the clearcoat effect.
Sets the roughness of the clearcoat pass. A higher value results in a smoother clearcoat while a lower value results in a rougher clearcoat.
Which side of the object is not drawn when backfaces are rendered. See [enum CullMode].
If true
, direction of the binormal is flipped before using in the depth effect. This may be necessary if you have encoded your binormals in a way that is conflicting with the depth effect.
If true
, direction of the tangent is flipped before using in the depth effect. This may be necessary if you have encoded your tangents in a way that is conflicting with the depth effect.
Number of layers to use when using [member depth_deep_parallax] and the view direction is perpendicular to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp.
Number of layers to use when using [member depth_deep_parallax] and the view direction is parallel to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp.
Determines when depth rendering takes place. See [enum DepthDrawMode]. See also [member flags_transparent].
Scales the depth offset effect. A higher number will create a larger depth.
Specifies how the [member detail_albedo] should blend with the current ALBEDO
. See [enum BlendMode] for options.
Specifies whether to use UV
or UV2
for the detail layer. See [enum DetailUV] for options.
The algorithm used for diffuse light scattering. See [enum DiffuseMode].
Specifies which type of fade to use. Can be any of the [enum DistanceFadeMode]s.
Distance at which the object fades fully and is no longer visible.
Distance at which the object starts to fade. If the object is less than this distance away it will appear normal.
The emitted light’s strength. See [member emission_enabled].
Sets how [member emission] interacts with [member emission_texture]. Can either add or multiply. See [enum EmissionOperator] for options.
Currently unimplemented in Godot.
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 [member roughness].
Specifies the channel of the [member 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.
The strength of the normal map’s effect.
The number of horizontal frames in the particle sprite sheet. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member params_billboard_mode].
If true
, particle animations are looped. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member params_billboard_mode].
The number of vertical frames in the particle sprite sheet. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member params_billboard_mode].
The point size in pixels. See [member flags_use_point_size].
Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade.
The strength of the refraction effect.
Specifies the channel of the [member 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.
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.
Surface reflection. A value of 0
represents a perfect mirror while a value of 1
completely blurs the reflection. See also [member metallic].
Specifies the channel of the [member 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.
Sets the size of the specular lobe. The specular lobe is the bright spot that is reflected from light sources.
Note: unlike [member metallic], this is not energy-conserving, so it should be left at 0.5
in most cases. See also [member roughness].
The method for rendering the specular blob. See [enum SpecularMode].
The strength of the subsurface scattering effect.
Texture used to control the transmission effect per-pixel. Added to [member transmission].
The color used by the transmission effect. Represents the light passing through an object.
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.
How much to scale the UV
coordinates. This is multiplied by UV
in the vertex function.
A lower number blends the texture more softly while a higher number blends the texture more sharply.
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.
How much to scale the UV2
coordinates. This is multiplied by UV2
in the vertex function.
A lower number blends the texture more softly while a higher number blends the texture more sharply.
If true
, the shader will read depth texture at multiple points along the view ray to determine occlusion and parrallax. This can be very performance demanding, but results in more realistic looking depth mapping.
If true
, enables the vertex grow setting. See [member params_grow_amount].
If true
, the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object.
The material’s base color.
Threshold at which the alpha scissor will discard values.
The strength of the anisotropy effect.
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.
Specifies the channel of the [member 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.
Controls how the object faces the camera. See [enum BillboardMode].
The material’s blend mode.
Note: Values other than Mix
force the object into the transparent pipeline. See [enum BlendMode].
Sets the strength of the clearcoat effect. Setting to 0
looks the same as disabling the clearcoat effect.
Sets the roughness of the clearcoat pass. A higher value results in a smoother clearcoat while a lower value results in a rougher clearcoat.
Which side of the object is not drawn when backfaces are rendered. See [enum CullMode].
If true
, the shader will read depth texture at multiple points along the view ray to determine occlusion and parrallax. This can be very performance demanding, but results in more realistic looking depth mapping.
If true
, direction of the binormal is flipped before using in the depth effect. This may be necessary if you have encoded your binormals in a way that is conflicting with the depth effect.
If true
, direction of the tangent is flipped before using in the depth effect. This may be necessary if you have encoded your tangents in a way that is conflicting with the depth effect.
Number of layers to use when using [member depth_deep_parallax] and the view direction is perpendicular to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp.
Number of layers to use when using [member depth_deep_parallax] and the view direction is parallel to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp.
Determines when depth rendering takes place. See [enum DepthDrawMode]. See also [member flags_transparent].
Scales the depth offset effect. A higher number will create a larger depth.
Specifies how the [member detail_albedo] should blend with the current ALBEDO
. See [enum BlendMode] for options.
Specifies whether to use UV
or UV2
for the detail layer. See [enum DetailUV] for options.
The algorithm used for diffuse light scattering. See [enum DiffuseMode].
Specifies which type of fade to use. Can be any of the [enum DistanceFadeMode]s.
Distance at which the object fades fully and is no longer visible.
Distance at which the object starts to fade. If the object is less than this distance away it will appear normal.
The emitted light’s color. See [member emission_enabled].
The emitted light’s strength. See [member emission_enabled].
Sets how [member emission] interacts with [member emission_texture]. Can either add or multiply. See [enum EmissionOperator] for options.
If true
, the transmission effect is enabled.
If true
, the vertex color is used as albedo color.
If true
, enables the vertex grow setting. See [member params_grow_amount].
Currently unimplemented in Godot.
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 [member roughness].
Specifies the channel of the [member 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.
The strength of the normal map’s effect.
The number of horizontal frames in the particle sprite sheet. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member params_billboard_mode].
If true
, particle animations are looped. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member params_billboard_mode].
The number of vertical frames in the particle sprite sheet. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member params_billboard_mode].
The point size in pixels. See [member flags_use_point_size].
If true
, the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object.
Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade.
The strength of the refraction effect.
Specifies the channel of the [member 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.
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.
Surface reflection. A value of 0
represents a perfect mirror while a value of 1
completely blurs the reflection. See also [member metallic].
Specifies the channel of the [member 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.
Sets the size of the specular lobe. The specular lobe is the bright spot that is reflected from light sources.
Note: unlike [member metallic], this is not energy-conserving, so it should be left at 0.5
in most cases. See also [member roughness].
The method for rendering the specular blob. See [enum SpecularMode].
The strength of the subsurface scattering effect.
Texture used to control the transmission effect per-pixel. Added to [member transmission].
The color used by the transmission effect. Represents the light passing through an object.
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.
How much to scale the UV
coordinates. This is multiplied by UV
in the vertex function.
A lower number blends the texture more softly while a higher number blends the texture more sharply.
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.
How much to scale the UV2
coordinates. This is multiplied by UV2
in the vertex function.
A lower number blends the texture more softly while a higher number blends the texture more sharply.
Methods from Deref<Target = Material>
Sets the Material to be used for the next pass. This renders the object again using a different material. Note: only applies to SpatialMaterials and ShaderMaterials with type “Spatial”.
Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects. Note: this only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).
Sets the Material to be used for the next pass. This renders the object again using a different material. Note: only applies to SpatialMaterials and ShaderMaterials with type “Spatial”.
Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects. Note: this only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).
Trait Implementations
type RefKind = RefCounted
type RefKind = RefCounted
Creates an explicitly null reference of Self
as a method argument. This makes type
inference easier for the compiler compared to Option
. Read more
Creates a new instance of Self
using a zero-argument constructor, as a Unique
reference. Read more
Performs a dynamic reference downcast to target type. Read more
Performs a static reference upcast to a supertype that is guaranteed to be valid. Read more
Creates a persistent reference to the same Godot object with shared thread access. Read more
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
Creates a persistent reference to the same Godot object with thread-local thread access. Read more
Creates a persistent reference to the same Godot object with unique access. Read more
Recovers a instance ID previously returned by Object::get_instance_id
if the object is
still alive. See also TRef::try_from_instance_id
. Read more
Auto Trait Implementations
impl RefUnwindSafe for SpatialMaterial
impl !Send for SpatialMaterial
impl !Sync for SpatialMaterial
impl Unpin for SpatialMaterial
impl UnwindSafe for SpatialMaterial