Shape Deform
Displaces shape vertices procedurally using a vector/scalar field or a uniform value. Preserves topology -- only vertex positions change.
Category: Shape Ops Menu path: Shape Ops > ShapeDeform
Ports
| Port | Type | Direction | Description |
|---|---|---|---|
shape_in | shape | input | Shape to deform |
field_in | vectorField | input | Spatially varying displacement field (also accepts scalarField) |
value_in | vec2 | input | Uniform displacement vector (also accepts scalar) |
amplitude_in | scalar | input | Override for amplitude param |
out | shape | output | Deformed shape |
Parameters
| Param | Type | Default | Description |
|---|---|---|---|
mode | enum | Normal | Displacement direction: Normal, Tangent, XY, X, or Y |
amplitude | scalar | 50 | Displacement magnitude in pixels |
source | enum | Field | Signal source: Field or Value |
How It Works
ShapeDeform visits every vertex in the input shape and displaces it based on the selected mode and signal source:
- Field source: The
field_inport provides a spatially varying signal. Each vertex samples the field at its position usingeval_bipolar()(range [-1, 1]). A scalarField connected tofield_inis also accepted. - Value source: The
value_inport provides a uniform displacement applied equally to all vertices.
The amplitude parameter scales the displacement. The mode determines the direction:
- Normal -- displace along the vertex normal (perpendicular to the path)
- Tangent -- displace along the path tangent (parallel to the path)
- XY -- displace in both X and Y independently
- X / Y -- displace along a single axis only
Only vertex positions are modified; path topology, point IDs, and attributes are preserved. This means downstream nodes like DrawShape see the same structure but different vertex locations.
ShapeDeform runs in the value pre-pass (before GPU evaluation) so that downstream nodes like Transform2D and DrawShape use accurate deformed bounds for overscan computation.
Usage Examples
Basic: Wavy edges
Rectangle -> ShapeDeform (mode: Normal, field: Noise.scalarField) -> T2D -> DrawShape -> Output. The rectangle's edges ripple based on the noise field. Animate Noise evolution for flowing deformation.
Organic shapes
Circle -> ResampleShape (count: 64) -> ShapeDeform (mode: Normal, field: Noise.vectorField, amplitude: 30) -> DrawShape. Resample first to add enough vertices for smooth deformation, then displace along normals for blob-like organic shapes.
Uniform shift
Rectangle -> ShapeDeform (source: Value, mode: XY, value_in: MakeVector) -> DrawShape. Use a MakeVector node to create a displacement offset, applying the same shift to all vertices.
Tips
- Resample your shape upstream (ResampleShape) if it doesn't have enough vertices for smooth deformation -- a Rectangle with only 4 corners will deform coarsely
- Noise with Curl type produces smooth, divergence-free deformation that avoids self-intersection
- ShapeDeform is terminal in content bounds computation -- it reads the pre-pass AABB rather than passing through, because deformation changes the shape's bounding box
- Amplitude is animatable -- keyframe it for deformation that grows or shrinks over time
Related Nodes
- ResampleShape -- add more vertices before deforming for smoother results
- Noise -- primary field source for procedural deformation
- DistanceField -- SDF field source for distance-based deformation
- Transform2D -- rigid spatial transform (no deformation)
- DrawShape -- rasterize the deformed shape