Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

how to change forcus distance with postprocess volume dof?

Discussion in 'Cinemachine' started by kkrg001, Jun 26, 2020.

  1. kkrg001

    kkrg001

    Joined:
    Mar 6, 2019
    Posts:
    35
    I think this is controlled by one very simple parameter, which I couldn't find.
    The cinemachine post processing of the add extension is not working,
    and I don't know how to enter the numerical value or set the focus target.
    I know it's a silly question, but please help someone.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    What do you mean it's not working?
    Do you have the PostProcessing package installed?
     
  3. kkrg001

    kkrg001

    Joined:
    Mar 6, 2019
    Posts:
    35
    My project uses postprocess volume instead of Post Processing Stack.
    (I don't know what is the difference between the two)
    so, my PP profile Is not seem to be a candidate for Focus Tracks from the cinemachine component.
    thank you.
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Instead of CinemachinePostProcessing extension, use CinemachineVolumeSettings extension. That will accept your profile.
     
    Montelligence likes this.
  5. kkrg001

    kkrg001

    Joined:
    Mar 6, 2019
    Posts:
    35
    fine...
    Is it default option? how can I use that?
     

    Attached Files:

  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    I am a little confused. You say you are using Volumes, not PostProcessing stack - yet you have PostProcessing stack installed.

    When you have PostProcessingStack, the CinemachinePostProcessing extension becomes available.
    When you have HDRP or URP installed, the CinemachineVolumeSettings extension becomes availabe.

    So what is your render pipeline? (standard 3D, HDRP, or URP)
    What is your Unity version?
    What is your Cinemachine version?
    What version of PostProcessing do you have installed?
     
  7. kkrg001

    kkrg001

    Joined:
    Mar 6, 2019
    Posts:
    35
    Sorry for the late reply (it was covit19 issue)

    I'm confused by the incomprehensible naming.
    Anyway, what I mean is that I use a component called "Volume"
    ... so, just "Volume"(what is this name?)

    The version I am using is as follows.
    I hope this is a hint.

    Render Pipeline: URP
    unity version: 2019.4.0f1
    cinemachine Version: 2.3.4
    postprocessing :2.3.0
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Volumes: https://docs.unity3d.com/Packages/c...t=Volumes-,Volumes,to calculate a final value.

    You should remove PostProcessing 2.3.0, because URP has postprocessing effects built-in to the volume profiles.

    You should upgrade Cinemachine to the latest 2.6.0. Then, you will have the CinemachineVolumeSettings extension, where you can reference a profile with PostProcessing effects that will blend in and out with your vcam. There is an option there for focus tracking:

    upload_2020-7-7_7-52-56.png

    You don't need to make a Volume for this to work. CM manages its own volumes internally. You just need a profile with DOF override. Of course you can have Volumes in your scene if you want, CM will just override it with the effects in the vcam's profile while the vcam is active.
     
    kkrg001 likes this.
  9. kkrg001

    kkrg001

    Joined:
    Mar 6, 2019
    Posts:
    35
    Thank you. I have made a lot of progress.
    Finally let me ask a question about this error.
    I saw the error message on the left and changed the camera setting to physical, but focus tracking was disabled.
    Is there anything else I need to fix?
    upload_2020-7-10_14-36-50.png upload_2020-7-10_14-37-26.png
     
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    This effect needs to be active:

    upload_2020-7-10_8-15-39.png
     
  11. kkrg001

    kkrg001

    Joined:
    Mar 6, 2019
    Posts:
    35
    >Gregoryl

    For some reason I could not activate it :/
    I recreated the project and it worked.
    This is the end of the question. Thank you for your patience :)
     
    Gregoryl likes this.
  12. AlexSanrey

    AlexSanrey

    Joined:
    Jul 26, 2015
    Posts:
    5
    Hi there!! I have been trying to get depth of field to work correctly in my project, following exactly the same method described by Gregoryl, but I can't get it. I am using Unity 2020.1.17f1, HDRP 8.3.1, and Cinemachine 2.6.3.

    I'm using a Dolly Track with a camera and a volume with depth of field on it. I have created an empty game object to use as my Custom Target, and I have placed it in the area where I need the camera to focus sharply. In the animation window I have added the properties "Focus Tracking" and "Focus Offset".

    No matter how hard I try, the only thing I have been able to achieve is to blur the image by setting a certain negative value in "Focus Offset", but it does not seem that the values that I introduce in this property really take into account my Custom Target, since this Blur seems to start at the camera and end at the model, not the other way around. When I set positive values in the "Focus Offset" property nothing happens. I will share some images where these things can be seen better.

    Thnx in advance for your time!

    upload_2021-9-23_19-36-8.png upload_2021-9-23_19-36-35.png

    upload_2021-9-23_19-36-49.png
     

    Attached Files:

  13. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    It's hard for me to tell what's going on just from your images. Can you put together a simple project that shows this problem and send it to me?
     
    AlexSanrey likes this.
  14. AlexSanrey

    AlexSanrey

    Joined:
    Jul 26, 2015
    Posts:
    5
    Thanks Gregoryl, I finally found a solution.