Search Unity

Cinemachine with multiple brains

Discussion in 'Cinemachine' started by syscrusher, Nov 10, 2017.

  1. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    First, let me say Cinemachine is *amazing*. I had a couple hours to kill tonight, and got into CM for the first time. Already I was able to create a gorgeous game startup sequence with a long framing shot, blending to a stationary intermediate point, and then zooming in to become a follow cam for an AI character that is already in motion the whole time -- and randomly so! I can't believe how easy that was to accomplish, or how cool the result looks for a brand-new user.

    One thing I did encounter that is a puzzle, though, and I'm assuming there's a way around it: How do I manage a situation where CM is not controlling "the" camera but rather controlling several cameras at once, each of which has its own set of virtual shot cameras?

    The use-case is that I'm making an asset demo, and what I want is the player-controlled main camera to be independent of CM altogether. I want two different CM brains, each with its own (real, not virtual) camera that renders with a higher depth number over a portion of the screen -- like a pair of mini-maps, except that they're CM-controlled follow cams showing things from different perspectives simultaneously.

    I tried attaching a brain to each of the small-viewport cameras, but I don't see any way to tell those brains which VCs to use and which VCs to ignore. Also, when I have more than one brain in my scene, things get rather strange in the editor, in a way that I would have difficulty describing with precision.

    Thanks so much to the UT team for giving us Cinemachine and Timeline this year -- two of the best new features imaginable!
     
  2. zyzyx

    zyzyx

    Joined:
    Jul 9, 2012
    Posts:
    227
    From the docu pdf page 60:

     
    syscrusher and Gregoryl like this.
  3. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Thanks! It seems I have an outdated version of the document PDF, because mine has way less than 60 pages. I'll update my local copy.

    The only thing I wonder is will that layer and cull setting also prevent the cameras from rendering common objects? I want all the cameras to have the same set of viewable objects, just different control mechanisms.

    (That's a rhetorical question -- I'll experiment this weekend and see how different things behave.)

    Thanks again for the tip. I'll bet my doc PDF is from the beta, when I downloaded but got busy and didn't actually get time to use CM.
     
  4. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    I think that occlusion culling does everything automatically.
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    Sounds like you have an old CM. We're about to release 2.1. You can get the latest RC here: https://forum.unity.com/threads/cm-v2-1-release-candidate.497202/
    I strongly recommend upgrading, there is lots of new stuff.

    For the layers, you can create new layers for just your vcams. The cameras will filter what they can see according to the layers, but since you're just adding vcam layers, it won't affect the rest of your content (unless you want it to).
     
  6. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Will do, thanks.

    Could you elaborate on that, please? Are you saying the culling masks for the real cameras do not in this case affect what objects they render?
     
  7. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    @syscrusher The culling masks for the cameras behave as normal: they filter what the camera can see using a bitmask for the layers. What I meant was, if you create special layers for the vcams then you can set the camera masks to include those layers (or not) without impacting anything else that the camera can see.
     
  8. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    1,104
    Ah, I understand. Thanks for the clarification. :)

    I have four days off for the US Thanksgiving holiday, and I think my project for that weekend is going to be a realtime video render from Unity. I need to get deeper into Cinemachine, Timeline, and a couple of assets I've purchased from the Asset Store, so I will do a "sandbox" project that forces me to use all of the above.
     
    Adam_Myhill likes this.