Component
Reveal Lens
A circle on screen that shows another view, such as ultraviolet light in which clues glow, X-ray, thermal or a magnifier.
What it does
A Reveal Lens draws a circle on screen that shows the world another way. Ultraviolet is dim violet light in which marked clues glow, like blood traces under a UV lamp in a detective game. X Ray is an inverted, edge lit view. Thermal shows heat colors with the marked objects hot. Magnifier enlarges what is under the lens.
The circle can follow where the lens's object points (put it on a flashlight or the character), sit in the middle of the screen like a scope, sit at a screen point a script sets, or follow the mouse pointer or a finger. Outside the circle, Dim Outside darkens the picture like the dark around a flashlight beam.
The clues are the objects in the lens's own Clues list, which need nothing else, or every object carrying a Pass Forge Effect Mask. Show Behind Walls lights listed clues up through walls, like an X-ray. The lens sets its own look and needs no Volume.
Add it
- Select the object the lens belongs to: a flashlight, the character, or the camera.
- Choose Add Component > Pass Forge > Reveal Lens.
- Under Where, pick Placement. On a flashlight, keep Follow Object and set Distance. For a magnifying glass under the mouse, pick Mouse Pointer.
- Under Clues, keep Look For at These Objects and drag the clue objects into Clues. Or pick Effect Masks to light every object with a Pass Forge Effect Mask.
- Under Look, pick Style.
- If the inspector warns about setup or Post Processing, press its button.

Settings
Where
| Setting | What it does |
|---|---|
| Placement | Where the lens sits on screen. Follow Object (default): where this object points, for a flashlight, a scanner or a magnifying glass in the world. Screen Center: the middle of the screen, like a scope or a held lens. Screen Point: a screen point set from a script. Mouse Pointer: under the mouse, or the first touch. |
| Distance | Shown for Follow Object. How far ahead of this object the lens looks, in meters. Default 5. |
| Screen Point | Shown for Screen Point. Screen point of the lens, from 0, 0 at the bottom left to 1, 1 at the top right. Default 0.5, 0.5. |
| Radius | Radius of the lens, as a share of the screen height, from 0.01 to 1. Default 0.18. |
| Softness | Share of the radius over which the lens edge fades, from 0 to 1. Default 0.3. |
Clues
| Setting | What it does |
|---|---|
| Look For | These Objects lights up the objects in the Clues list. Effect Masks lights up every object carrying a Pass Forge Effect Mask, or on a rendering layer chosen in Effect Mask Layers. A new lens starts at These Objects. |
| Clues | Shown for These Objects. The objects the lens looks for, with their children. They need no Effect Mask. |
| Show Behind Walls | Shown for These Objects. Light up the clues behind walls and other objects too, like an X-ray. Off (default) lights up only what the camera sees. |
| Clue Color | Glow color of the clues inside the lens. HDR. Default pale green. |
Look
| Setting | What it does |
|---|---|
| Style | What the lens shows: Ultraviolet (default) light in which clues glow, an X Ray view, Thermal heat colors, or a Magnifier view. |
| Magnification | Shown for Magnifier. How much the Magnifier enlarges, from 1 to 8. Default 2. |
| Dim Outside | Darkening outside the lens, like the dark around a flashlight beam, from 0 to 1. Default 0.4. |
| Ring Width | Width of a thin ring around the lens, in pixels, from 0 to 8. Zero (default) draws none. |
| Ring Color | Shown when Ring Width is above zero. Color of the ring around the lens. |
What the inspector also shows:
- Set Up Effects and Turn On Post Processing buttons when screen effects cannot show.
- On a camera with Follow Object: a note that on a camera, where it points is the middle of the screen, and to put the lens on a flashlight or the character, or pick Mouse Pointer.
- For Screen Point: a note to set
screenPointfrom a script. - For These Objects with an empty list: "Drag the objects the lens looks for into Clues. They light up inside the lens, and only they do."
- For Effect Masks with no mask in the scene: a note to add an Effect Mask or Effect Mask Layers, or to pick These Objects.
- "Only one lens draws: the one on ..., which was turned on later." when another lens was enabled after this one.
- When a scene Volume overrides Style: "A Volume in the scene overrides Style with ..., so that is what the lens shows. Untick Style in that Volume's Reveal Lens to use the one here."
Common jobs
A UV flashlight that shows blood traces
- Add a Reveal Lens to the flashlight object. Keep Placement at Follow Object and set Distance to how far ahead the beam lands, such as 4.
- Drag the blood trace objects into Clues.
- Keep Style at Ultraviolet, raise Dim Outside to 0.6.
Where the flashlight points, a violet circle shows, and the traces inside it glow in the Clue Color.
A magnifying glass under the mouse
- Add a Reveal Lens anywhere, set Placement to Mouse Pointer.
- Set Style to Magnifier, Magnification to 2.5, Ring Width to 2.
The circle follows the mouse or the first touch. With no pointer, as on a gamepad, it waits in the middle of the screen.
X-ray goggles that show enemies through walls
- Add a Reveal Lens to the camera, set Placement to Screen Center, Radius to 0.35.
- Drag the enemies into Clues and tick Show Behind Walls.
- Set Style to X Ray.
Inside the circle, the enemies light up even behind walls.
A thermal lens that shows every enemy hot
- Put the enemies on a rendering layer and add an Effect Mask Layers that picks it, or add an Effect Mask to each enemy.
- Add a Reveal Lens, set Look For to Effect Masks and Style to Thermal.
Spawned enemies on the layer show hot as soon as they appear. With Look For at Effect Masks, the Include Hidden Parts setting of the Effect Mask, or of the Effect Mask Layers, decides whether the marked objects show through walls.
Move the lens with a gamepad stick
Set Placement to Screen Point and change screenPoint from your input code each frame, as in the script below.
Restyle the lens from a preset
Apply the screen preset UV Light Reveal, X-Ray Lens, Thermal Lens or Magnifier Lens to a Volume, or show it with a Screen Look. A scene Volume whose Reveal Lens overrides a setting takes that setting over from the component.
From a script
using PassForge.Effects;
using UnityEngine;
public class LensCursor : MonoBehaviour
{
[SerializeField] PassForgeRevealLens m_Lens;
[SerializeField] float m_Speed = 0.6f; // screens a second
Vector2 m_Stick;
public void UseMouse() => m_Lens.placement = RevealLensPlacement.MousePointer;
// Call it from your input code with the stick's value.
public void Move(Vector2 stick)
{
m_Stick = stick;
if (stick != Vector2.zero)
m_Lens.placement = RevealLensPlacement.ScreenPoint;
}
void Update()
{
if (m_Lens.placement != RevealLensPlacement.ScreenPoint || m_Stick == Vector2.zero)
return;
// From 0 to 1 across the screen. Real time, so it moves in a pause menu too.
var point = m_Lens.screenPoint + m_Stick * (m_Speed * Time.unscaledDeltaTime);
m_Lens.screenPoint = new Vector2(Mathf.Clamp01(point.x), Mathf.Clamp01(point.y));
}
}
Change clues and the look while the game runs:
using PassForge.Effects;
using UnityEngine;
public class DetectiveMode : MonoBehaviour
{
[SerializeField] PassForgeRevealLens m_Lens;
public void Found(GameObject clue) => m_Lens.AddClue(clue); // with its children
public void Solved(GameObject clue) => m_Lens.RemoveClue(clue);
public void Scope()
{
m_Lens.placement = RevealLensPlacement.ScreenCenter;
m_Lens.style = RevealLensStyle.Magnifier;
m_Lens.magnification = 4f; // from 1 to 8
m_Lens.radius = 0.4f; // share of the screen height
m_Lens.dimOutside = 1f; // dark outside, from 0 to 1
m_Lens.ringWidth = 3f; // pixels, 0 draws none
}
public void Toggle(bool on) => m_Lens.enabled = on; // the lens draws while enabled
// After adding renderers to a clue object, or after LODGroup.SetLODs.
public void AfterCluesChanged() => m_Lens.RefreshClues();
}
Public members: placement, screenPoint, radius, softness, clueSource, clues (read only list), showBehindWalls, style, clueColor, dimOutside, magnification, ringWidth, ringColor, AddClue, RemoveClue, RefreshClues and PassForgeRevealLens.current, the lens that draws.
Good to know
- One lens draws. Only the lens enabled last draws. The inspectors of the others say so, and so does Window > Pass Forge > Overview.
- No Volume needed. The Reveal Lens effect is on by default. A Volume's Add Override > Pass Forge > Interface > Reveal Lens has Intensity, Style, Clue Color, Dim Outside, Magnification, Ring Width and Ring Color. A setting overridden there takes over the lens's own; a Volume with a weight below one blends from it. Style switches as soon as the Volume shows. Intensity at zero hides the lens.
- Follow Object on a camera points at the middle of the screen. Put the lens on a flashlight, a scanner or the character to follow where that points. When the point is behind the camera, no lens shows.
- No Mask setting. The Reveal Lens has no Mask, but it uses Effect Masks to pick its clues when Look For is Effect Masks.
- Clue objects. Clues are drawn with their children: Mesh, Skinned Mesh and Sprite Renderers. Spine attachments are covered by their whole mesh, transparent parts included.
- Depth. Listed clues use the scene depth to tell what the camera sees from what is behind a wall.
- Where it draws. In the Interface effects, after post-processing.
- Edit Mode. The lens shows in the Game view in Edit Mode, and in the Scene view with Run In Scene View on in the Pass Forge Effects (After Post-Processing) renderer feature.
- Headsets. In XR the clues are drawn whole, since each eye sees the lens in another place.
- Several per object. Unity allows several Reveal Lenses on an object, but only the one enabled last draws.