Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

[FREE] Introducing Amplify Occlusion 2 – Ground Truth Ambient Occlusion, up to 2X faster!

Discussion in 'Assets and Asset Store' started by Amplify_Ricardo, Apr 21, 2016.

  1. BusterTheWizard

    BusterTheWizard

    Joined:
    Jul 2, 2012
    Posts:
    55
    Hi,
    I'm having issues with AO in VR single-pass rendering. It looks fine in the left eye but in the right there is an offset. I tried setting up a left and right eye camera each with AO, but the problem persisted. I read through this thread and saw people having the same issue months ago and saw in the 2.0 update it says it supports single-pass, however I'm having the same issues as people reported before. I'm using Unity 2017.1.1p4, do I just need to upgrade?
     
    Last edited: Jul 19, 2018
  2. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Hey there!

    Depends on how you have it set up, are you using the latest version? (2.0.3)
    • Can you provide a sample for further testing on our side?
    • Are you using regular or instanced single-pass?

    Thanks!
     
  3. BusterTheWizard

    BusterTheWizard

    Joined:
    Jul 2, 2012
    Posts:
    55
    I am using the latest version of AO (I just added it to my project).

    Unfortunately I can't provide a sample as this is a very large project that I am adding AO to.

    I am using regular single pass, I think instanced was added in 2017.2. Do I need to be using instanced?
     
  4. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Hello,

    Instanced Single-Pass is not currently supported.

    Can you replicate the issue on our sample scene, if so we could test that instead of your actual project.

    Thanks!
     
  5. BusterTheWizard

    BusterTheWizard

    Joined:
    Jul 2, 2012
    Posts:
    55
    It happens in the sample scene too. Here are screenshots of it in my scene and the sample scene. I am using the same settings in my scene for AO as the default in the sample scene. This is only the right eye view from the SteamVR display mirror. The left eye looks a lot better, though the problem is very slight sometimes (1-2 pixels in the HMD).
     

    Attached Files:

  6. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Interesting, can you share a screenshot of your AO and Camera Setup? We'll try to replicate the same conditions on our side.

    Thanks!
     
  7. BusterTheWizard

    BusterTheWizard

    Joined:
    Jul 2, 2012
    Posts:
    55
    Here are my camera and AO settings. I actually might not be able to use it regardless, it doesn't play well with the shader for my muzzle flash effects. I'm using a distortion shader to add a ripple effect when shooting but the particles have some shading on them now. I don't know if I just didn't notice it earlier or if I changed a setting that caused it, I'll play with it a bit.
     

    Attached Files:

  8. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    I just updated today to 2.0.3 and I still get the following console warning spam when not in Play mode, when enabling the 2D mode in the Scene view tab:

    CommandBuffer: built-in render texture type 12 not found while executing AmplifyOcclusion_Compute (SetGlobalTexture)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    [AmplifyOcclusion] GBuffer Normals only available in Camera Deferred Shading mode. Switched to Camera source.
    UnityEngine.Debug:LogWarning(Object)
    AmplifyOcclusionBase:Update() (at Assets/AmplifyOcclusion/Plugins/AmplifyOcclusionBase.cs:486)
     
  9. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    We understand, I'll get back to you as soon as we are able to properly test this issue on a VR device.


    That's odd, which Unity version did you use?
     
  10. reggie_sgs

    reggie_sgs

    Joined:
    Jun 29, 2014
    Posts:
    276
    I'll try to get some profiler info for you today. Version 2.0 was running a lot more efficient until the last 2 updates. I believe the version that had the issues with forward rendering was performing great but once that was fixed it dropped again.
     
  11. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Awesome, that could really help us track down the issue.

    Not sure about that performance hit, I'll discuss it with the devs and get back to you asap.
     
    reggie_sgs likes this.
  12. Squeyed

    Squeyed

    Joined:
    Aug 26, 2016
    Posts:
    38
    Firstly the new AO method you've come up looks wonderful, thank you very much! Though I'm getting 2 issues currently.

    The first problem is a console error "Dimensions of color surface does not match dimensions of depth surface" that I can prevent if I disable temporal filtering.

    The second issue occurs when an object that uses an unlit material is between the camera and an area that has AO, I can see the AO being rendered on top of the unlit material. I'll attach an image to show this.

    I'm using single pass stereo, no image effects other than your AO and Unity 2017.3.0f3.
     

    Attached Files:

  13. sameng

    sameng

    Joined:
    Oct 1, 2014
    Posts:
    185
    V2 looks great! Only problem for me is that fog doesn't work with it.
     

    Attached Files:

  14. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Greetings!

    Thank you for reporting it, can you shader a sample for further examination on our side?

    Thanks!
     
  15. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    That's unfortunate, default Unity fog? Let us know, a screenshot of the parameters used would be great.

    Thanks!
     
  16. Squeyed

    Squeyed

    Joined:
    Aug 26, 2016
    Posts:
    38
    This may well turn out that I'm using the wrong sort of unlit shader, after further tests I discovered I could make one unlit shader that doesn't have the issue and another that does. The unlit template included in Amplify Shader reproduces the error, though using the default surface shader template and selecting unlit as the light model works correctly.

    I've attached the example shader that should illustrate the issue from my first post.
     

    Attached Files:

  17. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    For the console warnings related to 2D scene mode, Unity 2018.2.0f2
     
  18. RichGarcia

    RichGarcia

    Joined:
    Mar 6, 2015
    Posts:
    7
    I would like to report that v2 fixed our bug with downscale. Thank you.

    Richard
     
  19. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    423
    Hello, our game is CPU bound and amplify occlusion enables depth for the camera. This doubles the draw calls. Is there a workaround for that? Is there a way to use depth without doubling draw calls or is there a method of using Amplify Occlusion without depth?
    We really wish to use occlusion on mobile or other low performant platforms but the impact of draw calls is very big, bigger than the GPU impact for our case.

    Thanks.
     
  20. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Hey there, were you using forward or deferred rendering?

    I believe we already identified the issue, it will be corrected in the next update.

    Happy to hear it, thank you for your patience!

    Amplify Occlusion enables it as it requires the Unity generated Depth Buffer to properly render the effect, there's no way around it.

    Apologies for the inconvenience.
     
  21. Squeyed

    Squeyed

    Joined:
    Aug 26, 2016
    Posts:
    38
    Hey, I'm using forward.
     
  22. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Without Per-Pixel Camera Normals? But it's likely that you would need to adjust the troublesome Unlit shader in order to ensure that it's picked up by the AO effect. In any case, I passed it on to the devs, I will get back to you with additional information.

    Thanks!
     
  23. oLDo

    oLDo

    Joined:
    Mar 14, 2017
    Posts:
    55
    Hi. Do you still have trial version? I didn't find the download option.
     
  24. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Our apologies but we currently do not provide a trial version for Amplify Occlusion 2.0.

    Thanks!
     
  25. sameng

    sameng

    Joined:
    Oct 1, 2014
    Posts:
    185
    Hi, unfortunately I updated to 2017.4.8 and now amplify occlusion is messed up (too dark) in the scene view in forward rendering. Works fine in game.

    Also, when loading a new scene in the editor, the occlusion doesn't update and leaves an afterimage.
     

    Attached Files:

  26. oLDo

    oLDo

    Joined:
    Mar 14, 2017
    Posts:
    55
    Do you have some performance tests? If somebody have milions of vertices or if somebody have VR with leap motion hands?
     
  27. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Definitely something going on in those screenshots, can you share a sample for further examination? We're available directly at support@amplify.pt.

    Temporal filtering requires a couple of frames to be properly displayed, it will likely not be correct when viewed in the Game view while not playing. The scene preview does not apply temporal filtering.

    We don't have those types of stats at the moment but Amplify Occlusion 2.0 performs up to 2x faster than our previous version, and definitely faster than the Post-processing stack solution.

    Thanks!
     
  28. snoops3d

    snoops3d

    Joined:
    Oct 10, 2013
    Posts:
    24
    does this plugin work with unity 2018.2
     
  29. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Yes, SRP support coming soon!
     
  30. snoops3d

    snoops3d

    Joined:
    Oct 10, 2013
    Posts:
    24
    ahh cool so just be sure I follow this will work with the new unity hdr materials example the " hd render pipeline/layered "
     
  31. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Has anyone made anything cool with this solution since the 2.0 update?
     
  32. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    We've drastically improved performance in our own game on the Switch and other consoles, 2x in some cases. The new Downsample technique is now a viable option, its results are far better than 1.0 offered.

    VR support has also been greatly improved.

    Are you looking for any specific use cases?
     
  33. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    I am glad performance seems to no longer be an issue. Now it's on to accuracy and results.

    I have purchased a few asset store screen space AO and of course it's ok but it could be better. Interior, Character and Grass, Rock usage for the AO mainly is what I need with accurate floor and contact points. As you know no screen space AO so far is accurate especially on the ground and for contact however based on your claims your solution appears to solve all of these issues and takes up even less resources.
    It's kind of ridiculous lol.

    2.The demo you linked however gives me some issues. You are using Volume Grass and thus remove a really good slot to test the AO quality. Your second image isn't even using AO anywhere it seems as shown by the image critics I gave.

    3.A critical question. A user mentioned before about doubling draw called and you said it uses depth. G Buffer depth, Normal Depth Texture or Generated Normals.
     

    Attached Files:

    Last edited: Aug 11, 2018
  34. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Not sure if you were reffering to contact shadows, which claims are you referencing?

    Here's a direct comparison, GTAO Amplify Occlusion 2.0 on the left, HBAO-based Amplify Occlusion on the right. More here: Asset Store Page




    Apologies for the misunderstanding but the video you took the screenshots from is not using Amplify Occlusion 2.0, in fact I believe the AO effect was fairly dialed down when we recorded that.

    Be sure to check Rust by Facepunch Studios for a real world application of Amplify Occlusion 2. Fair warning, if you are not familiar with this mature game, it contains nudity and violence.

    Amplify Occlusion, as with many other image effects, requires the Unity generated Depth Buffer to properly render the effect, there's no way around it. Are you using Forward or Deferred rendering?

    Thanks!
     
    Last edited: Aug 12, 2018
  35. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    @Amplify_Ricardo I am using forward. My current solution supports both modes. Deferred appears to have a lot of limitations especially for transparency which might explain why your demo including the Rust one have grass without AO.

    I didn't see the requirement of it only working with Deferred listed in the asset store description?
     
  36. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Hello,

    It works both in Forward and Deferred, let us know if you find any issues.

    I believe Rust was using it for its grass, not entirely sure if that is still the case. Regardless, AO 2.0 includes a Thickness parameter for added flexibility when it comes to thin assets such as grass.

    Let me know if you have any additional questions, thanks!
     
  37. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Hi ho
    Ok sure.
     
    Last edited: Aug 13, 2018
  38. kanda76

    kanda76

    Joined:
    Sep 4, 2013
    Posts:
    24
    The new version is awesome. Now, I am waiting for "Color Bleeding" feature to use the Amplify Occlusion in all my next projects. Keep up the great work guys!
     
  39. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I just got this, looks really great, but performance is not so good. Enabling Amplify Occlusion on my camera increases CPU usage by 3-5ms, and increases GPU usage by 5-10ms. I'm on Mac (with Metal Editor), on Unity 2018.1.7, with a Radeon 580 GPU. I'm using the default settings on AO, but reducing the Sample Count to Low doesn't make hardly any difference. The previous SSAO effect that I was using had much smaller impact on performance (about 1ms). Presumably I'm doing something wrong, but no idea what. Downsampling is enabled. Any suggestions?

    Also, Unity's PPSv2's TAA makes the grass look really bad, even if I also enabled AO's Temporal Filter. Is there a way to make those work better together?



    AmplifyOcc.jpg
     
  40. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Thanks, it's on the roadmap ;)

    That's odd, it should be much faster. Is this with or without the Downsample option?

    I'm not entirely sure about the PPS TAA issue, I'll pass it on to the developers.

    Thanks!
     
  41. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    I'd like to integrate this asset with custom volumetric effects and fog, so it would be wonderful if you could point me in the right direction: what is the appropriate file and place to insert the volumetrics sampling/fog calculation to fade this effect. Presumably, following near/far fade distance parameters and seeing where they are applied should lead me to the right place?
     
  42. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Hello,

    Thank you for your interest, your project looks very interesting. I'm not sure we fully understand your requirements, Is our Fade Effect not sufficient for the type of effect you are looking to achieve?

    I would recommend looking into the Apply.shader section were the effect is applied.

    Looking forward to learning more about your specific implementation, and possible issues you may have encountered.

    Thanks!
     
  43. Lineau

    Lineau

    Joined:
    Sep 27, 2017
    Posts:
    1
    Hi, I got a problem when I'm in VR, seems look like there is an another occlusion... Is there a specific setup for VR? I didn't find anything in the manual... Rendering method is in Mulit Pass.

    Thanks!
     

    Attached Files:

  44. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    Greetings,

    Should work without any additional steps, are you using Single Pass or Single Pass Instanced? (Instanced SP is not currently supported)

    Thanks!
     
  45. Gladyon

    Gladyon

    Joined:
    Sep 10, 2015
    Posts:
    389
    Hi,

    First of all I would like to say that of all the AO assets I've tried, this one is the best from very far.
    I still have 2 problems:
    - When in 'Debug', it seems that its the 'PostEffect' which is previewed, and not the 'Deferred', is it possible to have a 'debug deferred' rendering?
    - When I am using 'Deferred', I have some artifacts, here are 3 screenshots:

    Without AO:


    With 'PostEffect' AO:


    With 'Deferred' AO (using the exact same configuration):


    I am using the 'G buffer' when AO is active.
    As you can see, the 'Deffered' AO has some problems with the color gradation on the pillar.
    Even if I set 'Intensity' to 0, it has the exact same problem.

    I tried playing with most sliders and checkboxes but nothing seem to change that.
    Except for that glitch, 'Deferred' AO is a lot better than 'PostEffect' AO, is there a way to remove the glitch?
     
  46. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390

    Thank you for using ASE, we really appreciate it!

    1. The debug mode can only be used in Post Effect mode.
    2. That's an odd issue, are you using any other image effects? Can we test s sample on our side?

    Thanks!
     
  47. Gladyon

    Gladyon

    Joined:
    Sep 10, 2015
    Posts:
    389
    Too bad for the deferred debug mode, if you ever mange to make it work it will be great.


    About the glitch, I've located the problem, but I'm still sure about why it does that.
    I was not using HDR, but if I tick HDR on the camera, then the glitch disappear.
    The strange thing is that there's no glitch when there's no HDR and no Ambient Occlusion.
    I guess that there's a thing with the rendering which is less precise without HDR and that you need the extra precision.

    Anyway it's not a problem for me as I will use HDR from now on. So now I have great AO without any glitch, thank you again!
    And if someone ever has the same problem, just tell him to try to activate HDR.
     
  48. Amplify_Ricardo

    Amplify_Ricardo

    Joined:
    Jul 19, 2013
    Posts:
    2,390
    I'm not sure if it's possible but I'll pass it on to the devs ;)

    We would really appreciate it if you could send us a sample for further testing on our side.
     
  49. Gladyon

    Gladyon

    Joined:
    Sep 10, 2015
    Posts:
    389
    I am also using AmplifyBloom and I have some emissive material in a few corners on which Ampilfy Occlusion is applied.
    My problem is that AO seem to come first, it darkens the corner before the bloom pass has a chance to generate the bloom effect for these parts.
    As these emissive material color is just above the bloom threshold, having the AO darken them a bit is enough to take them out of the bloom calculation,

    I tried to put bloom before AO on the camera, and playing with the scripts execution order but it changed nothing.
    And I cannot increase their emissivity becasue that would make them way too bright if they are in a place where there's no AO.


    Is there a way to be able to ensure that the bloom calculation are done before the AO calculation?
     
  50. Gladyon

    Gladyon

    Joined:
    Sep 10, 2015
    Posts:
    389
    I'm sure that if it's possible they'll find a way, devs usually like challenges :)


    About giving a sample, I'm afraid I cannot, the project is quite big and all my graphic assets are coming from the AssetStore so I can't share them.
    I've seen that HDR is using a floating point render texture, that may be the root of the problem.
    I suppose that AO is using some render textures as most screen-space post-effects, so it may be the lack of precision of the render texture when not in HDR which is causing the problem.