Search Unity

Cinemachine & Post FX

Discussion in 'Cinemachine' started by fuzzygoat, Oct 24, 2017.

  1. fuzzygoat

    fuzzygoat

    Joined:
    Feb 11, 2016
    Posts:
    29
    Is it possible to have post FX on the main camera (mostly thinking a global colour grade here) and then enhance this by adding "Cinemachine Post FX Scripts" to each virtual camera to tweak DOF and bloom on a shot by shot basis?

    I have tried this and my problem is that I can setup a nice global grade on the main camera (which is used by all CM Virtual Cameras) but as soon as I add a "Cinemachine Post FX Scripts" to one of these virtual cams it removes my global grade, even though "Color Grading" is not ticked active. If I do tick color grade active then altering the settings has no effect on the grade I am seeing in the game view.

    Gary @ Fuzzygoat.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    @Coulter You can do this with the Post Processing Stack v2, which supports blending of Post effects.
     
  3. fuzzygoat

    fuzzygoat

    Joined:
    Feb 11, 2016
    Posts:
    29
    Thanks for the quick reply, is Post Processing Stack v2 something I can get now? the version I have now is the standard one from the asset store.
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    You have to get it from GitHub https://github.com/Unity-Technologies/PostProcessing/tree/v2
    Note thatPPv2 is quite a different animal, and the CM classes to support it are different. The CinemachinePostFX class will no longer be valid. You will have to re-author your CM/PostFX content using the new CinemachinePostProcessing extension on the vcam.
     
  5. fuzzygoat

    fuzzygoat

    Joined:
    Feb 11, 2016
    Posts:
    29
    Much appreciated, I am only testing things out at the moment anyways, I will have a look and see what I can get working. Many thanks Sir.
     
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    Make sure you have the latest CM 2.1 RC too
     
  7. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    You'll also need to setup the layers properly.

    The PPS layer needs to 'see' the vcam layers. The best thing is to create a new layer, call it 'vcam', and assign all vcams to that layer and then the PPS component on the Main Camera to that layer.

    We'll writeup a post on that shortly, it's a little confusing without a step by step.
     
    fuzzygoat likes this.
  8. supaworst

    supaworst

    Joined:
    Mar 26, 2012
    Posts:
    45
    Hello,
    i've just set up the post processing stack with CM and it works like a charm. Anyway, i'd like to use a custom shader (for example custom blur) on a virtual camera. Is it already possible or using cinemachine with post processing stack is mandatory?

    Thanks in advance
     
  9. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    If you can customize your PP profile to use your shader, that would be the best way. Otherwise, you could attach the shader to the Unity camera, but then all vcams would share it - it wouldn't be per-vcam. If you really need a custom shader per vcam, then you would have to implement a custom extension to Cinemachine, similar to what the PostProcessing extension is doing. You can have a look at the code as an example.
     
  10. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    Hi @supaworst You can write custom shaders all you want and put them on the Main Camera. No need for the PPS.

    With PPSv2 it's pretty straightforward to write and add your own component to the stack and have it blend with CM blends, however we've found that some custom ones don't blend perfectly. I found that just yesterday in a custom lens distortion addition to PPSv2 which had an undesirable blend behaviour.

    Once I figure out what went wrong there I'll share the info
     
  11. Adam_Myhill

    Adam_Myhill

    Joined:
    Dec 22, 2016
    Posts:
    342
    Greg and I have to stop responding at exactly the same time, ha!
     
  12. supaworst

    supaworst

    Joined:
    Mar 26, 2012
    Posts:
    45
    Thanks to both, i'll definitely give it a try and let youn know if i have any issue!
     
  13. thomas4d

    thomas4d

    Joined:
    Sep 5, 2013
    Posts:
    56
    is this a issue with the new version or am i just missing something ? I'm using HD rendering and I'm trying to add Post process to the all Cameras with Cinemachine with no luck

    I've added PP Layer and Volume and the Profile does not effect any main camera ?

    I've tried added the PP behaviour to the main camera and still not effecting any camera ?

    I put all camera in a vcam layer no effect

    does HD rendering work with Post processing ?