Updates and Quality
When vision is computed
All enabled Vision Sources are updated once per frame, right after LateUpdate. At that point characters have moved and the camera has followed, so vision matches the frame that is about to be drawn. You can move objects in Update, LateUpdate or with physics, and vision catches up in the same frame.
After a source has a new result it raises its Updated event. Vision Cone Renderer, Fog Of War, Fog Hider and Vision Perception all use that result.
The work runs on worker threads with Burst and the Job System. Obstacles are read from physics on the main thread, while the visible areas of the sources that are already gathered are computed in parallel.
Skipping unchanged areas
If a source and the obstacles around it have not moved since its last update, the previous result is reused. A guard standing still in a static room costs almost nothing. In Play mode, the Vision Source Inspector shows Last update: nothing moved, reused in that case.
Update rate per source
Update Every (s) in the Performance section of Vision Source sets the time between updates. 0, the default, updates every frame. Use a higher value for distant or unimportant observers, such as a security camera at the other end of the level or background units. A source always updates right away after its settings change.
To get a fresh result immediately, for example right after teleporting a character, call ForceUpdate() on the source.
Edit mode
Vision Sources also update in edit mode, at a limited rate, so you can see the cones while you build the level. The fog is hidden in edit mode unless Preview In Edit Mode is on.
Quality presets
VisionQuality.Level scales all sources and fogs at once, for example from your game's graphics settings:
using Renvix.VisionFog;
VisionQuality.Level = VisionQualityLevel.Low;
| Level | Outline of the far edge | Updates per source | Fog texture resolution |
|---|---|---|---|
| High (default) | As set on each source | As set on each source | As set on each fog |
| Medium | 1.5 × coarser | At most 20 per second | 3/4 |
| Low | 2 × coarser | At most 10 per second | 1/2 |
Changing the level applies right away. Only the far, rounded edge of the view gets coarser; the outlines of walls stay exact at every level. The VisionQuality.Changed event is raised when the level changes.
For profiling and more tuning options, see Performance.