Search Unity

Is this possible with cinemachine?

Discussion in 'Cinemachine' started by Kev00, Jan 31, 2018.

  1. Kev00

    Kev00

    Joined:
    Dec 6, 2016
    Posts:
    229
    Lets say I have 10 game objects of various sizes that each have a virtual camera attached to them (with LookAt set respectively) .

    1. Is there a way to ensure that the object fills the entire view of the camera automatically?
    2. Is it possible to render each virtual camera simultaneously to its own render texture?
    3. What is the best way to make #2 scaleable (50 objects, 100 objects, etc) ?

    In other words, does Cinemachine have any advantage over the standard camera/render texture setup?

    The reason I'm asking is that I'm trying to make a unique character inventory system that uses actual 3d objects and not icons.

    Thanks.
     
    Last edited: Jan 31, 2018
    koyodi likes this.
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,719
    1. Yes, if you tell the vcam how big the object is. You'd have to put the object in a CinemachineGroup as the only member, and set its Radius field. Then, use a GroupComposer (or FramingTransposer) to look at the group and frame it the way you want. If you can programmatically get the bounding box of your target objects, then you could write a little script to set the radius in the group accordingly.
    2. Yes, by having multiple Unity Cameras, each rendering to a texture. Each of those cameras would need its own Brain, and its own layer.
    3. That one's not so easy. Cinemachine is built on top of the existing cameras. At its core it's just a bunch of scripts to move those cameras around, and has at the moment no specific involvement with the render pipeline. It just leverages what's there. And you'll run out of layers.
    Bottom line: since the cameras aren't doing any fancy footwork (just sitting there framing a static object), Cinemachine doesn't really buy you anything in this situation.
     
    henners999 and koyodi like this.
  3. Kev00

    Kev00

    Joined:
    Dec 6, 2016
    Posts:
    229
    Thank you so much, you are always very helpful. :)
     
    koyodi likes this.