Search Unity

Post-processing New Post-processing Stack (Pre-Release)

Discussion in 'Image Effects' started by Chman, Oct 10, 2016.

  1. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Hi,

    For the past year we have been working on a range of Cinematic Image Effects. When we started this project we had two main goals:
    • To develop a range of effects that would look great and help your products look amazing.
    • To make them blazingly fast and super easy to configure.
    So that's what we have done.

    We have now combined the individual post-processing effects into a single, easy to configure, asset driven workflow. In essence, we have an über effect stack. This is great for a number of reasons:
    • What used to take a full screen pass per effect now takes significantly fewer passes. Processing takes up less frame time and you can spend more time rendering other things.
    • The stack has a well defined order. This ensures that post-processing is configured in the correct way and effects are applied in the correct order.
    • Asset based profiles make it easy to share post-processing configurations between scenes or projects and are easy to change on a per-platform basis.

    In addition to this, we have also added a few new features compared to the existing effects and rewrote some of them:
    • Full ACES-compliant HDR color grading pipeline
    • New and improved Chromatic Aberration
    • Lens dirt effect
    • Histogram-based Eye Adaptation
    • Temporal Anti-aliasing
    • Camera Grain
    • Extensive debug and monitor tools
    We’re releasing this beta to the public ahead of schedule in order to get some initial feedback and make sure everything works as it is supposed to before the official release, especially on the wide range of platforms that Unity supports.

    This feature is now available in open source on Github. If you don’t want to bother with git you can download pre-built packages here. It requires Unity 5.4.1+ or Unity 5.5b6+ (previous betas are incompatible).

    Please also take a look at the quickstart guide and read the Known issues and Restrictions sections.

    Have fun and don’t hesitate to send us feedback! And if you feel like contributing… Pull requests are welcomed ;)

    Unity Post-processing Team
     
    Last edited: Oct 10, 2016
  2. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    776
    Exciting stuff, great job on the release guys! Definitely a big improvement for built-in post-processing :)
     
  3. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    This is so good. Has anyone run performance comparisons between the old uncombined effects?
     
  4. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,681
    This is looking very niiiiice. :D One thing I'd like to mention for a future update, and I mentioned it on GitHUB as well, is that the SSR module isn't taking background skybox information into account when it calculates reflection data. I hope this can be added to a future version as it is almost mandatory that skybox is included in reflections when viewing outdoor scenes.
     
    Lex4art and AdamGoodrich like this.
  5. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    SSR can't reflect the skybox, it should be done using Reflection Probes or Planar Reflections (which can be used at the same time as SSR). There's no way around it as the skybox is rendered after SSR is applied (which would be after the final geometry pass in deferred lighting).

    Also keep in mind that SSR is a screen-space effect, meaning it has no way of knowing about something that's not currently on screen. It's not meant to provide complete reflections but to fake "contact" reflections.
     
  6. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,681
    @Chman interesting, I hadn't considered that, but it makes sense. After doing some tests here I indeed see this to be the case... doing skybox through the reflection probe works very well.
     
  7. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    419
    This looks absolutely amazing - together with the upcoming incremental lightmapper it will bring Unity to new heights in visual quality.

    I think I'd still take your SMAA over TAA though, TAA has the tendency to make everything vibrate like a Duracell bunny on a caffeine rush (at least it does so in Unreal).
     
  8. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,541
    I'm getting blocky flickering from SSR with rough surface
     
  9. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    SSR seems to have an issue. On it.
     
    Last edited: Oct 14, 2016
    Gametyme likes this.
  10. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,541
    Thanks, since the flickering are really distracting and i'm not getting that in cinematic effect
     
  11. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,021
    A question with the asset based profile - am I still able to change post at runtime, such as colour grading? I had thought I could change it dynamically without a hard switch from a new profile... or does that not matter?
     
  12. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,541
    @Chman any chance we can get a debug mode for SSR just like in the old SSR version?
    oh and i 2nd hippocoder question
     
  13. xCyborg

    xCyborg

    Joined:
    Oct 4, 2010
    Posts:
    603
    Congratulations, you guys really nailed it this time, please stick to this workflow, don't throw away your hard work.
    It's perfect, the asset workflow is brilliant, all the effects are previewable in scene mode
    I hope this ends up in Unity as a built-in plugin-less feature.
    Some glitches here and there:
    - Time-driven effects (like Grain) still don't update in Game View outside Play Mode, this is a very old nuisance.
    - TXAA not working both in forward or deferred rendering, gamma or linear space. Other settings: D3D11, no SMAA, no HDR.
    - SSAO is not consistent in screenspace and depth, with the effect fading towards the edges.
    Some suggestions:
    -More effects!
    -Profile snapshots and drag and drop.
    Can't wait for final release
     
  14. ArchVizPRO

    ArchVizPRO

    Joined:
    Apr 27, 2014
    Posts:
    411
    Awesome !
    I was waiting it for so long, thank you Unity !
     
  15. Jingle-Fett

    Jingle-Fett

    Joined:
    Oct 18, 2009
    Posts:
    595
    Good question and I'd very much like to know that too. How would we go about toggling effects on/off or changing their values at runtime?
     
    RaoulWB and ftejada like this.
  16. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    One essential that is Tone mapping is missing.
     
  17. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,021
    No it is not. It is part of grading now (as it should be).
     
    Chman likes this.
  18. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    It's fixed in the repository (if you don't mind using Git) and will be in the next build.
    Yes you can still change values at runtime via scripting and enable/disable features as you go. It will work just fine. We do have plans for the future to make this easier though.
    That would require constantly updating the Game View, we don't want to slow down the editor too much.
    It's TAA, not TXAA ;) Could you give more details about how it's not working exactly ?
    That's a screenspace effect. It only knows about what's currently on the screen.
     
  19. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,541
    @Chman i'll check the latest repo, thanks :)
     
  20. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    586
    I'd like to point out that the eye adaption isn't correctly adapting to scenes with an avg luminance above 1. Setting 'max luminance' to anything above 1 doesn't change anything. Using the debug view, you can see the avg bar doesn't go above 1 either. Removing the saturate in this code in EyeAdapation.cginc
    Code (CSharp):
    1. float GetLuminanceFromHistogramBin(float bin, float2 scaleOffset)
    2. {
    3.     return saturate(exp2((bin - scaleOffset.y) / scaleOffset.x));
    4. }
    seems to fix it, without causing undesired side effects in my quick testing.
     
  21. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,434
    In my game, there are multiple cameras (5) for rendering distance, also for different players in different monitors and different quality settings that adapt change post at runtime as hippo mention. Plus all this made for each different platform.

    Can this stack be a more sophisticated solution for complex camera settings? or I'm asking too much?
    Don't know how but, the new input system is a nice simple solution example to the complexity problem of multiple players and inputs. Is a nice example that can be transfer some how in this camera solution.
     
  22. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Good catch, thanks ! It's now fixed in trunk.
     
    Zuntatos likes this.
  23. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    It could help, yes, as you can pre-build a set of profiles depending on the target platform and swap them easily depending on what you need. The best way to find out is to try it out :)
     
    AlanMattano likes this.
  24. blizzzz

    blizzzz

    Joined:
    Jun 22, 2016
    Posts:
    15
    I've been using the post processing beta 3 along with Unity Version 5.5.0b7. Regarding the tonemapping. Could someone explain the definitions of the following knobs, and how they relate to the tonemapping curve controls? I've been more familiar with terms like Toe, Crossover, etc..
    • Black In
    • White In
    • Black Out
    • White Out
    • White Level
    • White Clip
    Also would be super useful to display the tonemapping curve which would make the tuning of these values more intuitive. Another observation is that changing the tonemapping to Filmic crushes the dark values significantly. I can post some tests of this with a color wedge or something similar.... but for now just seeing if anyone else is experiencing this?

    FWIW I'm using deferred rendering, HDR, Linear along with previewing in VR on Oculus Rift device.

    thx
     
  25. RedRiverStudio

    RedRiverStudio

    Joined:
    Sep 8, 2014
    Posts:
    130
    Rookie here. Can somebody please post a code sample of how you would toggle a single effect on or off at runtime? That would be very helpful, thanks.
     
  26. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,016
    HOLY DOGSHIT!!!! THIS IS LOVELY!! I can drop scion now and look at this... downloading now
     
    spaztronaut, Tethys and hippocoder like this.
  27. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,021
    Yeah I guess we won't moderate that comment. Sometimes, an expressive use of language is the only way to describe the euphoria that stems from using the hard work of many, who toil away ceaselessly for our pleasure.

    Unity did a bang up job.
     
  28. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,016
    Yes they did. I consider myself a Unity pro and as someone who aims for visual fidelity, such as for my Project Champion title, I welcome this new plug. And I love that I can edit and play!!

    I can't wait to see the support for FP HDRI, especially for sky textures. In 5.4, I have a full HDR sky and it doesn't display in full range. Also spectral textures for Aberration turns the camera black.
     
  29. cdmpants

    cdmpants

    Joined:
    Apr 8, 2012
    Posts:
    62
    So happy to see this. Just the improved management and the ability to share full post-processing presets makes this really exciting. All that's left is for more people to use it.
     
    KRGraphics likes this.
  30. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,016

    And I can script it to add it for any camera at any time
     
  31. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Right now these settings are a bit abstract, I agree. I'll add a visual curve in the editor soon, it will make editing these much easier.
    Coming in 5.5 (already in beta) :)
    Hmm that shouldn't happen. Is this using the default spectral textures or your own ?
     
    AlanMattano likes this.
  32. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,016

    The defaults.
     
  33. Daerst

    Daerst

    Joined:
    Jun 16, 2016
    Posts:
    274
    Great asset, I'm having a lot of fun with this - thank you :)

    I'm using two cameras to render the scene (for a Fog Of War effect) and overlaying some areas from cam B (render texture) over cam A (screen). They are 99% the same, since only enemy units hide in the Fog Of War. My custom "composite" effect is the first on the screen cam and comes before the Post Processing Behaviour. Still, some of the post FX are only applied to my main render (the screen) and not to the render texture's, namely AA, AO, Reflections and Motion Blur. The other affects are applied to the whole composite.

    It seems that said effects are applied before all user-defined post FX. Is there any way for my composite effect to come first?
     
  34. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,021
    Command buffer will allow you to insert it in the correct place. I don't have an example though.
     
  35. Daerst

    Daerst

    Joined:
    Jun 16, 2016
    Posts:
    274
    I tried to insert my composite effect at various places using the Command Buffer. The effect works and I can reliably put it before or after Ambient Occlusion, for example, by choosing CameraEvent.BeforeImageEffectsOpaque or CameraEvent.BeforeImageEffects respectively.

    Still, TAA (and Reflections, though I haven't looked into that too much) does not care for my composite and only affects the current camera's area. Some parts of the effect, like Sharpen, seem to work on the whole image. For simplicity, I use forward rendering. My custom command buffer appears before the Temporal Anti-Aliasing command buffer in the list at the bottom of the cam's inspector. Any ideas?
     
  36. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,021
  37. Rapickt

    Rapickt

    Joined:
    Sep 12, 2012
    Posts:
    4
    Hello,

    Great job, Unity really needed to step up on the post-effect part. Two things
    1- Could you update the build for the non Git users? 16 days since the last one, if you don't have the time well I can understand that
    2- Is there anything I should be aware of for using these post effect with VR device (Vive)?
    Epecially on thoses points :
    -Performance
    -Compatibility
    -MotionSickness
    Tried it really fast this morning, AO was not working with the basic SteamVR CameraRig, added a screenshot to my post

    Anyway thank you a lot for this great addition to Unity
     

    Attached Files:

  38. panokani

    panokani

    Unity Technologies

    Joined:
    Jun 6, 2013
    Posts:
    12
    Hi, we were just discussing about this here and would it be possible for you to better explain how are you really setting up your post-processing pipeline? If you could also make a small repro and link it to your post I could take a look at this right away. :)
     
  39. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Beta 4 should be released very soon, we have a few more things to add & fix first.
    See this for a list of known compatibility issues.
    Hmm ambient occlusion does work fine with single pass rendering on my machine. I'm not sure what I'm supposed to look at on your screenshot, it seems to me that AO is working there...
     
  40. Rapickt

    Rapickt

    Joined:
    Sep 12, 2012
    Posts:
    4
    @Chman Thank you for your reply,
    I attached a scene view and a game view, I'm using the VR Camera rig provided in the steamVR plugin. the game view is the one with almost only the AO.
    But it is strange because the exact same Post Processing Profile work on a 'regular' FPS controller prefab.
    Maybe I've missed something in the settings of the VR Camera rig that is provided by SteamVR plugin. I'm using the Beta3.
    Anyway it's not a big deal for me at this time, just thought I should let you know about something that looked strange to me
     

    Attached Files:

  41. Daerst

    Daerst

    Joined:
    Jun 16, 2016
    Posts:
    274
    Thanks for getting back to me :) The basic idea is like this:
    1. Render cam B (depth 20, layers set up to omit layer 'Hiders') to a screen-sized render texture
    2. Set up cam A that renders to screen (depth 40, so render after cam B, all layers) with a command buffer BeforeImageEffectsOpaque
    3. Cam A renders to screen, command buffer will overlay parts of the render texture
    4. After everything is done, TAA is applied
    I've created a minimal setup scene and guess what? Everythings working like a charm. Huh! Seems like something else is wrong in my (more convoluted) game project, so I will have to look into that myself. I've attached the test scene anyway, in case somebody wants to check it out :)
     

    Attached Files:

  42. ADaurio

    ADaurio

    Joined:
    Jul 12, 2015
    Posts:
    19
    This is a fantastic system. Unity has been falling behind on post processing options for a while now. Really happy to see you guys investing in it.

    Is it a bug or by design that lightmapped objects are unaffected by SSR?
     
  43. Deleted User

    Deleted User

    Guest

    I finally got around to testing the new post stack, got to say the AO is great.. One of the few I've tried that actually works with little artifacts, the rest seem in order besides two.

    I'm not sure what Temporal AA is adding to the table? By AAA examples (like in FO4, UE4 etc.) TAA has always been a little on the blurry side, although it has an uncanny knack of smoothing jaggies (especially in tougher scenario's like foliage) and removing glossy / specular artifacts.

    Unity's implementation seems to add a little bit of jitter and that's about it (yes I looked at the known issues). I can hardly tell if it's switched on or off and see no benefit over FXAA.

    Also just to note the bloom is a little harsh, both Sonic Ether and Scion's implementation do a better job.

    Although, now I know it's at least possible it'll be worth looking at Nvidia's postworks and trying to implement their TXAA solution..
     
    KRGraphics likes this.
  44. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,016
    Hey guys... I'm still playing with the post effects stack and I'm really liking it. Will global fog make it into the final release? That is one thing that is missing for effects in this stack. I have objects in my game that are far away and I would love to add some form of haze to give the illusion of distance.

    I am also trying to make custom LUTs but how do I actually go about doing this? Could I just take a screenshot using screenshot creator and call it a day?
     
  45. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,021
    https://github.com/Unity-Technologies/PostProcessing/wiki#user-lut explains poorly the process (for the uninitiated). Basically the screenshot is not used by Unity. Instead unity just wants one of the neutral LUTs from /PostProcessing/Textures/LUTs/

    You paste that neutral LUT down over your screenshot in the art package, change the colours, then crop to that LUT area and export it as a new LUT image you can now use. I think the process could indeed be improved in 2 ways:

    1. Unity can save existing grading to a lut texture
    2. Unity can save a combined "prepared" screenshot+lut texture you can open in art package. You would still need to crop it though. I guess someone can easily make a script for this and post it up here if they have 5 mins....
     
    KRGraphics likes this.
  46. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,541
    Oh fog. . . of course, now i remember what missing :D
     
  47. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,016
    I still remember that too. As long as it looks natural such as using an object to determine the thickness of the fog... or like atmospheric scattering
     
  48. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    28,021
    Last edited: Oct 31, 2016
    KRGraphics likes this.
  49. Deleted User

    Deleted User

    Guest

    I hope not, it's more like a slightly transparent wall as opposed to actual fog.. It'd be nice if they took the atmospheric scattering from the BS demo and finished it off with a nice exponential heightfog that uses a directional inscattering exponent based upon the position of the directional light..

    In all fairness, it's not too difficult to do if you're ok with shaders.. P.S for the LUT stuff, if you have amplify colour it couldn't be easier. Just click take screenshot and then import it back, that's about all there is too it.
     
  50. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    We have a fog effect coming. I can't say when, but it'll end up in the stack eventually.
    It can't, unless you're ready to do color grading in log space :)

    All the internal grading is done in HDR in the ACEScg & ACEScc color spaces then baked - along with the tonemapper - into a log LUT (ARRI LogC curve). So you can't just grab the LUT and do you thing in Photoshop, it won't work. We have plans to give access to this log LUT in the future so that one could do the grading in Nuke or Resolve, but right now it's hidden to the user.
    Would you have sample screenshots or videos to show us ? Because it does make a massive difference in PBR-heavy scenes. If you're looking for the "blurry" effect that's not what our TAA is about. It's sharp and it's one of its strength. Make sure you're in play mode when you're testing it as the game view doesn't refresh automatically in the editor (which may be one reason why you didn't see any difference with FXAA).
     
    antislash and Stardog like this.
unityunity