Texturing Dynamic Softbodies

The render mesh of a Dynamic Softbody Actor is not authored once — it is rebuilt every frame from the current outer boundary of the tetrahedral simulation mesh so that cuts and tears immediately expose new surface. Because the vertices are generated on the fly, UVs cannot be stored on the mesh the usual way; they have to be attached to the simulation topology (particles and tetrahedra) so the rebuild can re-emit them every frame.

This page explains how that works and how to give a dynamic softbody a real texture.

Wedges

Every tetrahedron in the simulation mesh exposes up to four boundary faces (triangles). A wedge is a single (face, corner) — one corner of one boundary triangle.

A single particle is usually shared by several faces. That sharing is the crux of the texturing problem:

  • If UVs are stored per particle, every face that touches a particle is forced to use the same UV for it. Any UV seam that runs through that particle collapses, which produces stretched or scrambled texturing (the classic “rainbow” triangles) — especially with atlas-style unwraps where neighbouring triangles intentionally live in different parts of the texture.

  • If UVs are stored per wedge (per face-corner), each face carries its own three corner UVs. Adjacent tetrahedra — and even different faces of the same tetrahedron — can then hold distinct UVs for a shared particle, so authored seams and per-triangle unwraps round-trip exactly.

UV Storage Modes

The UV Storage Mode field in the actor’s Render Settings selects between the two:

Mode

Behaviour

Per-Particle

One UV per particle. Simple and backward-compatible; this is the default. Seams collapse (see above), so it is best for tiling / procedural materials where exact UV layout does not matter. Works with both flat and smooth shading.

Per-Wedge

One UV per face-corner, stored against the tetrahedra. Preserves authored UV seams and per-triangle atlases. The geometry is always rebuilt flat (per-corner vertices) in this mode; Smooth Shading still works and is applied as a normals-only pass on top.

You rarely set this field by hand — assigning a Wedge Coords (.tetuv) asset switches it to Per-Wedge automatically, and clearing that asset reverts it to Per-Particle.

The Wedge Coords (.tetuv) asset

Per-wedge UVs are carried by a first-class project asset: a Wedge Coords asset, stored on disk as a .tetuv file next to its simulation mesh. It holds the per-face-corner UV payload plus a validation stamp (the source mesh’s volume-constraint count and particle count) so it can be rejected if it no longer matches the mesh it was baked for.

There are three ways to produce a .tetuv:

  1. The Bake UVs window — bakes a fresh atlas and albedo from the original textured model. This is the recommended path and is described below.

  2. The Tetrahedralize window — when tetrahedralizing a UV-mapped mesh in the editor, tick Also bake wedge UVs (.tetuv) to emit a sidecar sourced from the input mesh’s own UV seams. See Tetrahedral Mesh.

  3. An OBJ round-trip — export the live surface, unwrap it in an external tool, and re-import it. See Round-trip via OBJ.

Baking a texture with the Bake UVs window

The Bake UVs window generates a seamed per-wedge UV layout directly from a simulation mesh and bakes the original (pre-tetrahedralization) model’s albedo onto that layout. It writes two files beside the simulation mesh: a .tetuv sidecar (imported as a Wedge Coords asset) and a <name>_Albedo.png texture.

Open it from ORamaVR Creator > Mesh Deformations > Bake UVs…, or right-click a Simulation Mesh asset and choose ORamaVR Creator > Bake UVs… to pre-fill the simulation mesh field.

Fill in the inputs:

Field

Description

Simulation Mesh

The simulation mesh used by the dynamic softbody. Its boundary surface is what gets unwrapped.

Original Mesh

The original, textured surface mesh (the one you tetrahedralized). Its albedo is sampled onto the new layout.

Source Albedo

The original model’s albedo/diffuse texture, sampled during the bake.

Output Resolution

Size of the baked _Albedo.png (256 – 4096).

Padding (UV units)

Gutter added around UV islands to avoid bleeding between charts when mip-mapped.

UV Mapping Mode

How the boundary surface is unwrapped — see the table below.

Min Cell (texels)

(Per-Triangle Atlas only) Minimum size of each triangle’s atlas cell, in texels.

Chart Angle (°)

(Box Projection only) The largest angle a triangle’s normal may deviate from its chart’s average before a new UV island begins. Higher = larger charts / fewer seams but more stretch; lower = flatter, more fragmented charts. 60° reproduces the classic six-island box layout on a cube.

Assume Hull (trust topology)

On: every boundary triangle is baked (fast; trusts the tetrahedralized surface). Turn off to run an outward ray-cast that culls triangles judged interior/buried — use when the surface still carries spurious internal faces. Culling can also drop real faces deep in concave pockets.

Extrusion / Max Ray Distance

Control the sampling ray used to transfer albedo from the original mesh onto the baked layout.

Space Alignment (advanced)

Leave at identity (position 0, rotation 0, scale 1) when the original and simulation meshes share object space — the common case. Use Show Preview in Scene to spawn both meshes temporarily and drag the textured original with the scene handles to line it up; the fields update automatically.

The two UV mapping modes are:

Mode

Trade-off

Box Projection

Orthographic projection onto the six signed cardinal planes. Fast and contiguous, but concave pockets can starve or overlap. Default; preserves historical behaviour.

Per-Triangle Atlas

One disjoint atlas cell per boundary triangle. No holes by construction and zero per-triangle distortion, at the cost of a seam on every triangle edge.

Click Bake. When it finishes:

  1. Select the DynamicSoftbodyActor and assign the generated .tetuv (Wedge Coords) asset to the Wedge Coords (.tetuv) field. This bakes the UVs in and switches UV Storage Mode to Per-Wedge.

  2. Assign the baked _Albedo.png to the material on the object’s MeshRenderer.

Assigning a Wedge Coords asset

Assigning a .tetuv asset to the Wedge Coords (.tetuv) field validates it against the actor’s simulation mesh. The editor reports a dialog if the assignment is rejected:

  • No Simulation Mesh — assign a Simulation Mesh before assigning a Wedge Coords asset.

  • Stamp mismatch — the asset’s volume-constraint / particle counts do not match the current simulation mesh. Re-bake the UVs against the mesh you are actually using.

  • Invalid payload — the asset carries no valid per-wedge UV data (for example a stale, old-format file).

Clearing the field reverts the actor to Per-Particle storage and drops the baked UVs.

Importing UVs from an existing mesh

The inspector also offers direct import buttons for transferring UVs from an existing model. Use these when you already have a UV-mapped mesh that matches the softbody’s shape and just want to copy its coordinates over.

Button

What it does

Import UV Map from Existing Mesh

Per-particle transfer by nearest-neighbour from a selected .fbx. Simplest option; results in Per-Particle storage (seams collapse).

Import UV Map from Existing Mesh (Barycentric)

Per-particle transfer that samples the source surface barycentrically for smoother results. Also Per-Particle.

Import UV Map (Per-Wedge)

Seamed, index-based transfer that produces Per-Wedge UVs. Requires the .uvmap sidecar that Export to OBJ writes alongside the .obj — see below. Accepts .obj/.fbx and auto-finds the sidecar by file name. If no sidecar is found it offers to fall back to the legacy per-particle import.

Round-trip via OBJ

To author a seamed unwrap in an external tool (Blender, Maya, …) and bring it back per-wedge:

  1. Enter Play mode so the runtime render mesh is populated.

  2. Click Export to OBJ. This writes the current outer-hull render mesh as an .obj and, alongside it, a .uvmap sidecar that records the per-wedge key of every exported vertex.

  3. Unwrap / edit the OBJ in your external tool. Do not weld or reorder vertices — the .uvmap sidecar is aligned to the exported vertex order, so the imported mesh’s vertex count must match it. Export with vertex welding disabled.

  4. Back in Unity, click Import UV Map (Per-Wedge) and pick the edited model. The sidecar is found automatically by file name and the seamed UVs are applied as Per-Wedge.

Note

The Export to OBJ render mesh only fully populates in Play mode. Exporting in Edit mode may produce an empty or smoothed mesh.