Skip to content

VR Shared Eye Shading

In VR each eye renders the scene from its own position, so everything that depends on the viewing angle is calculated once per eye: specular highlights, reflections, Fresnel, Rim and Highlights. That’s how real reflections behave, and on rounded surfaces the two images merge into one glossy highlight.

Some stylized looks don’t merge well. Large flat faces close to the camera, combined with a hard edged effect like Toon specular, Rim or Highlights, can show a face lit in one eye and unlit in the other. The two images then don’t combine, which is uncomfortable to look at.

VR Shared Eye Shading makes both eyes calculate these effects from one point between them, so both eyes see exactly the same shading.

  1. Select the camera that renders the headset view. In an XR Origin, that’s the Main Camera with the Tracked Pose Driver.
  2. Click Add Component and choose AllIn13DShader > VR Shared Eye Shading.
  3. Make sure Share Shading Between Eyes is ticked.
The VR Shared Eye Shading component with Share Shading Between Eyes ticked

That’s all. Your materials don’t need any change. It works in Multi-pass and Single Pass Instanced, in URP and in the Built-in pipeline.

Untick Share Shading Between Eyes, or disable the component, to go back to the regular shading for each eye. You can do it at runtime, which is handy to compare both in the headset.

If more than one camera renders the headset view (a URP camera stack, for example), add the component to each of them.

  • Affected: Specular (Classic, Toon, Anisotropic and Anisotropic Toon, with Basic or PBR shading), Reflections and the PBR Fresnel, Rim, Highlights and Fake Subsurface Scattering.
  • Not affected: Matcap, Outlines and the effects based on the distance to the camera.
  • Other cameras: the Scene view, reflection probes and any camera without the component keep the regular shading.
  • The look: highlights sit on the surface, as if painted on. When each eye calculates its own highlight, it has a slight sense of depth like a real reflection, and shared shading gives that up. Try both in the headset and keep whichever is more comfortable for your look.
  • Performance: no extra shader variants. Projects that don’t add the component render exactly as before.