Skip to content

Rope Renderer

The RopeRenderer component translates raw physics particle positions into a smooth, continuous 3D tube mesh in real time. It interpolates physics points using Catmull-Rom splines and constructs procedural geometry per frame with zero GC allocation.


Usage

Attach RopeRenderer to the same GameObject hosting your RopeController. It automatically requires and manages a standard Unity MeshFilter and MeshRenderer.


Parameter Reference

1. Mesh Settings

ParameterTypeDefaultDescription
Radiusfloat0.05Cross-sectional radius (thickness) of the tube in world meters.
Tube Segmentsint8Radial resolution (e.g., 8 vertices forms an octagonal cylinder). Lower values optimize rendering performance.
Mesh Resolutionint4Longitudinal subdivisions inserted between consecutive physics particles to produce smooth spline curvature.
Close EndsbooltrueGenerates geometric end caps on both rope terminals. Uncheck if ends are tucked inside pulleys or anchors.
Use BatchingboolfalseEnables global draw-call aggregation via RopeBatchManager. Automatically delegates rendering to the shared batch buffer.

2. Texture & UV Settings

ParameterTypeDefaultDescription
Texture Tilingfloat2.0UV coordinate repetitions per meter of rope length.
UV Offsetfloat0.0Shifts the longitudinal V coordinate along the length. Ideal for winching or conveyor belt motion effects.

3. Material Assignment

Assign any standard Unity Material supporting URP, HDRP, or Built-in pipelines. Tensio outputs clean Normals, Tangents, and UV0 channels compatible with PBR surface shaders, normal maps, and roughness maps.


Dynamic Stress Feedback

When Visualize Stretch is active on the parent RopeController, the renderer provides immediate physical feedback:

  1. Mesh Thinning: Procedurally contracts the tube radius as tensile elongation increases according to Poisson’s ratio.
  2. Color Tinting: Blends material color (via _BaseColor or _Color shader properties) toward a designated warning tint (e.g. orange/red) as stress approaches breaking point.