Component:MeshRenderer: Difference between revisions

From Resonite Wiki
m Added to Renderer Category
Automated: update Replace
 
(5 intermediate revisions by 4 users not shown)
Line 6: Line 6:
|Name=MeshRenderer
|Name=MeshRenderer
}}
}}
== Intoduction == <!--T:1-->
<!--T:1-->
The '''MeshRenderer''' component is used for rendering static 3D meshes in the world, and applying materials to that mesh.
The '''MeshRenderer''' component is used for rendering static 3D meshes in the world, and applying materials to that mesh.
== Usage ==
== Usage ==
{{Table ComponentFields
{{Table ComponentFields
|Mesh|Mesh| The mesh to be rendered. Can be a [[StaticMesh (Component)|StaticMesh]] or a [[:Category:Components:Assets:Procedural Meshes|Procedural Mesh]]
|Mesh|{{RootFieldType|AssetRef`1|[[Type:Mesh|Mesh]]}}|TypeAdv0=true| The mesh to be rendered. Can be a [[StaticMesh (Component)|StaticMesh]] or a [[:Category:Components:Assets:Procedural Meshes|Procedural Mesh]]
|Materials|Material| A list of materials to be applied to the mesh
|Materials|{{RootFieldType|SyncAssetList`1|[[Type:Material|Material]]}}|TypeAdv1=true| A list of materials to be applied to the mesh
|MaterialPropertyBlocks|MaterialPropertyBlock|  
|MaterialPropertyBlocks|{{RootFieldType|SyncAssetList`1|[[Type:MaterialPropertyBlock|MaterialPropertyBlock]]}}|TypeAdv2=true|
|ShadowCastMode|ShadowCastMode| How this object will cast shadows onto the world, or if it <i>only</i> draws a shadow.
|ShadowCastMode|ShadowCastMode| How this object will cast shadows onto the world, or if it <i>only</i> draws a shadow.
|SortingOrder|Int|  
|MotionVectorMode|MotionVectorMode|
|SortingOrder|Int|
}}
 
== Sync Delegates ==
{{Table ComponentTriggers
|SplitSubmeshes()|[[Type:Action|Action]]|
|MergeByMaterial()|[[Type:Action|Action]]|
}}
}}


Line 21: Line 28:
=== Special Functions === <!--T:4-->
=== Special Functions === <!--T:4-->


{| class="wikitable" style="font-size:10pt;"
{{Table ComponentTriggers
! colspan="2" style="background: lightblue; font-size:10pt;" | Custom UI Elements
|SplitSubmeshes()|null|Will split this mesh into additional submeshes, each having only one material
|- style="font-size:10pt; text-align:center; font-weight:bold;"
|MergeByMaterial()|null|Will merge all submeshes that use the same material
| Name
}}
| Description
 
|-
| Split into separate meshes by material
| Will split this mesh into additional submeshes, each having only one material
|-
| Merge submeshes with same material
| Will merge all submeshes that use the same material
|}
== Examples == <!--T:2-->
== Examples == <!--T:2-->


== Related Components == <!--T:5-->
== Related Components == <!--T:5-->
</translate>
</translate>
[[Category:Components{{#translation:}}|MeshRenderer (Component){{#translation:}}]]
[[Category:Components{{#translation:}}|Mesh Renderer]]
[[Category:Components:Rendering{{#translation:}}|MeshRenderer (Component){{#translation:}}]]
[[Category:Components:Rendering{{#translation:}}|Mesh Renderer]]
[[Category:ComponentStubs]]
[[Category:Renderer]]
[[Category:Renderer]]

Latest revision as of 21:06, 6 November 2024


This article or section is a Stub. You can help the Resonite Wiki by expanding it.


Component image 
MeshRenderer component as seen in the Scene Inspector

The MeshRenderer component is used for rendering static 3D meshes in the world, and applying materials to that mesh.

Usage

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
Mesh Mesh The mesh to be rendered. Can be a StaticMesh or a Procedural Mesh
Materials list of Material A list of materials to be applied to the mesh
MaterialPropertyBlocks list of MaterialPropertyBlock
ShadowCastMode ShadowCastMode How this object will cast shadows onto the world, or if it only draws a shadow.
MotionVectorMode MotionVectorMode
SortingOrder Int

Sync Delegates

Triggers
Method Name Method type and Arguments. Description
SplitSubmeshes() Action
MergeByMaterial() Action

Behavior

Special Functions

Triggers
Method Name Method type and Arguments. Description
SplitSubmeshes() null Will split this mesh into additional submeshes, each having only one material
MergeByMaterial() null Will merge all submeshes that use the same material

Examples

Related Components