diff options
author | Fernando Cosentino <fbcosentino@yahoo.com.br> | 2021-09-25 19:40:26 +0100 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2022-01-05 11:47:51 +0100 |
commit | ca79373d135634b45518e82edcce15b15d25171c (patch) | |
tree | 905939a9f7e2ffcfa424e45845bbe4f9cfe74a51 /doc/classes | |
parent | 2c7fcdd7f94307a8dbf9436edc3294aaa6f87a88 (diff) |
Added material_overlay property to MeshInstance3D
Applying overlay materials into multi-surface meshes currently
requires adding a next pass material to all the surfaces, which
might be cumbersome when the material is to be applied to a range
of different geometries. This also makes it not trivial to use
AnimationPlayer to control the material in case of visual effects.
The material_override property is not an option as it works
replacing the active material for the surfaces, not adding a new pass.
This commit adds the material_overlay property to GeometryInstance3D
(and therefore MeshInstance3D), having the same reach as
material_override (that is, all surfaces) but adding a new material
pass on top of the active materials, instead of replacing them.
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/GeometryInstance3D.xml | 4 | ||||
-rw-r--r-- | doc/classes/RenderingServer.xml | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/doc/classes/GeometryInstance3D.xml b/doc/classes/GeometryInstance3D.xml index 0d230288a8..cecd1e518f 100644 --- a/doc/classes/GeometryInstance3D.xml +++ b/doc/classes/GeometryInstance3D.xml @@ -47,6 +47,10 @@ </member> <member name="lod_bias" type="float" setter="set_lod_bias" getter="get_lod_bias" default="1.0"> </member> + <member name="material_overlay" type="Material" setter="set_material_overlay" getter="get_material_overlay"> + The material overlay for the whole geometry. + If a material is assigned to this property, it will be rendered on top of any other active material for all the surfaces. + </member> <member name="material_override" type="Material" setter="set_material_override" getter="get_material_override"> The material override for the whole geometry. If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh. diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 5d82126839..f17f6293bc 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -1403,6 +1403,14 @@ <description> </description> </method> + <method name="instance_geometry_set_material_overlay"> + <return type="void" /> + <argument index="0" name="instance" type="RID" /> + <argument index="1" name="material" type="RID" /> + <description> + Sets a material that will be rendered for all surfaces on top of active materials for the mesh associated with this instance. Equivalent to [member GeometryInstance3D.material_overlay]. + </description> + </method> <method name="instance_geometry_set_material_override"> <return type="void" /> <argument index="0" name="instance" type="RID" /> |