I’m trying to render blurry background on a plane. I got the result on a Quest 2 device and a Unity Editor but there is difference on a Quest Pro device.
As you can see, the result is bit wrong.
Below is desired result.
Additionally, above image shows you a plane that has orange line is a position where a captured texture is projected. And the bottom of the image shows you the desired result that I want.
Flow:
I tried following flow.
- Captured the scene with each camera, VR left camera and right.
- Blurred them.
- Projected the textures to the plane that I mentioned before (orange rectangle plane)
Below is the shader code to show a projected plane.
v2f vert(appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex);
float scale = 1.0;
o.uvgrab.xy = (float2(o.vertex.x, o.vertex.y * scale) + o.vertex.w) * 0.5;
o.uvgrab.zw = o.vertex.zw;
return o;
}
fixed4 frag(v2f i) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
if (unity_StereoEyeIndex == 0)
{
return tex2Dproj(_LeftTex, UNITY_PROJ_COORD(i.uvgrab)) * _Color;
}
else
{
return tex2Dproj(_RightTex, UNITY_PROJ_COORD(i.uvgrab));
}
}
Does anyone know what happened?

