Search Unity

Custom projection matrix on virtual camera?

Discussion in 'Cinemachine' started by steego, Mar 14, 2019.

  1. steego

    steego

    Joined:
    Jul 15, 2010
    Posts:
    969
    Is it possible to set a custom projection matrix for just one virtual camera, and have it blend with the default projection matrix for another camera? Or is there a way I can do something like this myself while still using cinemachine?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    What's custom about your custom matrix?
     
  3. steego

    steego

    Joined:
    Jul 15, 2010
    Posts:
    969
    I have two cameras in the scene, one top down and one third person, that the player can switch between. For the top-down camera, I want to do an oblique projection and possibly some lens tilt.

    So what I'd love to do, was be able to just set up the projection matrix on the top-down camera, and let cinemachine handle the blend between top-down and third person.

    In an ideal world, cinemachine would support this out of the box in the lens settings of each camera, by exposing tilt and shift parameters (like for a real-world tilt-shift lens).
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    If you set your main camera to Physical Camera, then the vcams will show some physical settings in their lens definitions. Anything shown there is blendable between vcams, and CM will take care of that.

    upload_2019-3-15_9-16-12.png

    So, lens shift, focal length, and dutch will blend. Also, any effects applied via PostProcessing V2 will blend between vcams, so if you can implement your effects that way, you should be ok.
     
  5. steego

    steego

    Joined:
    Jul 15, 2010
    Posts:
    969
    Ah okay, then at least I get lens shift which might be enough. I see I can also get the active blend from the cinemachine brain, which I might be able to use if I need to do my own blends of the camera matrix.