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

Question Cinemachine Post Processing override question

Discussion in 'Cinemachine' started by marchall_box, Jun 19, 2021.

  1. marchall_box

    marchall_box

    Joined:
    Mar 28, 2013
    Posts:
    139
    Hello,

    I am using the Cinemachine Post Processing extension to give a specific Focus Distance of DOF for a specific camera.
    However, as I change the Focus Distance of it, it does not "override" for this virtual camera only but changes the Profile asset globally.

    Is there a way to just affect specific Focus Distance for this virtual camera instead of affecting the actual Profile asset? (kinda like Prefab Variant)

    I don't want to create a new Profile asset to just change Focus Distance!
    sss.jpg
    Also, I tried different Focus Tracking options but there is no such thing as changing only Focus Distance.


    Thank you,
     
    Last edited: Jun 19, 2021
  2. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    The team are on their annual hackweek this week, so fair warning that I'm just helping out until they return. I might not be giving perfect answers, but I think I can assist here. :)


    I've created a short video to demonstrate how you can control Depth of Field with Post Processing Volumes and Cinemachine.


    The quick, text version:
    • For up-to-date versions of Cinemachine/Unity, use the "Cinemachine Volume Settings" extension, rather than the "Cinemachine Post Processing" extension. The latter of these was for earlier versions.
    • Create a new Volume Profile
    • Ensure that the Volume Profile is set to override Depth of Field
    • Add a Cinemachine Volume Settings extension to your VCam
    • Attach your newly created volume profile to the volume settings extension
    • You can now select "Custom Target" to control the Depth of Field. Moving the target around will affect the focus plane. There are other variations you can try.
    My setup:
    • Unity 2021.1.12f1
    • HDRP 11.0.0
    • Cinemachine 2.7.4
    Hope that helps!
     
    Gregoryl likes this.
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,227
    What @marc_tanenbaum said.

    One note: Use CinemachineVolumeSettings if your project is HDRP or URP (PostProcessing is built-in), otherwise install the PostProcessing package and use CinemachinePostProcessing.
     
  4. armaan8014

    armaan8014

    Joined:
    Jun 13, 2017
    Posts:
    23
    Ok so how do you override the DoF in case of built-in? Does the PP package do the job?
     
    Last edited: Sep 6, 2021
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,227
    Add a CinemachineVolumeSettings extension to your vcam, create a profile for it, and give it a DoF effect (in the PostProcessing category).