Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

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

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

  1. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,431
    Hmm too bad, i was looking for alternative water reflection.
     
  2. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    126
    Hello,

    I have an error when i use this kit on my main camera for VR, the image is stacking on top of each other.
    I only have Anti-alisaing and AO on.
     

    Attached Files:

  3. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Sooo artifact-free when it comes to SSR is quite difficult if you want to keep it fast enough to be usable (SSR is conceptually broken so...) but we're still looking at fixing some of the most glaring ones.

    Thanks for the screenshots, do you happen to have this scene in a minimal project? I'd be interested to give it a try...

    As for contact hardening, because we chose the "fast route" for this SSR you can either have contacts or nice blurry reflections but not both at the same time. If you go into ScreenSpaceReflections.hlsl you'll see the following line:

    Code (CSharp):
    1. #define SSR_ENABLE_CONTACTS 0
    Set it to 1, right click the shader folder and reimport. You'll get an alternative SSR version that may work better for you, depending on your needs.

    Planar reflections are the best when it comes to water, especially calm water. You really don't want to use SSR for that even though some games have tried. "Tried".
     
  4. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,431
    Yeah that's a very good point. the only problem is we all know that planar reflection in unity suffer from different lighting result and no fog. Except if you have some pointer to fix that i'm all ear :D

    @Chman Oh btw it seems the current ssr doesn't fallback to reflection probe, this know issues right?
     
    Last edited: Sep 12, 2017
  5. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    It should fallback to reflection probes correctly (at least it does in my currently opened project)... If it doesn't for you, a repro would be welcomed :)
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,139
    Well, within reason :)

    Just sent you a pm.
     
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    What if any changes to SSR will come in V2 (assuming this is V1 talk so far, of course!) ?
     
  8. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,431
    upload_2017-9-12_23-4-28.png
    should've fallback to reflection probe isn't?
    also randomly i'm getting same black reflection on top of screen
    upload_2017-9-12_23-6-38.png

    @hippocoder we are talking about the latest actually
     
  9. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,139
    We're talking about V2.

    (or at least I was!)
     
  10. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    Just wanted to clarify since the previous pages weren't, so its tad confusing for other readers.

    Regarding probe fallback, do you guys have box projection ticked and a decent arrangement to cover the area?
     
  11. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,139
    Probe fallback seems to work fine for me, I'm doing a bit more extended testing now.
     
  12. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,431
    @hippocoder yep

    well that's mean something broken in my project.
    Ah well.
    Edit : Wait why my image showed up broken?? *sigh
    fine, here in case people wondering https://imgur.com/WkfnOep

    Edit2 @Chman latest pull v2 spam the editor with exception error for OnPreCull and OnPostRender
     
  13. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    It looks like the camera is outside of the probe area and the top camera plane is showing the lack of information to fill in with...
     
  14. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    How to change V2 settings :

    Code (CSharp):
    1. Bloom b;
    2.                 GameObject.Find("Global Volume").GetComponent<PostProcessVolume>().sharedProfile.TryGetSettings(out b);
    3.                 b.intensity.value = bIntensity;
    4.                 b.color.value = bColor;
    5.                 b.enabled.value = true
     
  15. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,431
    even if in that case it should've fallback to reflection probe isn't?
     
  16. deadlycrow

    deadlycrow

    Joined:
    Feb 10, 2014
    Posts:
    128
    Maybe this is a silly question but, how can i get God rays with the new post-processing stack asset? there is no check or option in the list to add god rays... if not... is there another solution to add god rays? :/
     
  17. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Try SunShaft from standard asset's image effects
    Or True Volumetric Light from github
     
    Last edited: Sep 13, 2017
  18. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    RenderTexture.GenerateMips failed: render texture does not have mip maps (set useMipMap to true).

    This is spamming my console with the latest V2 post using 2017.1.1p1...
     
    Lex4art likes this.
  19. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    270
    Thanks for resolving this - I thought that it was new requirement for render texture settings that I don't need at all, good to see it is just v2 related bug...
     
  20. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    You can prevent it by disabling the SSR component for post. I think this will be resolved in a future engine update according to github.

    At a guess I'm going to say it's to do with the blur texture not needing mip maps for SSR.
     
  21. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,139
    Yeah I think the intended release to use this with is 2017.2. That error doesn't happen in the latest beta.
     
    hippocoder likes this.
  22. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    Tried latest b11 and latest from github and it smashed the crap out of everything else so it's a no go for us at the moment :D

    The post effect rendering is entirely broken in the ui with massive dials, errors etc.
     
    AcidArrow likes this.
  23. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    It's a bug introduced in Unity 2017.1p1 and 2017.2bsomething. It's been fixed internally so it'll be in a future patch.

    FYI current v2 fully works with Unity starting with 5.6, 2017.2 is not required at this time. This may change in the future though.
     
  24. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,078
  25. DynastyV

    DynastyV

    Joined:
    Mar 16, 2015
    Posts:
    14
    I have an outline shader that I wrote similar to what this tutorial covers, except that it's an internal outline: https://willweissman.wordpress.com/tutorials/shaders/unity-shaderlab-object-outlines/ This is NOT the "move the face along the normal" outline technique.

    My shader uses the depth buffer of the image to determine if an outline pixel is occluded (if a pixel is occluded, it is discarded). The problem occurs when I attempt to use temporal anti-aliasing in conjunction with my outline shader. The effect goes completely crazy. I've attached a picture of what happens to this post.

    I do not have this problem with fast approximate anti-aliasing. I would really like to use the temporal anti-aliasing effect since it also cleans up some of the artifacts from the SSAO. Note that I am using forward rendering, and my outline script is currently set to run after the post processing effects (if I attempt to run before, the problems are even worse).
     

    Attached Files:

  26. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,078
    TAA jitters the screen view by less than a pixel and uses the difference between each frame to create a pseudo-subsampling effect, this is why TAA seems to continue to look better once the camera stays still. I see your shader is likely a vert/frag shader instead of just a surface shader. If it was a surface shader, this would usually be handled for you by default from unity's built in macros. Otherwise you have to add the proper macros yourself to your shader code to handle the jitter I believe, though I haven't had to do it yet so don't know the specific details.

    FXAA is just a smart-blur of the rendered image so it wouldn't have the same problem.
     
    Martin_H likes this.
  27. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
  28. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,163
    Every SSR effect has problems with transparent surfaces, that has nothing to do with the stochastic approach.
     
    AcidArrow likes this.
  29. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832


    Untitled.jpg
     
  30. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,078
    I don't think that's an issue specifically with the stochastic implementation, that's an issue that a lot of camera effects have had recently, I forget what the fix for it is though but that effect should be able to be updated to get around it

    edit: It is the [ImageEffectOpaque] at line 404 that causes the issue. Comment out that line and your transparent objects will stop displaying though other meshes.

    Unfortunately though, even with that, it doesn't seem his effect is programmed to trace reflections on transparent surfaces, but neither is Unity's SSR from V1, haven't tried their new V2 version yet though, but I doubt that one will either unless they switched to their new renderloop system... but it's 5.6 compatible, so that's unlikely too.
     
    Last edited: Sep 17, 2017
    hopeful and Martin_H like this.
  31. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,431
  32. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,078
    Indeed, I'm sensing a bit of snark, but it's been weeks since I've read that thread, as you can see I posted in it as well, it's easy to forget a name, but I was impressed with your water when I saw it back then.
     
  33. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Where i can find SSR v2 ?
     
    Last edited: Sep 17, 2017
  34. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,431
    Oh sorry if you getting it that way, didn't mean it like that.
     
  35. DynastyV

    DynastyV

    Joined:
    Mar 16, 2015
    Posts:
    14
    Is there any chance that we'll see the MiniEngine AO in the post processing stack? They've distributed a package for Unity but it doesn't play so well with the post processing stack.

    https://github.com/keijiro/MiniEngineAO
     
  36. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    Just a quick warning about this SSR implementation: with base quality settings / half-resolution render target it takes 17.6ms to render on PS4 (and ~8ms on a GTX980).
    It's already in v2.
     
  37. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,078
    When I did perf comparison with V1 Post-processing's SSR, the performance was similar if not better in many cases, on PC at least. Are you saying the V2 is a decent performance improvement then?
     
  38. Chman

    Chman

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    721
    SSR in v1 was pretty slow as well (although not as slow but slow enough to not be usable in production). v2 is a lot faster. We get to ~2/3 ms on PS4 with sensible settings and TAA enabled. Still not as fast as I'd like honestly. When it comes to SSR you get what you pay for, quality or speed. Pick only one.
     
    Invertex and hippocoder like this.
  39. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    I Already tested SSR1 with low settings and i get very good performance.
    Where can I download SSR V2?
     
  40. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,431
    any news about the black edges area in the SSR when blending with reflection probe?
     
  41. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726


    Regarding V2 SSR, I like it's visual and quality a lot, 3ms does seem like I would like to use it in some areas but not others. Am I right in thinking we can just change the quality or even turn it off and on as we move around the level via the built in volume blending system?

    In any case you're one of the guys sweating over my game's visuals and I have to say: thanks a lot! All the optimisations you do are very appreciated :)
     
    Alverik likes this.
  42. Alverik

    Alverik

    Joined:
    Apr 15, 2016
    Posts:
    409
    Are you using Single pass stereo? The most common error with shaders not compatible with SPS is a double screen effect. If you are using Single pass then untick the effects in the profile one by one until you find what's causing the issue.

    By the way, global fog is an option both in the post processing profile and also on Unity's Lightning tab (per scene).

    Though, last time I checked v1 and regular V2, they had a lot of compatibility issues with Single pass. Maybe the last beta fairs better, but I don't currently have the time to test it (so I just quickly changed to regular stand alone effects). If you do test the latest beta and it works well for you let me know, lol.
     
    Last edited: Sep 18, 2017
  43. JakubSmaga

    JakubSmaga

    Joined:
    Aug 5, 2015
    Posts:
    417
    Here: https://github.com/Unity-Technologies/PostProcessing/tree/v2

    Just click on "Clone or download" and select "Download ZIP", From now AO and SSR are in profiles instead of PostProcessLayer.

    Also remember to use the new Volumetric AO which has better quality and performance, just change mode to "Multi Scale Volumetric Obscurance".
     
    LightingBox2 likes this.
  44. AL_W

    AL_W

    Joined:
    Jan 25, 2016
    Posts:
    330
    Can someone please help explain to me how to use this tool? It's not as straight forward as the original Unity post processing scripts.

    Should I just be using the post process volume script by itself like below? Also how come the chromatic aberration settings are disabled? :(
     
  45. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    7,139
    Layer on camera and volumes all around. Just make sure to set layers for the volumes. If you just want to mess with it, have one volume and set it to global.

    To enable the settings click on the circles on the left. I haven't tested it, so I'm just guessing, but I think the intent is that if you haven't checked the circle, the volume leaves the setting as is.
     
  46. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    270
  47. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    Yeah we use single pass, cool will have a look. but I have no effect enbled and get this as soon as I have the component on the camera
     
  48. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    230
    The V2 stack is very similar to the UE4 way of doing things. Once you wrap your head around the intended workflow it's actually a really nice setup.
     
  49. lverhoef

    lverhoef

    Joined:
    Jan 15, 2015
    Posts:
    13
    Hey all! So we're using v1 of the post processing stack, and we're encountering this issue where ambient occlusion is applying to emission (running in deferred, applying to ambient only). Looking at the code, this seems to be intentional. I'm not sure this is correct though... It can make things like lightbulbs darken so much that they don't seem to be emissive at all! I've attached a couple images, one with it applying to emission, one with that disabled in the shader.

    Emission_AO.png Emission_NoAO.png

    Looking at the code of v2, it's in there as well (with additional features!). What's up with this? It really does seem wrong, but it might also just be beyond my current understanding.
     
    Martin_H, StaffanEk and hopeful like this.
  50. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,832
    Legacy Cinematic Effects SSR vs V2 :
    Gif comparisons
    Webp.net-gifmaker (84).gif Webp.net-gifmaker (85).gif Webp.net-gifmaker (86).gif
    I think most legacy effects has more options and are easier to get better result
    For example post processing stack's depth of field is very limited in settings. But legacy one has lots of options and features
     
    Last edited: Sep 21, 2017
    ArachnidAnimal and Stardog like this.
unityunity