The Fresnel effect, which makes the outline of shields and holograms shine beautifully in VR content, fundamentally solves the problem of stereoscopic vision collapse in the SPI (Single Pass Instanced) environment through node design.
Main cause
The standard Shader Graph `Fresnel Effect` node performs a simple calculation of the camera line of sight internally, but this occurs because it does not update the correct matrix for the VR (SPI) "1draw call to the camera matrix corresponding to the two left and right eyes." The Fresnel mask based on the camera coordinates of the left eye is also used for the right eye, causing a positional shift.
Specific solutions
Build a "manual Fresnel calculation graph" that eliminates standard nodes and operates correctly even in the SPI environment.
[Normal Vector (World)] ──┐
▼
[Dot Product] ──➔ [Subtract (from 1)] ──➔ [Power (Power値)] ──➔ (出力)
▲
[View Direction (World)] ─┘[Node construction procedure]
- Create a **`Normal Vector` node** (Space: `World`).
- Create a **`View Direction` node** (Space: `World`). ➔ **Be sure to set Space to World for SPI compatibility**
- Connect the two outputs above to the Dot Product node.
- Connect the output of the dot product to the **`One Minus` node** (inversion process to make the outline shine).
- Connect its output to the **`Power` node** and enter the intensity (e.g. 3) on the other pin to "narrow down" the emission.
*In this construction pattern, Unity's code generator automatically corrects the view matrix conversion based on `unity_StereoEyeIndex` in the SPI assembly 100% correctly, so perfect outline lighting without any deviation is achieved even in a VR environment.