{{description>Generate 3D meshes with Curvy Splines' Volume Mesh module! Customize materials, UV settings, & optimize Unity performance with chunk splitting.}}
====== Volume Mesh ======
This component is used in example scene(s) such as:
21_CGExtrusion, 23_CGTube, 24_CGConformPath.
Generates one or more [[..:datatypes#VMesh|VMeshes]] from a [[..:datatypes#Volume|Volume]]. This is typically connected after [[.:shapeextrusion|Shape Extrusion]] and before [[.:createmesh|Create Mesh]].
===== Slots =====
==== Inputs ====
^ Name ^ Type ^ Description ^
| Volume | [[..:datatypes#Volume|Volume]] | The volume to turn into mesh data |
==== Outputs ====
^ Name ^ Type ^ Description ^
| VMesh[] | Array of [[..:datatypes#VMesh|VMesh]] | The resulting mesh data, one VMesh per material |
===== Settings =====
==== General ====
Global mesh generation options.
=== Reverse Tri Order ===
Flips the triangle winding order, which inverts the normals. Use this if the mesh appears inside-out.
=== Generate UV ===
When enabled, UV coordinates are calculated for the mesh.
=== Unscale U ===
//(Requires Generate UV)//
When the [[.:shapeextrusion|Shape Extrusion]] module applies scaling, the U coordinate can become distorted. Enable this to compensate. Only the X component of the scaling is taken into account. Works best on volumes with flat cross-sections.
=== Unscaling Origin ===
//(Requires Unscale U)//
The scaling origin used for the U compensation. A value of 0.5 usually gives the best results, but you may need to adjust it (typically between 0 and 1).
=== Generate UV2 ===
When enabled, a second set of UV coordinates (UV2) is calculated, typically used for lightmapping.
=== Split ===
When enabled, the volume is divided into chunks of a fixed length.
=== Split Length ===
//(Requires Split)//
The chunk length in world units. A new VMesh is created each time this length is reached.
Splitting is useful for faster lightmap baking and for Unity optimizations such as frustum culling.
=== Add Material Group ===
Click to add an additional material mapping entry to the list below.
==== Materials ====
Maps material IDs stored in the [[..:datatypes#Volume|Volume]] to Unity materials (material IDs come from [[.:shapeextrusion|Shape Extrusion]] and [[..:..:splines:curvysplinesegment#meta_cg_options|control point settings]]). At least one material entry is required.
=== Material ID ===
The material ID this entry applies to.
=== Swap UV ===
Swaps U and V coordinates for this material.
=== Keep Aspect ===
Preserves texel proportions:
* **Off** - no correction applied
* **Scale U** - U is scaled to maintain proportional texels
* **Scale V** - V is scaled to maintain proportional texels
=== UV Offset ===
Offsets the UV coordinates, equivalent to Unity's material tiling offset.
=== UV Scale ===
Scales the UV coordinates, equivalent to Unity's material tiling scale.
=== Material ===
The Unity material to assign to this material ID.
=== Remove ===
Removes this material mapping entry.