Single Pass Instanced: VR Rendering Optimization and Configuration
Note: When a VR project on Unity transitions from Multi Pass to Single Pass Instanced, the first thing that breaks is custom shaders. The cause isn't bugs but expected behavior: shaders written for single-eye rendering don't account for stereo indices and matrices. Without proper adaptation, one eye sees artifacts while the other shows a blank screen. Our engineers with 10+ years of gamedev experience solve this comprehensively: audit, fix, and test on two devices. The result is stable 90+ FPS on Quest 3 without visual distortions.
Shader Failures on Enabling Single Pass Instanced
Enabling Single Pass Instanced in Project Settings → XR Plugin Management is a single checkbox. After that, shaders written without stereo instancing support stop working correctly. This isn't a configuration bug but expected behavior. In Single Pass Instanced, the shader receives a stereo index (unity_StereoEyeIndex) — 0 for the left eye, 1 for the right. Projection and view matrices are stored as arrays unity_StereoMatrixVP[2]. Shaders using only unity_MatrixVP render only one eye correctly — the second is either offset or shows the same frame.
Surface Shaders in Built-in RP are automatically compatible — Unity adds the necessary macros at compile time. Custom Vertex/Fragment shaders require manual use of macros UNITY_MATRIX_MVP, UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX, UNITY_TRANSFER_STEREO_EYE_INDEX. Missing any of these causes artifacts on one eye. In URP, most built-in shaders are already compatible, but custom render passes in ScriptableRendererFeature are often written without stereo support.
Diagnosing Problems with Single Pass Instanced
The first sign is artifacts strictly on one eye. In Frame Debugger, instead of a single draw call with [Instanced: 2], two separate calls appear. This means instancing hasn't been applied to the object. Causes: GPU Instancing disabled on the material, use of MaterialPropertyBlock with different data per instance, or exceeding the vertex limit for dynamic batching.
In URP with Forward Renderer, problems often arise with Post Processing. Effects like Depth of Field, Motion Blur, and Bloom don't support stereo directly — they are applied to a single render target and duplicated, causing visual shift. The solution is to use VR Mode in Post Processing Volume or write stereo-compatible shaders manually.
Pitfalls with Texture Atlases and UV
Single Pass Instanced uses Texture2DArray for render targets of both eyes. Shaders sampling _CameraDepthTexture or _CameraColorTexture must do so via SAMPLE_TEXTURE2D_ARRAY with layer index unity_StereoEyeIndex, not via SAMPLE_TEXTURE2D. Custom post-processing effects written for standard rendering often sample the depth as a 2D texture — in Single Pass Instanced, they get the depth of the left eye for both viewports. Visually: SSAO or outline works correctly for the left eye, but for the right eye it's offset or missing.
How to Check Shader Compatibility
Step-by-step procedure:
- Enable Single Pass Instanced in XR Plugin Management.
- Open Frame Debugger while the scene is running.
- Find the draw call for each object. If it's marked
[Instanced: 2] — the shader is compatible.
- If instead there are two separate draw calls — the problem is in the shader or material.
- Visually check for artifacts: put on the headset and view the scene with both eyes.
Common errors in custom shaders
- Missing
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX macro in the vertex shader.
- Using
TransformationMatrixM instead of UNITY_MATRIX_MVP.
- Sampling a texture without considering
unity_StereoEyeIndex when working with Texture2DArray.
- Applying post-processing effects incompatible with
VR Mode.
What Single Pass Instanced Delivers in Numbers
| Metric |
Multi Pass |
Single Pass Instanced |
Improvement |
| CPU load per frame |
100% (base) |
40-60% |
Up to 60% reduction |
| Draw calls per eye |
~2x separate |
1 instanced |
2x reduction |
| FPS in heavy scene (Quest 3) |
45 FPS |
72 FPS |
+60% |
| GPU load |
100% |
~70% |
30% reduction |
Performance in practice: based on our measurements on Quest 3 with CPU-heavy scenes, Single Pass Instanced yields FPS gains from 15% to 40%. Comparison with Multi Pass: CPU load is 2-3 times lower (confirmed by Unity documentation).
What Our Work Includes
We handle the full transition cycle: audit of all shaders and render passes, fixing (adding stereo macros, adapting custom effects), configuring XR Plugin Management, post-processing and batching, and testing on two devices (Multi Pass baseline vs Single Pass Instanced) with profiler recording. We provide a change report and guarantee compatibility.
| Project size |
Number of custom shaders |
Estimated timeline |
| Small |
up to 10 |
3–7 days |
| Medium |
10–30 |
1–3 weeks |
| Large (with post-processing and custom RP) |
30+ |
3–6 weeks |
Cost is calculated after a shader base audit and analysis of the current render pipeline. Contact us for a consultation — we will assess your project free of charge in one day.
Transition Process to Single Pass Instanced
Standard plan: enable SPI → compile list of shaders with errors → prioritize by visibility → fix them sequentially. Typically, 70–80% of shaders work without changes, 15–20% require adding stereo macros, and 5–10% need rewriting or replacement.
Testing is conducted in parallel on two headsets: one in Multi Pass (baseline), the other in Single Pass Instanced. We compare each scene visually and via profiler. We guarantee compatibility of all fixed shaders — if artifacts arise after deployment, we will rework them free of charge.
Contact us for a free audit of your project. Get a consultation right now — write to us, and we will propose an optimal transition plan considering your stack and deadlines.
VR and AR Development
When we first launch a project in a VR headset, most teams face the same thing: technically everything works, but in the headset either motion sickness occurs, or hands 'float' with a delay, or the scene looks jerky at the periphery. These are not bugs in the usual sense — they are a consequence of the fact that VR/AR development requires a different approach to render architecture, interaction, and UX from the very beginning of the project. Our experience: over 7 years in game dev, 15+ completed VR/AR projects for Meta Quest, SteamVR, PSVR2, HoloLens. We work with teams that need not just a prototype but a production‑ready application with a stable frame rate.
Platforms and SDKs
We work with all relevant stacks. We use OpenXR as the base layer wherever possible — it provides cross‑platform compatibility between Meta, Valve Index, HP Reverb and other PC VR devices. On top of OpenXR, we build on the XR Interaction Toolkit (Unity) or VR Expansion Plugin (Unreal). Contact us for a stack assessment tailored to your project.
| Platform |
SDK / Framework |
| Meta Quest 2/3/Pro |
Meta XR SDK, OpenXR |
| PC VR (SteamVR) |
SteamVR Plugin, OpenXR |
| PlayStation VR2 |
Sony PSVR2 SDK |
| HoloLens 2 |
Mixed Reality Toolkit (MRTK) |
| ARKit (iOS) |
AR Foundation + ARKit XR Plugin |
| ARCore (Android) |
AR Foundation + ARCore XR Plugin |
| WebXR |
Unity WebXR Export |
How to minimize motion sickness in VR locomotion?
Locomotion — the main source of motion sickness for inexperienced VR users. According to research, about 70% of users experience discomfort with improper movement settings Oculus Developer Guidelines. Teleportation — standard navigation method when smooth movement is undesirable.
Components from XR Interaction Toolkit: TeleportationArea, TeleportationAnchor, TeleportationProvider. Basic implementation works out of the box, but for production we refine it in four steps:
- Setting up
XRRayInteractor with a curved ray (Bend Ray) — the teleportation arc looks more natural than a straight ray and is perceived better by users.
- Adding a valid landing zone — a visual indicator changes color when hovering over an obstacle (red/green).
- Implementing fade transition — smooth screen fade (black fade) before teleportation reduces disorientation.
- Rotation snapping — after teleportation we offer snap rotation by 45° or 90° instead of smooth, reducing motion sickness risk.
For projects requiring smooth locomotion (action games, simulators), we use comfort settings: vignetting during movement, reducing FOV during acceleration. Settings are available to the user in the menu — different people have different sensitivity thresholds. The difference between kinematic and physics‑based movement: kinematic gives instant hand following but lets objects pass through walls; physics‑based via Joint provides realistic collisions but requires velocity damping and max joint force tuning. We choose based on the type of interaction.
How to make object grabbing in VR physically realistic?
This is the most underestimated part of VR development. Clients often perceive it as 'just hand animation', but in practice it is a complex system where physical correctness, responsiveness, and comfort conflict.
Grab (grabbing)
XR Interaction Toolkit provides three types of Interactable for grabbing:
-
XRGrabInteractable — standard grab, object follows controller via physics joint or direct position/rotation
-
XRSimpleInteractable — for objects without physical movement (buttons, levers)
- Custom Interactable by inheriting from
XRBaseInteractable
Attach Transform — a frequently ignored detail. Each Interactable must have a properly configured Attach Transform (the point where the hand 'attaches'). Without it, the pistol grip will be at the center of the mesh, not where it is held.
For weapons and tools with two‑handed grab — a separate TwoHandGrab system: leading hand determines position, the second — orientation. XR Interaction Toolkit supports this via XRTwoHandGrabInteractable or custom logic with two Attach Points.
Throw (throwing)
Velocity smoothing is critical for realistic throwing because the Rigidbody.velocity at the moment of controller release reflects instantaneous speed, often incorrect due to tracking discretization. The user makes a quick wrist movement — but the object flies half as fast.
Solution: velocity smoothing over the last N frames (typically 5–10 frames, ~80–160 ms at 60 Hz) before release. XR Interaction Toolkit does this via VelocityEstimator. Additionally, we apply a velocity scaling multiplier — a small speed increase (1.2–1.5×) makes throws subjectively more satisfying. Angular velocity (for objects that should spin in flight) is also averaged similarly.
AR: Plane Tracking and Environment Interaction
AR adds a different class of problems — working with real, unpredictable environment. AR Foundation — a cross‑platform layer on top of ARKit and ARCore. Most basic features (plane detection, raycasting, image tracking, face tracking) are available through a unified API.
Plane Detection
ARPlaneManager detects horizontal and vertical planes. Practical nuances:
- Initialization takes time — the user must look around the room while the system builds a map. An explicit onboarding with instruction 'slowly move the camera across surfaces' is needed.
- Planes are unstable — their boundaries and position are updated as data accumulates. Objects placed on a plane need to be attached via parent to ARPlane, not to world coordinates.
- Plane merging — two detected floor segments may merge into one, moving the anchor. For critical anchors, use
ARAnchor instead of direct attachment to the plane.
Image tracking (via ARTrackedImageManager) quality directly depends on the quality of reference images. Images with high detail frequency and contrasting edges (like a QR code but stylish) track more reliably than smooth logos. ARCore Geospatial API — for outdoor AR with real‑world coordinate binding (accuracy up to 10 cm in well‑mapped areas).
Optimization for VR: Frame Rate and Comfort
VR requires stable high frame rate. About 60% of development time in mobile VR goes to optimization, not functionality — retrofit costs twice as much as proper architecture from the first sprint.
| Device |
Target Hz |
Critical threshold |
| Meta Quest 2 |
72 / 90 Hz |
< 72 Hz — noticeable |
| Meta Quest 3 |
90 / 120 Hz |
< 90 Hz — noticeable |
| Valve Index |
90 / 120 / 144 Hz |
< 90 Hz — noticeable |
| PSVR2 |
90 / 120 Hz |
< 90 Hz — noticeable |
Single Pass Instanced Rendering
The main render optimization in VR. Without it, the scene is rendered twice (once per eye), doubling draw calls. Single Pass Instanced renders both eyes in one pass via instancing: geometry is processed once, the shader gets two view/projection matrices through GPU instancing. Enabled in Unity via XR Plug-in Management > Rendering Mode: Single Pass Instanced. Important: custom shaders must support SPI — standard URP/HDRP shaders support it, custom HLSL requires modifications (UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX and related macros). Applying this technique reduces draw calls by 40–50%, making it twice as efficient as naive double rendering.
Foveated Rendering
On Meta Quest, Fixed Foveated Rendering (FFR) is available — reducing resolution at the periphery where visual acuity is lower. Configured via OVRManager or Meta XR SDK:
OVRManager.fixedFoveatedRenderingLevel = OVRManager.FixedFoveatedRenderingLevel.High;
OVRManager.useDynamicFixedFoveatedRendering = true;
Dynamic FFR automatically increases the level when frame rate drops — more convenient than fixed in scenes with variable load.
IPD and Comfort Settings
IPD (Inter‑Pupillary Distance) — affects depth perception. At the programmable level on most devices, only reading IPD is available (OVRPlugin.GetSystemDisplayFrequency), physical adjustment is on the headset. For applications requiring precise positioning (medical simulators, training), we account for IPD in scene scale calculations.
Haptics
Haptic feedback — an underestimated tool. Even a simple vibration response when grabbing an object or hitting significantly increases the sense of presence. On average, integrating haptic patterns takes 30–80 hours per project.
XR Haptics via OpenXR:
var hapticImpulse = new UnityEngine.XR.HapticCapabilities();
InputDevice device = InputDevices.GetDeviceAtXRNode(XRNode.RightHand);
device.SendHapticImpulse(0, amplitude: 0.5f, duration: 0.1f);
For complex patterns (tactile 'texture' of a surface when touched, increasing vibration when drawing a bowstring) we use Meta Haptics Studio — allows designing haptic clips visually. This can reduce time spent on manual haptic tuning by about 30%.
What does VR/AR application development include?
When ordering a turnkey project, we provide the following deliverables:
- Architectural document with stack description, render logic, and interaction system
- Working prototype (MVP) for testing on target device
- Integration of necessary SDKs (Meta XR, OpenXR, AR Foundation, etc.)
- Optimization for target frequencies 72/90/120 Hz with draw call and FPS profiling
- Testing on physical hardware (Quest, SteamVR, HoloLens) with user involvement
- Full documentation for build, deployment, and support
- Training for the client's team (workshop on XR Toolkit)
- Warranty support for 1 month after delivery
What affects cost and timeline?
VR/AR projects are more expensive than regular games of similar scope. Iterations are slower — each fix must be tested in the headset, an emulator does not convey the real experience. Motion sickness forces reworking some conceptual decisions after the first playtest. Optimization takes a significant portion of time — for mobile VR (Quest) up to 60–70% of the cycle. For Quest projects, we start optimization from the first sprint. The cost of basic SDK integration (XR Interaction Toolkit) varies depending on the scope of custom Interactable. Typical budgets for a full Quest project range from $25,000 to $80,000 depending on complexity, number of custom interactions, and depth of optimization. Proper architectural planning from sprint one typically saves 40% on later rework compared to fixing performance bottlenecks retroactively.
Get a consultation on your project — we will assess the task, stack, and timelines. Order turnkey VR/AR application development with a guaranteed stable frame rate.