Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Supersample Rendering using Cinemachine

Discussion in 'Cinemachine' started by DavidAvenue, Oct 2, 2018.

  1. DavidAvenue

    DavidAvenue

    Joined:
    Dec 27, 2016
    Posts:
    4
    Hey,

    We have were having this issue and went on to use this supersampling script and it worked fine with the Unity's default camera, but haven't been able to make it work when using cinemachine, would you please tell me if there's some way in cinemachine to achieve this? or what I might need to change to make it work.

    Thanks.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,637
    You can make that script work with the Cinemachine camera.
    Just follow the instructions. Make a new Camera that will be your final camera. Deactivate the Camera component on your old main camera, the one with the brain (leave the brain active). Attach the script to the new camera, as directed, and link the brain's deactivated camera to the script. No reason why it shouldn't work.
     
  3. DavidAvenue

    DavidAvenue

    Joined:
    Dec 27, 2016
    Posts:
    4
    Hey, thanks for your input but still couldn't get it to work. I guess should start by saying I have the MainCamera (with Camera component, Cinemachine Brain, and tagged as MainCamera), and a CM vcam (with Cinemachine Virtual Camera component) -- all which is just a 2D Camera.

    I tried but was getting these:
    - Can't add component 'Camera' to MainCamera because such a component is already added to the game object!
    - NullReferenceException: Object reference not set to an instance of an object SupersamplingCamera.Start().
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    1,637
    It's not clear what you tried. Given your description of your setup, I see no reason why the supersampling script you posted wouldn't work if you followed the instructions correctly.

    Maybe you could be a little more specific about what exactly you tried to do?
     
  5. DavidAvenue

    DavidAvenue

    Joined:
    Dec 27, 2016
    Posts:
    4
    Hi, these are the steps I did:
    1. I created a scene and added a Cinemachine 2D Camera.
    2. Added the SupersamplingCamera script Main Camera.

    This results in:
    Can't add component 'Camera' to Main Camera because such a component is already added to the game object!