(3 intermediate revisions by the same user not shown)
Line 8:
Line 8:
<!--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 ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|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]]
|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|{{RootFieldType|SyncAssetList`1|[[Type:Material|Material]]}}|TypeAdv1=true| 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|{{RootFieldType|SyncAssetList`1|[[Type:MaterialPropertyBlock|MaterialPropertyBlock]]}}|TypeAdv2=true| A list of material property blocks to apply to the materials on this mesh. Usually used for performance reasons where using multiple similar materials would take more resources.
|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.
|MotionVectorMode|MotionVectorMode|
|MotionVectorMode|MotionVectorMode| See Motion vector mode.
|SortingOrder|Int|
|SortingOrder|Int| Whether to render this before or after other renderers with geometry in the same location.
}}
}}
== Behavior == <!--T:3-->
== Sync Delegates ==
{{Table ComponentTriggers
|SplitSubmeshes()|[[Type:Action|Action]]| Will split this mesh into additional submeshes, each having only one material.
|MergeByMaterial()|[[Type:Action|Action]]| Will merge all submeshes that use the same material.
}}
=== Special Functions === <!--T:4-->
== Usage == <!--T:3-->
{| class="wikitable" style="font-size:10pt;"
! colspan="2" style="background: lightblue; font-size:10pt;" | Custom UI Elements
A list of material property blocks to apply to the materials on this mesh. Usually used for performance reasons where using multiple similar materials would take more resources.