Renvix Assets

Optimization Tips

Ordered roughly by how much they help.

Sources

Update less often. The biggest saving in most games. Update Every (s) of 0.1 to 0.2 for guards that are far away, background units and RTS units cuts their cost to a tenth or less at 60 FPS. Keep 0, every frame, for the player and for guards close to the player.

// Guards far from the player update 5 times per second.
float distance = Vector3.Distance(transform.position, player.position);
source.UpdateInterval = distance > 25f ? 0.2f : 0f;

Use revealers where walls do not matter. A source with Blocked By set to Nothing makes no physics queries. For RTS units, wards and "sense nearby" effects this is often all you need.

Keep ranges reasonable. The range decides how many colliders each source reads. A guard that sees across the whole level touches every wall in it.

Disable sources that do not matter. Guards in rooms far away can switch their Vision Source off and on again when the player comes closer.

Obstacles

Only the layers that block. Remove everything that should not block from Blocked By: characters, pickups, triggers, floor, decoration. Fewer colliders to check, fewer edges to solve.

Simple colliders. Boxes and simple polygons are cheaper than detailed mesh colliders. If a model has a detailed collider for physics, a simpler one on a separate layer can be used for vision.

Tilemaps with a Composite Collider 2D. Set the Composite Collider 2D to Outlines. One outline per wall instead of four edges per tile.

Static levels are cheap. Colliders that do not move are read once and reused. Moving colliders are read again every frame they move.

Edge Step

Edge Step (°) sets how round the far edge of the view is. 4° is smooth; 6 to 8° is hard to tell apart in most games and produces fewer points. It does not affect how exactly walls are outlined.

Fog

Resolution and area. The fog texture has Size × Resolution pixels per side. Fit the area to the level and lower Resolution for large maps; Edge Softness hides the pixels.

One fog per visible team. Disable fogs that are not shown.

Quality presets

VisionQuality.Level scales all of the above at once: Medium and Low make the far edge coarser, limit updates to 20 or 10 per second per source, and lower the fog resolution. Hook it to your game's graphics settings. See Updates and Quality.

Mobile checklist

  • VisionQuality.Level set to Medium or Low on weaker devices
  • Update Every of 0.1 to 0.2 on everything except the player
  • Revealers instead of line of sight wherever walls do not matter
  • Blocked By limited to wall layers
  • Composite Collider 2D in Outlines mode on tilemaps
  • Fog Resolution 2 or lower, area fitted to the level
  • Measured in a build on the target device, with the benchmark and the Profiler