Culling not updated even when the state is active for Render Pipeline FP camera

javasamurai

New member
I am trying to update the culling for the sniper camera to show nothing. In gameplay, the culling still remains the same even though the state is active. Check attachment for the issue.
 

Attachments

  • Project-Chalie - Shooting_Range - Android - Unity 2019.4.3f1 [PREVIEW PACKAGES IN USE] _DX11_ ...png
    Project-Chalie - Shooting_Range - Android - Unity 2019.4.3f1 [PREVIEW PACKAGES IN USE] _DX11_ ...png
    43.7 KB · Views: 9
  • Project-Chalie - Shooting_Range - Android - Unity 2019.4.3f1 [PREVIEW PACKAGES IN USE] _DX11_ ...png
    Project-Chalie - Shooting_Range - Android - Unity 2019.4.3f1 [PREVIEW PACKAGES IN USE] _DX11_ ...png
    20 KB · Views: 10
I do wonder if this is a bug - @Justin as far as I can tell the main Camera's culling mask only gets set according to the ViewType's "Culling Mask" within the ViewType's Initialize - I can't see that changing the culling mask during runtime would ever cause the Camera's culling mask to change accoprdingly?
 
It does look like the actual culling mask on the camera is not updated. You can fix this by changing

Code:
        public LayerMask CullingMask { get { return m_CullingMask; } set {
                if (m_CullingMask != value) {
                    m_CullingMask = value;
                    UpdateFirstPersonCamera(m_CharacterLocomotion.FirstPersonPerspective);
                }
            } }
to:
Code:
        public LayerMask CullingMask { get { return m_CullingMask; } set {
                if (m_CullingMask != value) {
                    m_CullingMask = value;
                    m_Camera.cullingMask &= m_CullingMask;
                }
            } }
 
Thanks. For the quick reply. @Jusin. Although. My query was regarding the state changes.
In normal flow, the perspective switching works well. Only during the state is active (Sniper), I want the overlay culling to be updated to None.
 
So are you saying the state isn't active? Make sure you add the Sniper state to the Item Set within the Item Set Manager.
 
In Editor the State is active. FOV and other state changes too. Check attachment #2. Just that the Culling remains the same (which is overlay).
My FP camera type is URP OverlayRenderer BTW.

Following this guide:
 
Top