Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

[FREE] Stochastic Screen Space Reflection

Discussion in 'Assets and Asset Store' started by Charkes, Nov 6, 2016.

  1. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    906
    Disable [ImageEffectOpaque] on line 404, it will get rid of that issue, though test to make sure any new issues for you aren't introduced.
     
  2. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,001
    Thanks for this cool SSR. I'm going to use this.
    Just why we have to play game to see SSR effects? Isn't that possible to see SSR when game isn't running?
     
    Last edited: Nov 17, 2017
  3. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,785
    You can add:
    [ImageEffectAllowedInSceneView]
    [ExecuteInEditMode]

    in main script

    But the result will not be good
     
    ksam2 likes this.
  4. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    How can i repair this???
     

    Attached Files:

    • 001.png
      001.png
      File size:
      468.9 KB
      Views:
      1,817
  5. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    3,872
    You probably can't, and if this is a dealbreaker for you, then you need a solution based on "planar reflections" instead of "screenspace reflections".
     
    MarkusGod likes this.
  6. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    OK....
     
  7. skyecrack

    skyecrack

    Joined:
    Jan 5, 2018
    Posts:
    29
    Hey @Charkes, great stuff, been using it for quite a while now and haven't really got any complaints... until i switched from DX11 over to 9. Namely in the editor it works just fine, but when I build it, there's this strange artifact that has something to do with the temporal sampling function since the reflections lag behind objects they're reflecting when i rotate the camera in any direction and look all grainy and stuff.
    I've tried checking and unchecking everything and so far only temporal sampling seems to cause trouble. Any idea what to do? It would be a shame if I had to ditch this effect since I've really fallen in love with it, but DX9 is a priority right now. 5.6.1 btw
     
  8. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    906
    Have you tried GLCore instead? DX9 is being removed from Unity and is quite limited. GLCore will run on older Windows versions that don't support DX11.
     
  9. skyecrack

    skyecrack

    Joined:
    Jan 5, 2018
    Posts:
    29
    Nevermind, I found a way out. And I did switch over to 11. Lol
     
  10. HTusa

    HTusa

    Joined:
    Aug 2, 2017
    Posts:
    9
    Fantastic work.

    Here's a problem I've been having. The reflections seem smeary and incorrect compared to the SSR solution in the v1 Post-Process stack - most noticeably on the sword and the sphere:

    ssr_comparison.jpg

    I know the hair on the head doesn't look right (it's just a straight up hair shader from the Blacksmith asset, along with the character itself), but even on the sphere on the right, which is just a regular Standard shader, the reflections look broken.

    I'd rather use your solution since it works with the custom Forward shader I have on the character (instead of reflecting black like the Unity SSR). Did I break something, or is there an issue with the script? I'm using the latest 2017.3.

    Thanks.
     
    skyecrack likes this.
  11. LightingBox2

    LightingBox2

    Joined:
    Mar 31, 2015
    Posts:
    2,785
  12. Flurgle

    Flurgle

    Joined:
    May 16, 2016
    Posts:
    368
  13. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    Hi, i change you code to commandbuffer and add the thickness of the intersection(like the first photo). can i share this to github? 01.jpg 02.jpg 03.jpg 04.jpg 05.jpg
     
    elias_t and ksam2 like this.
  14. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    906
    Just click Fork on the github so you have a version on your own account and commit the changes there, then others can download your version if they'd like to. You can also then do a pull-request from your fork to his.

    Also, I'm noticing your reflections aren't contacting with meshes that are sitting on the ground, there's a visible line below the object where reflection isn't happening. Did this exist in the unmodified version of this effect? I don't recall.
     
    ksam2 likes this.
  15. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    you mean is this effect?
    8NBF$4VU`X8T267`6CK)[WV.png
    and i push to github,future will continue to modify the optimization.
    and next floor is the address that is now revised.
     
  16. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
  17. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    906
    Nah not the blurring to in the non-contact area, though it's probably related, I'm guessing you had down-sampling on in those screenshots?


    Though, given how sharp the line is, this particular issue doesn't seem like downsample issue.
     
  18. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    yes i use half downsample
     
    ksam2 likes this.
  19. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    The FlashBul SSR in 2018.2.0.f2 does not look very nice
     
  20. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    The solution by OP seems to work on 2018.2.0f2 but if you dissable the FX stack it stops working. It seems to require antialiasing to be enabled on the stack for it to work. I wonder if it will work with the v2 stack.
     
  21. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    OK good news, Works when using post process stack v2. Lets say is not working is that gryaish reflection, enable it fixes, you can even dissable and reflections keep working!

    EDIT: even more simple. If you launch with Post Proces V1 dissabled it works! Jaja.

    Gonna do a test build an see if it works on console. Will update post.
     
  22. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
  23. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    I update new GitHub and need enable UnityTAA. Otherwise the effect will not be good.
     
    TooManySugar likes this.
  24. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    Hi, everyone. I renewed it. This time, we added a 2-D screen stepping method. HiZ's script is also preliminarily implemented. Let's talk about the next update in more detail. This update modifies the effect under 0 roughness (the original effect is blurry), and finally adds sharpening and PreintegratedFG.
     
    hopeful and TooManySugar like this.
  25. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
  26. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
  27. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    My Change VS Origin.
    KHJHGBEMZGH5(A9(59D%WA2.jpg 9D18{4%C}66%]1VG9I{N]Z8.jpg
     
    Flurgle and OCASM like this.
  28. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
  29. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,374
    The only downside of screen space effect, you can't render what you can't see
     
  30. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    Look carefully. Screen space reflection only reflects what can be seen. The bottom surface can be reflected because the bottom is in the visible range.
     
  31. skyecrack

    skyecrack

    Joined:
    Jan 5, 2018
    Posts:
    29
    Assets/StochasticScreenSpaceReflection/Script/StochasticScreenSpaceReflection.cs(270,49): error CS0029: Cannot implicitly convert type `UnityEngine.RenderBuffer' to `UnityEngine.Rendering.RenderTargetIdentifier'

    @FlashBull Help
     
  32. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    Your version?
     
  33. skyecrack

    skyecrack

    Joined:
    Jan 5, 2018
    Posts:
    29
    5.6.2f1
    Charkes' version works perfectly.
     
  34. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    I will charke this version, maybe can run. I do this effects in 2018 version.
     
  35. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I checked github and seems old version.
    It is updated Jun 21. Is it possible to test latest? I would like to test run on XboxOne as the OP's solution does not work on the console.
     
    CG_Bull likes this.
  36. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    What is OP's? This is new : https://github.com/haolange/Unity-Screen-Space-Reflection
     
  37. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    And this SSR need coordinate PsotProcessV2 TAA.To get good results.
     
  38. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Thank you for the update I will test as soon as I can. OP means original poster/post. I tested your older version of you and did not work on xbox. I will report latest version.
     
  39. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    Are you xbox/ps4 game developer? I'm not sure if this SSR can run on the game console.
     
  40. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Yes. Xbox dev. In the past. Unity 4.x there was a plugin that made SSR almost for free. The stack v2 SSR is incredibly resource demanding and the output is very poor. The original SSR solution in this post provides very awesome SSR at acceptable cost on PC. Not sure what this technique uses thst is not available in console. In the Xbox condole I see no exceptions. ( Ive not yet tested your latest version)
     
  41. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    OK, good bad news is that is seems to be working!:
    The downside is that FPS of this scene is 20 FPS XD.
    For some reason the eight core is totally collapsed while others are not working that much, can´t remember at this point what does this one do. I wonder if I use TAA in the original SSR on this thread it would work. With this performance hit, the SSR in the Stack V2 performs better, like around 60FPS for a 2 cube scene. That on the Xbox. On desktop the things differ, the stocastic SSR looked amazing while Stack V2 didnt.
    I will simply not have option for SSR in console, no bit issue.
     

    Attached Files:

    Last edited: Sep 7, 2018
  42. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    You mean is FPS to low? Is there only one operation in the eight core? It may be necessary to do some half resolution optimization to run on Xbox.By the way, I am still improving, and will continue to improve performance and ghost and denoise.
     
    TooManySugar likes this.
  43. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Yes FPS too low, like 20 FPS for the displayed scene. I think it was already set to half res. I'll chedk SDK docs to see what goes on in eight core, not sure if I can unveil much without breaking non disclosure papers I signed tho.
     
  44. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    You can turn off TraceBehind and set StepSize to 20 and CullBackFace to open. See how much FPS can be raised.
     
    TooManySugar likes this.
  45. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    TX>> I will report ressults>>
     
  46. sendspace

    sendspace

    Joined:
    Jul 24, 2016
    Posts:
    26
    HDRP support please ;)
     
  47. rizu

    rizu

    Joined:
    Oct 8, 2013
    Posts:
    1,176
    but HDRP has pretty nice SSR built by default already? It's miles ahead of what they had on PP stacks (and it also runs when using forward renderer too).
     
  48. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,374
    The current SSR only support glossy SSR isn't?
     
    CG_Bull likes this.
  49. CG_Bull

    CG_Bull

    Joined:
    Feb 12, 2017
    Posts:
    67
    Only Low RoughSurface。
     
  50. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Using OP's solution. I wrote to him but did not answer back in the days and seems not to visit this forum anymore.
     

    Attached Files:

    MarkusGod and Adam-Bailey like this.