09-24-2024 07:25 AM - edited 09-24-2024 07:27 AM
Hi, I'm working on a simple mixed reality experiment, targeting the quest 3, using Unity and MetaXR.
In my program, I created a portal that let's the player go between a virtual world and the real passthrough world.
For some reason, even though everything works fine in the editor, when trying out a build locally on the quest 3 the cameras for both eyes "zoom in", as in, it looks like the FOV continuously decreases for a few seconds until it stops in a very disorienting FOV.
Here's some more information:
- Using Unity 2022.3.22f1 with URP. Testing on a Quest 3.
- I have tried both Multiview and Multi pass;
- I'm using a custom stencil shader for the portal effect;
- I have added several render object features to the Universal Renderer Data in order to manage how different layers are affected by the stencil shader:
- Here is the code for the stencil shader:
Shader "Custom/Stencil"
{
Properties
{
[IntRange] _StencilID ("Stencil ID", Range(0, 255)) = 0
}
SubShader
{
Tags {
"RenderType"="Opaque"
"Queue"="Geometry"
"RenderPipeline"="UniversalPipeline"
}
Pass
{
Blend Zero One
ZWrite Off
Stencil
{
Ref[_StencilID]
Comp Always
Pass Replace
}
}
}
}