Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Camera won't update if layer Default is not in the culling mask

Discussion in 'Cinemachine' started by xorblax, Feb 28, 2023.

  1. xorblax

    xorblax

    Joined:
    Jul 15, 2018
    Posts:
    25
    For some reason when I turn off layer Default in the culling mask of my camera, the camera will no longer be updated by the virtual cameras. This is a problem, as I am trying to use a second camera to capture a single object with its own special layer to put into a render texture, and I don't want to capture any of the myriad of things labeled Default.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    The vcams themselves need to be on a layer that's present in the culling mask. Probably your vcams are on the Default layer. Put them on a different layer.
     
    xorblax likes this.
  3. xorblax

    xorblax

    Joined:
    Jul 15, 2018
    Posts:
    25
    Worked just like you said, thanks!
     
    Gregoryl likes this.
  4. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    926
    This just happened in my case. Why is that even a design decision? Cameras aren't visible objects themselves so they aren't even eligible to be culled by a camera's mask to begin with. And disabling their behaviour based on that only has invisible (as it's not logically deducible) sideffects. I only found out that it does that by crawling through the source code. The Cinemachine brain should have a separate mask for that.
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,233
    In CM2, the culling mask is used to implement situations (e.g. split-screen) where you want multiple brains and vcams need to output to specific brains. There is logic to this (the brain "sees" vcams and is influenced by them), but you are right, it would be clearer to have a separate mask mechanism.

    In CM3, there is a separate mask, and the camera culling mask is not implicated.
     
    Flavelius likes this.