This workflow requires Lenga 0.10.1 or later.
These two frames show the same view before and during an exaggerated warp. The straight shapes in the world ripple, while the purple HUD label keeps its shape and position. Start with gentler values in your game.


Set Up the View
- Select the scene's primary camera and enable Post Processing.
- Keep the scene's post-processing profile assigned if it already supplies bloom, color grading, or another look.
- Preview the effect in Play mode. A runtime override lasts only while the scene is running and does not edit the profile asset.
Use the same override key to start and update an effect. Give unrelated effects different keys so ending one does not clear another.
Add a Two-Second Warp
Attach this behaviour to an active gameplay object. Call its play() method from your pickup or ability code. This example uses scaled gameplay time, so changing the game's time scale also changes how fast the effect progresses.
use Lenga\Engine\Core\Behaviour;
use Lenga\Engine\Core\Time;
use Lenga\Engine\Rendering\PeripheralWarpOverride;
use Lenga\Engine\Rendering\PostProcessing;
use Lenga\Engine\Rendering\PostProcessingOverride;
final class BoostScreenEffect extends Behaviour
{
private const string LAYER = 'boost.screen-warp';
private const float DURATION = 2.0;
private float $remaining = 0.0;
public function play(): void
{
$this->remaining = self::DURATION;
$this->applyWarp(1.0, 0.0);
}
public function update(): void
{
if ($this->remaining <= 0.0) {
return;
}
$this->remaining = max(0.0, $this->remaining - Time::deltaTime());
if ($this->remaining === 0.0) {
PostProcessing::clearOverride(self::LAYER);
return;
}
$elapsed = self::DURATION - $this->remaining;
$this->applyWarp($this->remaining / self::DURATION, $elapsed * 5.0);
}
public function onDisable(): void
{
$this->remaining = 0.0;
PostProcessing::clearOverride(self::LAYER);
}
private function applyWarp(float $weight, float $phase): void
{
PostProcessing::setOverride(self::LAYER, new PostProcessingOverride(
weight: $weight,
peripheralWarp: new PeripheralWarpOverride(
enabled: true,
intensity: 0.8,
safeRadius: 0.65,
smoothness: 0.3,
rippleAmplitude: 0.016,
rippleFrequency: 7.0,
phase: $phase,
),
));
}
}
The layer changes only peripheralWarp. A second pickup restarts the timer and replaces the layer under the same key. When the effect expires or the behaviour is disabled, clearing the key restores the look from the scene profile and any other active layers. Leaving the scene also discards its runtime layers.
Tune the Effect
- Increase
safeRadiusto keep more of the center clear. - Start with a small
rippleAmplitude. Increase it only until the distortion reads at your game's usual resolution. - Animate
phaseto move the ripple. Fadeweightto blend the effect out. - Use a lower intensity for long effects and leave important control hints in screen-space UI.
If the layer exists but the image does not change, check that Post Processing is enabled on the primary camera, the layer has a nonzero weight and intensity, and the warp is enabled. If the effect outlasts the pickup, check that your end and cancellation paths clear the same key.
See the PostProcessing scripting API for the supported options and layering rules.