Search Unity

Official New Post-processing Stack (Pre-Release)

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

  1. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
  2. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Looks like I better make friends with those widgets. It's not hard to do, just time consuming. I did see the curves, which is similar to photoshop :)

    And can't wait to see the fog. I have faraway assets in some of my levels and fog adds some extra IT to my game
     
  3. Deleted User

    Deleted User

    Guest

    This is with TAA on, I appreciate GIF isn't the best quality but it get's the point across. You can even tell by the cuboid there's jaggies and even in editor the grass / tree's is pretty much pure noise. I must admit I've never seen a TAA solution that had any issues with things like cubes.

    Screen with TAA switched on:

    GifCapture-201610312055545165.gif


    Here's one with TAA switched off:

    GifCapture-201610312058278440.gif


    Here's my own test implementation:


    GifCapture-201610312104306390.gif


    You can't tell that much in screenshots, but I'll post some anyway after this post. BTW, I'm not saying the implementation should be blurry in any way, although I am saying it should smooth out jaggies efficiently or it's not worth the cost of having it..
     
  4. Deleted User

    Deleted User

    Guest

    Edit: Screenies don't really say a lot but I'll post them any way:

    1) TAA is on
    2) Custom AA
    3) TAA off

    I'm using Unity 5.5b09, it's a radeon 390X card and it seems to work fine on cubes etc.. It's just foliage, I'm looking through the code.. My solution is err a little blurry / slow.! So hopefully can get this fixed.

    AATest1.jpg
     

    Attached Files:

    Last edited by a moderator: Nov 1, 2016
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    What would be helpful is a cube with TAA on and off, nothing else. Then we can determine if you're bugged or not. Because Unity's TAA removes jaggies here, so I'm thinking.... maybe you have something preventing it from happening, or maybe not 5.5 or something

    Seems weird, cubes are antialiased this end...

    Edit: my test:

    upload_2016-11-1_0-47-51.png
     
    Last edited: Nov 1, 2016
  6. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I'm liking the ground. Terrain?
     
  7. Deleted User

    Deleted User

    Guest

    Yep, just a test scene using standard Unity terrain.. I'll admit it, I used Scion and Amplify colour on that scene. The AO is Unity's, Enlighten's realtime GI works pretty well with Unity terrain as well IMO..

    @hippocoder @Chman

    It's something to do with the render queue, I've had a mess around with it and it's working. In fact it's probably one of the best AA solutions I've seen (apart from ghosting which I'm looking in to). But generally, good work..

    A decent AA solution in terms of graphics has been probably one of the most sorely needed features.

    Also if you're on an AMD card, I'd recommend upgrading drivers.

    Thanks for the support.!
     
    Last edited by a moderator: Nov 1, 2016
  8. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Looking good
     
  9. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hey, I just got the new build of the post effects stack... I love how easy it is to create the look I want. Does anyone know why the default spectralLUT is turning the camera black?

    Fixed it. I just set the images to advanced, and set them to linear
     
  10. SpreadcampShay

    SpreadcampShay

    Joined:
    Dec 9, 2010
    Posts:
    180
    I have yet to try the new stack, but will you be adding SMAA to it? It's what I'm currently using from the older cinematic effect package, because the TAA in the older package was jittering like crazy when in motion. Otherwise this looks really cool! =)
     
  11. Aerys

    Aerys

    Joined:
    Aug 3, 2016
    Posts:
    15
    Hi everyone today i will showing you some tests i have done for the wararm game https://www.wararm.eu/home with the new image effects stack.
    Hope you enjoy :)
    With TAA

    With SMAA

    Volumetric lights, TAA

    No volumetric lights, SMAA
     
  12. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    No, SMAA won't be in the package as we found it to be lower quality and slower than our actual TAA implementation so it doesn't really make sense to add it at this point. FXAA for low-end hardware, TAA for everything else (consoles included).

    Note that the TAA in this package isn't the same as the one in the Cinematic Image Effect package, you should definitely try it as we improved it significantly over the last few months, especially if you're running 5.5 it shouldn't jitter ("shake") anymore :)
     
    zenGarden likes this.
  13. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I love this tool man... And as for TXAA, I think Project Champion will be making use of it once I get a working build going.
    Screenshot 2016-11-01 14.33.52.png

    Sorry about the washed out feel... forgot to tune it. Using Neutral in both shots as I have more control over the look. Filmic ACES looks very similar with less tweaks.

    Screenshot 2016-11-01 14.37.47.png
     
    rebit and Tethys like this.
  14. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @Chman latest pull give me these error when trying to activate eye adaptation
    Unity 5.4.1p4
    Code (csharp):
    1.  
    2. Kernel 'KEyeHistogram' not found
    3.  
    4. UnityException: FindKernel failed
    5. UnityEngine.PostProcessing.EyeAdaptationComponent.Prepare (UnityEngine.RenderTexture source, UnityEngine.Material uberMaterial) (at Assets/PostProcessing/Runtime/Components/EyeAdaptationComponent.cs:106)
    6. UnityEngine.PostProcessing.PostProcessingBehaviour.OnRenderImage (UnityEngine.RenderTexture source, UnityEngine.RenderTexture destination) (at Assets/PostProcessing/Runtime/PostProcessingBehaviour.cs:216)
    7.  
     
  15. EngineArtist

    EngineArtist

    Joined:
    Nov 3, 2016
    Posts:
    29
    Hi,

    I tried the new post-processing stack and I like the results! Film-grain together with chromatic aberration, TAA, ambient occlusion and a little bit of vignetting make for a really smooth look.

    I tried bloom too, but was unable to get the kind of result I was aiming for. I had two objects in the scene with different emissive materials on them. I set the emission factor for the first object to 2, and for the other object I set it to 10. Then I tried playing with the bloom threshold value to see when it would "pick up" those emissive objects, but there was no difference between them. The other wasn't brighter either. So it seems Unity clamps emissive values between 0.0 and 1.0. Would it be possible to allow values beyond this range? Like an HDR bloom. So increasing the emission factor for a material would increasingly make it brighter and cause a bigger bloom.

    I can post screens later.

    Cheers!
     
  16. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Looks like a refresh issue in the editor. Could you try : right-click the Post Processing folder in the project panel and Reimport.
    It doesn't clamp values. Are you sure your camera is set to HDR ?
     
  17. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Still error after reimporting. even the histogram are gone.
    Edit :
    it fixed by remove the whole PostProcessing folder.
    kinda weird though i've been remove and reimport the folder couple times and randomly it working :/
    Oh wait, i was in webGL before and then switching platform to PC.
     
    Last edited: Nov 3, 2016
  18. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    The new post process stack seems to be causing a massive "GFX.WaitForPresent" performance drop only in builds, but not in editor play mode (even when window is maximized, so I don't think this is a resolution thing). Anyone else have this? GPU profiling doesn't seem to work. I'm on Windows 10, DX11, GTX960

    EDIT: Ok, I managed to profile GPU now. It seems the main culprit is SRR. The GPU seems to take around 9 more miliseconds per frame when SSR is turned on. This is for a very simple scene (https://i.gyazo.com/f9705e344fa5d2a6e6b8d61041949b10.png) using the SSR's default settings with "High" reflection quality. Is this normal?
     
    Last edited: Nov 3, 2016
  19. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Yes, this effect is currently quite slow. We're working on it.
     
    PhilSA likes this.
  20. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    Awesome
    Any ideas why it would run much faster in-editor than in builds? It has an extremely low performance impact in-editor, and no noticeable difference in visuals compared to builds
     
  21. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    It shouldn't, I just tested it on 5.5b10 and it runs exactly the same in editor & build. What version of Unity are you building with ?
     
  22. EngineArtist

    EngineArtist

    Joined:
    Nov 3, 2016
    Posts:
    29
    Umm.. okay my bad. Thanks!
     
  23. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    Really like these post fx, only irk I have is the bloom, kinda a love hate.
    I love because at times it looks really nice and better then most blooms out there.
    At other times it looks really low res for whatever reason, like it has been upscaled from a much lower resolution and just looks pretty ugly, particularly on a smaller radius.
     
  24. mantekkerz

    mantekkerz

    Joined:
    Dec 24, 2013
    Posts:
    111
    Great job on the new stack! Couldn't wait to use this ever since the first release of the new effects!

    But I'm wondering, could anyone give me some hints on changing values at run time? I'm including UnityEngine.Post etc and tried referencing the post process behavior, but I always get 'Cannot modify value of ColorGradingModel.settings because it is not a variable'. I know I'm missing something really simple.

    Any hints? :)
     
    arnoob and Ubik3d like this.
  25. PhilSA

    PhilSA

    Joined:
    Jul 11, 2013
    Posts:
    1,926
    I'm gonna say this was a false alarm. I was on 5.5b10 too, but it seems like my scene had a missing reference to its lightmap data for some reason. It wasn't even supposed to have a lightmap in the first place. The problem disappeared when I cleared the link to the missing reference

    The performance difference between in-editor and builds is gone now. But it's great to know you guys are still working on performance improvements
     
    Last edited: Nov 4, 2016
  26. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    707
    Could you add Horizontal/Vertical only Motion Blur toggle?
    It could be useful in FPS games. Its looking weird now when motion blur is also on Vertical axis in FPS mode.
     
  27. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Well, motion blur uses motion vectors (camera + objects) so it's supposed to look that way. We don't have any plan to add horizontal or vertical only motion blur. I'm not sure why it looks weird for you in FPS mode... That's what most games do nowadays and it looks fine (unless you push it to 11 then yes, it will look over the top).
     
  28. ADaurio

    ADaurio

    Joined:
    Jul 12, 2015
    Posts:
    21
    @Chman can you please confirm the issue I'm seeing where SSR doesn't work with baked lighting? It seems that lightmaps prevent it from working.
     
  29. Ubik3d

    Ubik3d

    Joined:
    Sep 13, 2015
    Posts:
    6
    Is it possible to add single effects directly to the camera?
     
  30. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    It should work but we'll look into it.
    Toggle only one effect in the profile and add it to the camera. Disabled effects don't have any performance impact.
     
  31. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    Chman can't you add some enhancements to the AO post processing stack, I want to use it but its a little barebones for AO, things like distance cutoff/falloff from camera.
     
  32. Ubik3d

    Ubik3d

    Joined:
    Sep 13, 2015
    Posts:
    6
    Seconding MattMurphy's request for some hints on how to change these variables during runtime!

    Thanks for this great asset, looks really really sharp!
     
    arnoob likes this.
  33. OCASM

    OCASM

    Joined:
    Jan 12, 2011
    Posts:
    328
    Is there any way for particles to be affected by the motion blur effect?
     
  34. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    504
    I think that's supposed to be done (faked) through stretched particles, right?

    I always assumed that's what the options for camera and velocity scale were for....
     
  35. OCASM

    OCASM

    Joined:
    Jan 12, 2011
    Posts:
    328
    That might be a workaround for sprites but not for mesh particles. With motion blur support they could look like this:

     
    elixir-bash likes this.
  36. Rapickt

    Rapickt

    Joined:
    Sep 12, 2012
    Posts:
    4
  37. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    TAA doesn't work with VR at all at the moment.
    You can access and modify the asset at runtime but it's not optimal.

    Another way would be to keep an internal copy of the asset and modify it instead (so that the profile asset becomes the "default" state, or "initial state").

    Here's a simple pulsating vignette effect using this technique:
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.PostProcessing;
    3.  
    4. [RequireComponent(typeof(PostProcessingBehaviour))]
    5. public class AnimationDemo : MonoBehaviour
    6. {
    7.     PostProcessingProfile m_Profile;
    8.  
    9.     void OnEnable()
    10.     {
    11.         var behaviour = GetComponent<PostProcessingBehaviour>();
    12.  
    13.         if (behaviour.profile == null)
    14.         {
    15.             enabled = false;
    16.             return;
    17.         }
    18.  
    19.         m_Profile = Instantiate(behaviour.profile);
    20.         behaviour.profile = m_Profile;
    21.     }
    22.  
    23.     void Update()
    24.     {
    25.         var vignette = m_Profile.vignette.settings;
    26.         vignette.smoothness = Mathf.Abs(Mathf.Sin(Time.realtimeSinceStartup) * 0.99f) + 0.01f;
    27.         m_Profile.vignette.settings = vignette;
    28.     }
    29. }
    You'll probably want the internal profile copy to be handled by a manager if you need more complex setups but that's the general idea.

    We're aware that it's not the most straightforward nor efficient way of animating profile values and we're currently working on a more flexible solution.
     
    ArachnidAnimal and mantekkerz like this.
  38. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    To get proper motion blur on particles you need them to output motion vectors. This could be done for opaque particles but that's not the general case, you can't really get good motion vectors on transparent / blended particles. Since Beta 4 motion blur is applied after the transparent render queue so particles should at least get some blur compared to previous betas.
     
  39. rebit

    rebit

    Joined:
    Nov 13, 2014
    Posts:
    133
    Thanks Unity to release this !!!
     
  40. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    upload_2016-11-10_17-5-58.png

    This is with default sharpening as set by Unity. Sharpening shouldn't actually add black lines. Lowering from default removes them. Is this just a thing?
     
    Martin_H likes this.
  41. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    In some cases it can add slightly black lines, yes. Generally speaking the default value should be fine, I'm quite surprised by your screenshot as I would expect this kind of artifact with higher sharpen values. Anyhow, this is due to the way sharpening is currently done (very fast and okay-ish). We may end up looking into alternative solutions in a near future. As you may have noticed, TAA is a never ending work in progress...
     
    Martin_H likes this.
  42. OCASM

    OCASM

    Joined:
    Jan 12, 2011
    Posts:
    328
    Currently particles are affected by camera motion blur but that's it. I asked Keijiro Takahashi about this and he told me the problem is that particle rendering doesn't actually support motion vectors. He referred me to this, which more clearly specifies that Graphics.DrawMesh (along with the other Graphics.Draw* methods I presume) doesn't support motion vectors.
     
  43. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    707
    Could you tell us why non moving parts are affected by motion blur? Only wheels are rotating here :
    motion.jpg
    How we can prevent this?
    We are on Unity 5.4.2
     
    GoGoGadget and hopeful like this.
  44. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    612
    Is there any chance the wheels are opaque and the body itself is a transparent? The motion vectors aren't collected for transparent materials if I remember correctly, so they will be 'see through' as far as motion vectors are concerned. Seems a bit weird to have the car body be transparent though.

    Disclaimer: Haven't actually used the motion blur yet, just followed the progress here
     
  45. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    To clarify. forward shaders don't send motion vectors. They don't have to be transparent.
     
    Zuntatos and rebit like this.
  46. brettj

    brettj

    Joined:
    Feb 9, 2015
    Posts:
    43
    What happened to Dither? It's in the Cinematic effects but not in the Stack. Maybe I'm overlooking it?
     
  47. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I'm a big fan of very fast and okay-ish. Please keep, nothing to see here, move along...

    As if this stuff is slower, it doesn't get used at all so... and in any case it'll be textured so nobody will notice it much ;)
     
    Martin_H likes this.
  48. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    707
    Shaders are not transparent. Same is happening with STANDARD Unity 5.x shader. Check out this shot (right rear wheel)
    You can see that in some parts motion vectors are covered by fender, some parts not (same mesh, same material) :
    motion2.jpg

    Also you need to know that tires are skinned mesh renderers.
     
    Zuntatos likes this.
  49. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Seems like the image composition for motion blur not respecting depth of some kind...
     
    Zuntatos likes this.
  50. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    504
    You've ticked the 'generate motion vector' option in the mesh renderer component (I think it's on there, haven't used it yet)?