Material Contract
Most users never touch this; the settings panel’s Generate authors a deform-capable material for you. This page is the reference for custom materials: how the effect is wired, and the exact parameters a material must expose.
How it works
Section titled “How it works”The component doesn’t move anything. Each frame it:
- Samples its spline into two small 1D textures, in each target mesh’s local space.
- Pushes those textures plus scalar/vector values into the mesh’s dynamic material instances.
- The material calls the deform material function, which returns final
world-space World Position Offset, connected straight to the material’s
World Position Offsetoutput.
Because it’s all WPO, the surface can travel, squash, stretch, and rotate along the spline and settle back into the original pose, without moving the actor or collision.
The ready-made content
Section titled “The ready-made content”The plugin ships everything wired under /SplineJuice/Materials/:
| Asset | Role |
|---|---|
MF_SplineJuiceDeform | The material function that wraps the deform shader and outputs world-space WPO. |
M_SplineJuice_Static_Master | An opaque, two-sided starter material wired into WPO. |
MI_SplineJuice_Static_Default | A default instance to assign to static meshes. |
M_SplineJuicePieceViz | The unlit vertex-color material used for the Pieces tab’s Segmentation preview. |
To make your own material deformation-capable, call MF_SplineJuiceDeform,
feed it local vertex position, and connect its output directly to World
Position Offset; the function already returns world space, so no external
transform is needed.
The name-based contract
Section titled “The name-based contract”The component communicates with the material entirely through named
parameters. A material must expose these exact names (or you override the
names in the component’s Material Parameter Names property).
Core parameters
Section titled “Core parameters”| Parameter | Type | Purpose |
|---|---|---|
SplineJuice_PositionTexture | Texture | 1D spline offset texture (local space). |
SplineJuice_TangentTexture | Texture | 1D spline tangent texture (local space). |
SplineJuice_Progress | Scalar | Normalized travel: 0 = path start, 1 = rest pose. |
SplineJuice_StretchScale | Scalar | Current stretch amount along the forward axis. |
SplineJuice_SizeScale | Scalar | Uniform size multiplier (1 = original). |
SplineJuice_SizeAffectsLength | Scalar (bool) | 1 = size affects length + girth; 0 = girth only. |
SplineJuice_SplineLength | Scalar | Path length in the mesh’s local space. |
SplineJuice_SampleCount | Scalar | Number of samples in the 1D textures. |
SplineJuice_MeshCenterLocal | Vector | Captured local bounds center of the mesh. |
SplineJuice_ForwardAxisLocal | Vector | Local axis that stretches along the spline. |
SplineJuice_FollowSplineRotation | Scalar (bool) | 1 = follow spline tangent rotation. |
SplineJuice_PreserveVolume | Scalar (bool) | 1 = squash perpendicular axes to preserve volume. |
Motion-vector parameters
Section titled “Motion-vector parameters”The deform is parameter-driven WPO, which the engine’s velocity pass can’t see
on its own, so the function evaluates the deform a second time from these
previous-frame values and routes both through a PreviousFrameSwitch. This
gives correct motion vectors and stops the moving mesh from ghosting /
smearing under TAA / TSR.
| Parameter | Type | Purpose |
|---|---|---|
SplineJuice_PrevProgress | Scalar | Last frame’s Progress. |
SplineJuice_PrevStretchScale | Scalar | Last frame’s StretchScale. |
SplineJuice_PrevSizeScale | Scalar | Last frame’s SizeScale. |
Assembly parameters (optional)
Section titled “Assembly parameters (optional)”These exist only on materials whose deform function was processed for assembly,
and are optional: the deform is bit-for-bit unchanged when
SplineJuice_AssembleAmount is 0. They include SplineJuice_AssembleAmount,
AssemblePhase, ExplodeRadius, TumbleTurns, AssembleWindow,
AssembleLag, PieceCount, BodyHalfLength, two baked UV inputs
(PieceCenterUV on UV6, PieceIndexUV on UV7), and the Prev* copies for
motion vectors. See Assembly Along the Spline.
The ExistingWPO input
Section titled “The ExistingWPO input”MF_SplineJuiceDeform exposes one extra graph input that isn’t a component
parameter:
ExistingWPO(Vector3, default0,0,0): your material’s pre-existing World Position Offset, rerouted through the function so it’s preserved. The deformation is added on top. Leave it unconnected to reproduce offset-only behavior exactly.
Validation
Section titled “Validation”If a material is missing required parameters, the component logs a warning naming the missing parameters and the mesh material slot. Watch the Output Log when wiring a custom material by hand.