Skip to content

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.

The component doesn’t move anything. Each frame it:

  1. Samples its spline into two small 1D textures, in each target mesh’s local space.
  2. Pushes those textures plus scalar/vector values into the mesh’s dynamic material instances.
  3. The material calls the deform material function, which returns final world-space World Position Offset, connected straight to the material’s World Position Offset output.

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 plugin ships everything wired under /SplineJuice/Materials/:

AssetRole
MF_SplineJuiceDeformThe material function that wraps the deform shader and outputs world-space WPO.
M_SplineJuice_Static_MasterAn opaque, two-sided starter material wired into WPO.
MI_SplineJuice_Static_DefaultA default instance to assign to static meshes.
M_SplineJuicePieceVizThe 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 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).

ParameterTypePurpose
SplineJuice_PositionTextureTexture1D spline offset texture (local space).
SplineJuice_TangentTextureTexture1D spline tangent texture (local space).
SplineJuice_ProgressScalarNormalized travel: 0 = path start, 1 = rest pose.
SplineJuice_StretchScaleScalarCurrent stretch amount along the forward axis.
SplineJuice_SizeScaleScalarUniform size multiplier (1 = original).
SplineJuice_SizeAffectsLengthScalar (bool)1 = size affects length + girth; 0 = girth only.
SplineJuice_SplineLengthScalarPath length in the mesh’s local space.
SplineJuice_SampleCountScalarNumber of samples in the 1D textures.
SplineJuice_MeshCenterLocalVectorCaptured local bounds center of the mesh.
SplineJuice_ForwardAxisLocalVectorLocal axis that stretches along the spline.
SplineJuice_FollowSplineRotationScalar (bool)1 = follow spline tangent rotation.
SplineJuice_PreserveVolumeScalar (bool)1 = squash perpendicular axes to preserve volume.

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.

ParameterTypePurpose
SplineJuice_PrevProgressScalarLast frame’s Progress.
SplineJuice_PrevStretchScaleScalarLast frame’s StretchScale.
SplineJuice_PrevSizeScaleScalarLast frame’s SizeScale.

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.

MF_SplineJuiceDeform exposes one extra graph input that isn’t a component parameter:

  • ExistingWPO (Vector3, default 0,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.

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.