As title mentioned, I’m trying to figure out how to calculate the values in “unity_StereoScaleOffset” either inside or outside a shader, whatever’s easier.
My project is using Multi-Pass, so I don’t have access to any of the variables attached to Single-Pass rendering and hence why I need to calculate this by hand.
Another way to look at this is that I’m trying to recreate this function:
#if defined(UNITY_SINGLE_PASS_STEREO)
float2 TransformStereoScreenSpaceTex(float2 uv, float w)
{
float4 scaleOffset = unity_StereoScaleOffset[unity_StereoEyeIndex];
return uv.xy * scaleOffset.xy + scaleOffset.zw * w;
}
But once again, I’m not using Single-Pass, so I don’t have access to this. I already have my own way to get “unity_StereoEyeIndex”, so now I just need “unity_StereoScaleOffset”.
Any help is welcome, thanks.