Mirrors and Secondary Cameras - towneh/vrsl-urp GitHub Wiki
Mirrors and Secondary Cameras
Every camera that renders into a texture runs the whole light path again: the surface prepass, the tile cull, the lighting pass and the beams. Mirrors, portals and camera props all count, so a world with two mirrors facing the stage draws the rig three times. This control decides what those cameras get, and it is where a world with mirrors spends or saves.
The policy
secondaryCameraMode on the manager has four values. The package decides it per camera, per frame, from the camera alone, so mirrors that appear and disappear at runtime need nothing reset.
| Value | What a mirror gets | Cost against the main view |
|---|---|---|
Match |
Lit exactly like the main view, at the scene's level. | The same again per mirror. |
Reduced (default) |
Lit one level below the scene. A scene at High renders mirrors at Standard, and a scene at Standard renders them at Low, a level only mirrors get, with beams at half the samples and no contact shadows. |
Beams stay in the mirror at a lower price. At High this returns about a quarter of what mirrors cost; at Standard the saving is small unless the rig is dense. |
SurfaceOnly |
Surface lighting only, with no beams in the mirror. | Removes the larger of the two passes. |
Skip |
No VRSL lighting at all. | Nothing, though a mirror pointed at the rig shows the absence. |
The Low level does not appear in the quality dropdown, because only this policy reaches it. Validate Renderer Setup names the level each camera in the open scene would render at, so there is no need to work it out by hand.
What is always skipped
Whatever the policy says, VRSL never renders into reflection probes, editor previews, or a camera that feeds VRSL's own DMX decode. The last case matters for correctness rather than cost: the lighting pass adds light onto whatever the camera draws, and on a camera whose target is the DMX grid that would brighten the channel values and arrive as nonsense DMX.
A texture camera that is the player's view
A stream camera or a spectator view renders into a texture but is not a mirror. Registering it with VRSLCameraFilter.RegisterMainView(camera) lights it in full at the scene's level whatever the policy says, and unregistering it when it goes away puts the policy back in charge.
Choosing
Reduced, the default, is a reasonable place to start. If mirrors are still the largest cost in Analyse This Scene, try SurfaceOnly: the room still looks lit in the mirror, and the beams are the part people tend to notice least there. Match suits a mirror that is part of the look, and Skip suits one that never sees the rig.