cancel
Showing results for 
Search instead for 
Did you mean: 

Camera zooms in when starting my crossed reality game (works fine in the editor)

Anzu43
Honored Guest

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.

Video showing the bug

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:

Captura de ecrã 2024-09-24, às 15.08.35.png

 

 

 

 

 

 

 

 

 

 

 

 

Anzu43_0-1727187764093.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

- 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
            }
        }
    }
}

 

 

 

0 REPLIES 0