Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Screen Space Reflections (SSR) for Unity by Plawius

Discussion in 'Assets and Asset Store' started by Plawius, Mar 3, 2014.

  1. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    41
    Please replace

    #if UNITY_5_0

    to

    #if UNITY_5_1

    in SSREffect.cs

    and it would work. Unfortunately UNITY_5_0 is not defined in Unity 5.1
     
  2. Morfeuskiev

    Morfeuskiev

    Joined:
    Oct 10, 2013
    Posts:
    122
    @Plawius

    Hi. I Try SSR. Works good. But have one question. When i select in standard shader Rendering mode Opaque - it works. When i select Cutout - it works. But when i select - Transparent or Fade - it not works - Why? I want use in my water shader who use Opacity (Fade or Transparent) (Not opacity clip (Cutout)).
     
  3. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    41
    Finally new version was just submitted!
    There are lots of bugfixes and improvements:
    - fixed blur shift
    - smoothness now works as it should
    - fade and fresnel reworked

    If you want it faster - please just email us with your invoice number and we will send it to you!

    Now working on layer-exclusion logic!
    Maybe you need something more? Feel free to tell us!

    @Morfeuskiev

    Unfortunately, transparent/fade objects are not saving their depth information to the Depth texture. Any SSR solution just cannot handle transparent objects properly by design.
    But in case of water we can handle that - I guess we can help - please contact us via email
     
    KRGraphics and DennG like this.
  4. DennG

    DennG

    Joined:
    Dec 5, 2013
    Posts:
    158
    @Plawius
    Thanks for the new update!
    In the Asset Store description you're mentioning the following thing: "Reflections can be adjusted on per material basis."
    How can I do this?
     
  5. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    159
    On Unity standard PBR shader, you adjust smoothness to adjust reflection. That enables you to adjust reflection for each material differently.
     
  6. DennG

    DennG

    Joined:
    Dec 5, 2013
    Posts:
    158
    Oh... okay I knew that, but I've thought there is additional control somewhere.
     
  7. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    41
  8. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,016
    Interesting SSR, and something I will need... will this work with Alloy?
     
  9. DennG

    DennG

    Joined:
    Dec 5, 2013
    Posts:
    158
  10. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    159
    This was my question before I bought Plawius SSR.
    It works with almost every kind of shader except transparent ones.
    Also, great support here. They did not tell about v1.6 in the forum, but it works better and has new options set (which I needed but when I asked them about it, they already implemented, I just didn't know there was v1.6)
     
  11. CurtisMcGill

    CurtisMcGill

    Joined:
    Aug 7, 2012
    Posts:
    67
    Looks awesome, does it work with mobiles?
     
  12. ptblk

    ptblk

    Joined:
    Mar 27, 2015
    Posts:
    57
    I pull the script onto my camera, but it doesnt create settings?
     
  13. ptblk

    ptblk

    Joined:
    Mar 27, 2015
    Posts:
    57
    Tried a different scene, fixed the issue not sure why. But have another problem now. If I set the build to Pc, it works fine, but if I set it to android with SSR enabled, it inverts the whole camera. ie my scene is upside down. Un-ticking SSR script fixes the issue, so the problem def lies there
     
  14. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    427
    I wonder if this SSR may be compatible with mobile for iOS, at least on latest hardware tablets.

    I have a 3D city that I want to have the road reflect the buildings and objects that are near

    Thanks for your help

    Best regards
     
  15. Ramon_Nae

    Ramon_Nae

    Joined:
    Jun 1, 2015
    Posts:
    15
    Anyone it's having performance problems? The demo scene included it's running at 20 fps!!! and when I add the "SSR Effect" to my regular scene (in my videogame) the fps rate drops from 65/70 fps to 15/20 fps... I'm using Unity 5.1.1p2. :(

    Furthermore, reading the instructions I suppose that when I add the component SSR Effect to my Main Camera a new GameObject called SSR_Settings must be created in my Scene... but this is not happening.

    I believe something it's broken or I'am doing something wrong... but a performance cost about 60 / 70 % isn't normal right?
     
  16. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    41
    We have "PC/Mac/Linux" as platforms. Unfortunately SSR is too heavy for mobiles. Something like 2 fps on iPad Air.
    And yes - just add script on the camera, and SSR_Settings will appear in the root of hierarchy (to support several cameras).

    1) What platform and hardware do you use?
    2) Any errors in the console? (because if there is no SSR_Settings - something went wrong)
     
  17. Ramon_Nae

    Ramon_Nae

    Joined:
    Jun 1, 2015
    Posts:
    15
    Well, i'm using an i7 quad core (3.6Ghz) with 16GB RAM and a Geforce 750GTX and we're aiming to Xbox One and PS4 too.
    I've just realized that the SSR_Settings it's on the scene but it has been created after entering "play mode" (clicking play) so I think this is working fine now. Sorry, was my fault! :(

    But the other issue, the performance drops. I've attacched two screens of the game with stats panel activated. One with SSR and one without. The batches are almost the same but the CPU main it's a lot higher. In fact, almost all my processor power drains with the effect activated and in play mode. ¿Any ideas?

    Aparently there are no errors in the console, so... i don't know.

    Actually I only want reflections on the ground of the scenarios so... ¿there's a way to exclude all the other geometry to not receive reflections? Maybe with something like this we can get some more frames... :)
     

    Attached Files:

  18. ptblk

    ptblk

    Joined:
    Mar 27, 2015
    Posts:
    57
    That doesnt solve my problem, i woul d still like the whole scene not to be flipped for android. this needs to be fixed. Secondly NO where did you mention anything about non-mobile. not very happy after paying $40 for this
     
  19. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    41
    SSR is GPU effect, nothing to deal with CPU, actually. Can you take a look at the Profiler (with deep analysis enabled)?

    You know, you just would ask a refund instead of writing misleading one-star reviews.
    "PC/Mac/Linux" is "non-mobile", obviously.
     
    Last edited: Jul 20, 2015
    theANMATOR2b and hippocoder like this.
  20. Ramon_Nae

    Ramon_Nae

    Joined:
    Jun 1, 2015
    Posts:
    15
    Plawius, maybe we can just continue talking at e-mail support? :)
    Thanks for the help of course!

    I'm gonna send you and e-mail now!
     
  21. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    41
    Hey! Take a look at this review:

    Thanks a lot, John!
     
    chelnok, Ghosthowl and overthere like this.
  22. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    41
    PROTIP: If you use ShaderForge, make sure that your custom shaderforge shader uses Deferred rendering path! :)
     
  23. PizzaGuy213

    PizzaGuy213

    Joined:
    Nov 23, 2010
    Posts:
    305
    It looks brilliant, just what I needed! PC / Mac / Linux desktop builds only though, or also Webplayer & WebGL?
     
  24. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Could you explain how this is different than Candela's SSR? Pros/Cons?
     
  25. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    414
    I'd like to know this as well, considering both are on sale and unity will eventually release its own solution, whats the difference between the two?

    It's hard to tell from the screenshots since some results are hard to believe to be SSR alone.
     
  26. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    288
    I would Also like to know this... I have Candela V2 and I'm not so happy with it... and I'm considering taking a look at this.

    and also if some comparison with Unity's SSR could be made, that would be awesome.
     
  27. TanselAltinel

    TanselAltinel

    Joined:
    Jan 7, 2015
    Posts:
    159
    Ugh, you understand Unity only started to look into matter, let alone releasing a working build with it, right? Don't expect a comparison between anything and Unity's SSR before November.

    I personally used Candela V1 and Plawius SSR. Candela was excellent in Unity 4.x but a performance monster, it took 20 FPS out of my game. I did not test it for Unity 5, and since I have Plawius I don't think I'll test it any time soon.
    Plawius on the other hand, is very light but does not deliver a mirror-like reflection if that's you are looking for. You can see it in videos and screens.

    At the end of the day, I switched to Reflection Probes and use SSR optionally to make things more beautiful.
     
    hopeful likes this.
  28. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    288
     
  29. Hexaedre

    Hexaedre

    Joined:
    Jan 23, 2015
    Posts:
    110
    Hi,

    Apparently the reflection control don't work with specular/metallic textures, it works only when you dont use texture and use the smoothness slider. Is that normal or is it me doing something wrong ? If it's not me, do you plan to add texture support for reflection control ?

    Adding a slider or something acting as a factor to control the overall intensity of the effect independently from the material would be nice.
    A script to add to the objects we dont want SSR on, without marking them as transparent, would be nice too.

    Sorry for my bad english.
     
  30. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,343
    Yet another amazing effect that requires some project settings changes that ruins other visual aspects of the game, ie deferred lighting removes the fog, which wont work for me, is it possible to use this in a scene of its own or does it require the entire project settings to be changed?
     
  31. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    I have the same problem with frame rate dropping to less than a third when SSR is enabled. Only four draw calls more, but those four calls seem to take a very, very long time.

    Deferred, HDR Linear. No other effect on the camera. No errors in the console.
    Mac OS X Yosemite, Unity 5.2p1 Pro.
     
    Last edited: Sep 23, 2015
  32. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    We are considering this SSR solution right now but want to make sure it isn't too heavy on the resources. I wanted to add to the discussion that we too used Candela (2.1 with Unity 5) and it was a performance HOG for us as well (outdoor procedural environment, was killing a good 30+ fps). Candela was causing all sorts of horrible flickering on the terrain as well with texture maps from all kinds of places and formats. In the end, due to bad performance and NO support we ditched it. I am concerned about Plawius performing well in an outdoor environment but have no way to test first. Anyone else using this asset in large outdoor environments?
     
    hopeful likes this.
  33. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    I am. I wouldn't recommend Plawius' SSR solution.
     
  34. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    I'll never understand asset developers that make stuff and then aren't responsive on the forums for months at a time, LOL. I can log-in from my phone while on the toilet and spend 5 minutes to check all the forums and messages. :/
     
    theANMATOR2b and PeterB like this.
  35. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    41
    To make SSR work with other effects try to change in SSREffect.cs Line 68:
    GetComponent<Camera>().depthTextureMode = DepthTextureMode.Depth;
    to
    GetComponent<Camera>().depthTextureMode |= DepthTextureMode.Depth;

    What do you want to hear about comparison of different solutions? If you have perf drop on our SSR, you will see that same or more on others (since we're really lightweight in comparison to any other solution, including Candela).

    All SSR solutions are depth buffer sensitive and cannot work with transparent objects. So outdoor environment is not a good use case for any SSR.
     
    Tethys likes this.
  36. VisualTech48

    VisualTech48

    Joined:
    Aug 23, 2013
    Posts:
    247
    I'm having UI Issues. My pointer, which is an UI image is also reflected with the SSR
     
  37. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    I see. It's wouldn't be for water, players in our game can construct buildings and other things. and some of the PBR materials we use are pretty glossy(marble tile or glossy wood floors, metal materials etc...), and we have shiney metallic weapons as well, so our thoughts were to get SSR on these items, rather than huge transparent objects in the environment like water.
     
  38. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,016
    I have been weighing the pros and cons of SSR and while I like it... I wish there was a mode that just set everything is static if nothing is moving... and just use reflection probes where needed.
     
  39. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    27,825
    Ouch, just read this thread. To people having a moan about things, this is game dev. An effect like SSR is an approximation, and thus something has to give.

    People expecting things to just plug in and work AND have performance are way too demanding. AAA would laugh at such a thing. It does not exist. I feel sorry for the author having a bit of unfair flack for that just because beginner-level developers can't understand or accept that. When you get to high end effects, you have to expect to change the project and do not expect it to run on a tiny mobile phone. After all, you can't ram a next gen console in your pocket can you?
     
    theANMATOR2b likes this.
  40. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,016
    I am already aware how heavy it is... just takes getting used to... thankfully I am not focusing on Mobile at all so this is not an issue... just have to use SSR responsibly and where needed... not even I would use SSR on an entire environment, especially if the game is fast
     
    Tethys likes this.
  41. VisualTech48

    VisualTech48

    Joined:
    Aug 23, 2013
    Posts:
    247
    I'm aware of the cost of SSR however what I don't see is why UI should be reflected at all.
     
  42. JD_Designer

    JD_Designer

    Joined:
    Sep 1, 2015
    Posts:
    101
    Hello,
    Does SSR work with legacy shaders such as "Legacy Shaders/Reflective/Specular?" Thanks much!
     
  43. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    I'm in no way a "beginner-level developer", thank you very much. The problem here isn't low performance or unrealistic expectations – it's that this SSR solution is marketed as "requiring only 2-3 extra draw calls", whilst ignoring the fact that those extra calls take longer than all other draw calls and thus is misleading in the extreme.
     
  44. Aieth

    Aieth

    Joined:
    Apr 13, 2013
    Posts:
    805
    There is nothing misleading about it only requiring a few extra draw calls. It is basically insurance that it doesn't re render your scene. All a draw call means is telling the GPU "now do this". This can mean anything from "just copy this pixel" to "calculate the 1000th decimal of pi per pixel". And SSR is closer to 1000th decimal of pi than it is to pixel copying in terms of computational complexity.
     
    gameDevi and hippocoder like this.
  45. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    27,825
    Uh not misleading to a non beginner in the graphics field. Sorry. No offence was intended. Don't worry about it.

    Draw calls are hardly the only reason framerate dies. But then, you knew that, obviously.
     
  46. 265lutab

    265lutab

    Joined:
    Sep 15, 2014
    Posts:
    150
    I'm getting some odd artifacts. What do I need to do to fix these. Is it something in the SSR settings or something about how my scene is set up.
    Screenshot 2016-08-03 12.17.05.jpg Screenshot 2016-08-03 12.14.45.jpg Screenshot 2016-08-03 12.15.46 copy.jpg Screenshot 2016-08-03 12.15.51.jpg
     
  47. Plawius

    Plawius

    Joined:
    Feb 27, 2014
    Posts:
    41
    We already discussed that in email, updating here to help others:

    so, if you're facing this bug, please replace in the shaders

    float screendedgefact = saturate(distance(screen_current_position.xy , float2(0.5, 0.5)) * 2.0);
    screendedgefact = 1.0 - screendedgefact * screendedgefact;


    with

    float dist_center = distance(screen_start_pos.xy , float2(0.5, 0.5));
    float screendedgefact = saturate(dist_center) * 2.0;
    screendedgefact = 1.0 - screendedgefact * screendedgefact;


    thanks!
     
  48. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    911
    Hi there!

    Today this asset is on sale, but the last update dates back to almost 2 years ago.

    May I expect it to work flawlessly with current versions of Unity? Have all the issues been solved?
     
  49. jura_wd

    jura_wd

    Joined:
    Jan 28, 2014
    Posts:
    30
    Hey! Yes, it's stable and fastest SSR even now. The only one issue is VR.. Unfortunately current Unity implementation is just broken even for their own post effects, so we're waiting for them. And then we will update our SSR, it's time to do that, I agree :)
     
    NeatWolf and Tethys like this.
  50. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    911
    Do you have any eta on this? A month? 2 months?
    I'm coming from Livenda SSRR, I've been traumatized :D
     
unityunity