Skip to content

Boing Reactor Field Sampler

A sampler reads from a Boing Reactor Field and applies the field's influence to a target. This is how individual objects (or mesh vertices) cheaply pick up the field's reaction without each owning a full reactor.

Two variants ship with the kit:

  • CPU Sampler (BoingReactorFieldCPUSampler) — a component that samples on the CPU and writes the result to the object's transform. Use when the field is set to Hardware Mode = CPU.
  • GPU Sampler (BoingReactorFieldGPUSampler) — a component that wires the field as shader resources so a vertex shader can sample it per object or per vertex. Use when the field is set to Hardware Mode = GPU. Suited to instanced meshes and dense vertex counts.

GPU Sampling

The object's material must use a vertex shader that calls one of the helpers Boing Kit provides:

  • ApplyBoingReactorFieldPerObject — one sample per object (cheap, uniform deformation).
  • ApplyBoingReactorFieldPerVertex — one sample per vertex (fine-grained deformation).

The kit ships example HLSL shaders (built-in pipeline) that already wire these in. For custom vertex shaders, see the Example Custom Shader files in the Warped Teapots example.

URP and HDRP

For shader graphs, use the shader subgraph under Shader/ — it wraps the same helpers in node form so you can drop it into your URP/HDRP graphs. The built-in render pipeline uses the HLSL include path; the SRP variants use the subgraph.