Performance and Quality - towneh/vrsl-urp GitHub Wiki

Performance and Quality

What the package costs, the one control that sets it, and how to measure your own scene rather than guess.

The quality level

quality on the manager is the cost control. Its three levels have fixed costs, set in code, so a level costs the same in every scene and there is no hidden knob to find later.

Level What you get What it costs
Off Surfaces still lit. No beams, no contact shadows, and nothing allocated for either. The surface pass alone.
Standard Beams and contact shadows at the budget the package shipped with. The default. Suits most worlds.
High The same look with a finer march through the beams and a longer contact-shadow trace. More per pixel. Wide cones, long throws and dense haze are where it shows.

Everything else under Volumetrics on the manager, such as density, anisotropy, tint, intensity and scene-fog coupling, changes the look at a fixed price, so you can set those however the scene wants them. At Off the inspector greys them out and says why, rather than hiding them.

Contact shadow strength is separate, and off by default. Each fixture traces the depth buffer towards itself from every lit pixel, so the cost scales with fixtures per screen tile and it is the most expensive part of the surface pass. The shadows come only from geometry the camera can see, within a short distance: an avatar standing in a beam shadows the floor at its feet, whereas a wall across the room does not.

What costs what

  • Surfaces cost by lit pixels, times the fixtures that reach each screen tile. Fifty fixtures pointed at one floor cost more than fifty spread around a venue, because every tile then carries all fifty.
  • Beams cost by the pixels inside cones, times the fixtures crossing each, times the samples along each crossing. The march samples only where a cone crosses the view ray, so a beam seen from the side costs little and a camera standing inside a cone costs the most.
  • Each extra camera runs the whole light path again, and mirrors are the usual source of extra cameras. See Mirrors and Secondary Cameras.
  • The surface prepass is one extra opaque draw per camera, or none where URP already draws its own normals. In a scene full of avatars this is the part that grows with occupancy rather than with rig size. The Lit surfaces layer mask can leave expensive layers out of it, and they still light, as plain mid-grey.
  • The decode is one compute dispatch per frame, which is small enough not to be worth thinking about.

A screen tile lights with up to 256 fixtures. Past that, the extra ones contribute nothing and the scene is not lit as it was built, and Analyse This Scene says when a rig is that dense from the current camera angle.

Letting visitors turn it down

The VRSL-LocalUIControlPanel prefab is an in-world panel a visitor can adjust the lighting from. It is optional: the manager runs the scene on its own, and the panel is an overlay for the local user that never reaches other clients. Drop it in wherever people can walk up to it. On start it shows the quality the scene is set to and every slider sits at full, so adding it changes nothing until someone touches it.

What each control does to what that visitor sees:

Control What changes
Master/Final Intensity Everything below at once. At zero the rig is dark and the room is lit by whatever else is in it.
Fixture Intensity How brightly the fixture bodies and lens flares glow. The light they cast is unaffected, so at zero the room is still lit by fixtures that look switched off.
Volumetric Intensity How strong the beams in the air are. At zero the beams are gone and the light landing on surfaces is untouched. Halfway is half of what the scene was set to, whatever that was.
Light Intensity How much light the fixtures cast on surfaces, avatars and props. The beams dim with it, since they are the same light seen in the haze. Halfway is half of what the scene was set to.
Disco Ball Intensity How bright the discoball's spots are.
Laser Intensity How bright the lasers are.
Bloom Intensity The bloom on the scene's example post-processing, where the scene has it. The slider hides itself otherwise.
Volumetrics: High / Standard / Off The manager's quality level, for both the DMX and AudioLink managers where a scene has both. High marches the beams more finely, Standard is what most scenes ship at, Off removes the beams and the contact shadows and keeps the surfaces lit. This is the control for a visitor whose frame rate is suffering.
Lens Flares: High / Low High blends the flares on blinders and flashers. Low dithers them, which is cheaper under MSAA and looks grainier up close.
Toggle DMX Strobe Holds every strobing fixture fully on, for a visitor who would rather not have strobes. Reaches the cast light, the beams and the fixture bodies. Only shown when the scene has a DMX manager.

Each quality row on the panel has a lock on the prefab, so a world can pin one choice and leave the rest to the visitor.

Measuring your scene

VRSL → URP → Performance → Analyse This Scene needs no setup. It enters play mode and measures the scene at each quality level. It reports what the package costs in milliseconds, and what a lower level would give back. The form is "volumetrics are costing 4.2 ms of an 11.0 ms frame, and quality Off returns that". It also says whether the scene fits a refresh-rate budget at each level.

The tool measures cost by difference, capturing the same frames with the managers enabled and with them disabled, so the figure is what you get back by removing the package rather than a sum of pass timings.

Every result carries its spread. A difference smaller than the spread is a reading of the machine rather than of the package, and the report says so.

For anyone changing the package, Run Standard Sweep and Build Sweep Player measure a fixed matrix in a built player, where there is a real GPU clock, since the editor's batch mode reports none. Runs are compared with a stored baseline and refused across different hardware, and TESTING.md covers that side.

Diagnostics that read cost

VRSL Diagnostics on the manager reports the health checks and four cost figures:

  • how many fixtures reach the busiest screen tile
  • the average steps the beams took per fixture
  • the fixtures marched per pixel
  • the share of fixtures skipped as too faint to see

A rig that reads dense there is probably one to spread out or point elsewhere, and a step count sitting at the level's ceiling is one where High is likely to show.