• Hi Guest!

    We are extremely excited to announce the release of our first Beta for VaM2, the next generation of Virt-A-Mate which is currently in development.
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.

Single Pass (instanced) VR Rendering

turtlebackgoofy

Well-known member
Joined
Dec 30, 2023
Messages
263
Reactions
676
Just checked the VAM2 alpha2 and it didn't have Single Pass VR Rendering enabled. I guess because it breaks all non-unity shaders and you get a grey screen on one eye and a black screen on the right eye for every shader used. What it does:

In VR every frame needs to be rendered twice from two angles. If you use Multi Pass (currently enabled in VAM2a2), left and right eye are rendered after another. If you use Single Pass (currently enabled in vam1) both eyes are rendered at the same time. If you use Single Pass Instanced, both eyes are rendered at the same time and all entities are rendered with a single draw call instead of two, hence the name "instanced". In a scene in VR with many entities this halves the amount of draw calls, speeding up the CPU part and improving GPU performance a bit while rendering, the GPU gets less bottlenecked by the CPU in the frame rendering.

How to enable it: https://docs.unity3d.com/2022.3/Documentation/Manual/SinglePassStereoRendering.html
However this breaks all non-unity-bundled shaders and you need to add 5 lines to every shader file: https://docs.unity3d.com/2022.3/Documentation/Manual/SinglePassInstancing.html

Depending on the CPU, FPS goes up from 70 to 90 in VR.
@meshedvr I hope you have that on the radar for vam2, the work needed is minimal, you just need to add 5 lines into every shader (not compute shaders) you made yourself or got from the unity store. In return you get a noticeable FPS boost in VR.
 
There were some bugs with that version of Unity with single-pass (I think in post process and perhaps other places). In the upcoming VaM2 beta, single pass instanced is enabled for both Oculus and OpenXR modes.
 
Are there any downsides to using single pass? Will screen space effects still work correctly f.e.?
 
Back
Top Bottom