Vive: Stereo Rendering Single Pass Instanced Only Working in One Eye

I’ve recently updated to Unity 2017.2 and have been interested in using the Single Pass Instanced Rendering. It mostly works, and has resulted in an increase in performance.

The problem is that the Valve shaders included in the SteamVR Plugin 1.2.2 only seem to show in one eye. For example when using the teleport, the laser and grid only appear in the left eye.

I’m assuming I’ll need to change something in the Shader, but I’m not sure exactly what, has anyone come across the solution to this?

Many Thanks,

it doesnt work for me at all

you need to add some macros as in this example https://docs.unity3d.com/Manual/SinglePassStereoRenderingHoloLens.html

struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
UNITY_INSTANCE_ID
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
UNITY_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert (appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}

fixed4 frag (v2f i) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
return …;
}

1 Like

Same happens to me and i am using the Unity standard shader which should include the VR support