Skip to content

CVR Material Updater

Writes _CVR_Velocity and _CVR_Angular_Velocity shader properties as vectors on the attached renderer’s material. Shaders can read these to produce velocity-reactive effects. The component needs a Renderer on the same GameObject.

  • Update Runs every frame; velocity is normalized against Time.deltaTime.
  • FixedUpdate Runs on the physics tick; velocity is normalized against Time.fixedDeltaTime.

Each tick the component computes:

  • _CVR_Velocity = (lastPos - transform.position) / deltaTime — the inverted frame delta divided by the active timestep. Note this writes position delta in meters per second along the previous-to-current direction.
  • _CVR_Angular_Velocity = rotation.eulerAngles - lastRot — raw per-frame euler difference (not scaled by deltaTime).

Both values are written to the renderer’s instanced material via Renderer.material.SetVector.

  • CVR-GameFiles/ABI.CCK.Components/CVRMaterialUpdater.cs