Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Resolved Problems applying values greater than 0.8 in the smoothness property in the unity material

Discussion in 'High Definition Render Pipeline' started by FernandoMK, Sep 9, 2020.

  1. FernandoMK

    FernandoMK

    Joined:
    Feb 21, 2017
    Posts:
    174
    Hello

    Today I was testing some material appearances for my next project that I am creating, however, by changing the appearance of certain materials, I realized that the material's smoothness property left a trail of black lines around the object's surface

    I'm not sure why this happens, this is a new and empty project, so it doesn't make sense to be like this


    upload_2020-9-9_17-38-48.png

    As you can see, this only affects materials with properties 0.9 and 1 in the smoothness factor

    upload_2020-9-9_17-46-29.png


    I'm using the 2021.1.2f unit
    HDRP 8.2.0
     
  2. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    645
    The "trails" you are seeing is a result of screen space reflection.
    By default SSR is only visible on objects with smoothness > 0.9, and as the algorithm is raymarching in the depth starting from the pixel of your object, depending on the settings/angle/distance, it result in a correct hit or not, hence the "trails".
    You can tweak the SSR with a volume component in your scene, or disable it totally and use regular reflection probes.
     
    FernandoMK likes this.
  3. FernandoMK

    FernandoMK

    Joined:
    Feb 21, 2017
    Posts:
    174
    This is new to me, cool that we can adjust this directly by the volume setting

    I just have to find an ideal quality / performance setting... :p

    upload_2020-9-9_18-49-36.png

    Thank you:)
     
  4. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,245
    The spheres look more correct in this image, but the cubes seem wrong, ie no shadows on the cube itself closest to the cam.....Why is that?
     
  5. Tartiflette

    Tartiflette

    Joined:
    Apr 10, 2015
    Posts:
    84
    Probably because the material is metallic (i.e. entirely reflective) which means shadows wouldn't make sense.
     
  6. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,245
    yeah but then you would see the ground shadows the cubes cast in the reflection. Like it is now, its more like a self illuminated object
     
  7. FernandoMK

    FernandoMK

    Joined:
    Feb 21, 2017
    Posts:
    174
    I managed to make the shadows show, but he comes back with the tracks again. it has to be a very precise configuration so that it doesn't happen (Depending on the configuration, this happens with the shadows seen in the reflection, or with the direct light on the surface also reflected on the object)...o_O

    I realized that this is better used for certain occasions than the reflection probe, so in certain places in the scenario, you would use the reflection probe, and for others you would activate this box volume option for example to have a better look of reflections...

    I’m still testing some things, but I'll include that in my test map to have a comparison based on their differences, Then I put it here for download for those who want to take a look;)
     
    newguy123 likes this.
  8. FernandoMK

    FernandoMK

    Joined:
    Feb 21, 2017
    Posts:
    174
    After a few days of testing, I definitely enjoyed this way of working with him.

    but finding the quality balance is very, very complicated. In my tests here, I had to put a value of 4048 to make those black lines disappear completely ... not to mention that it still has some flaws if the object is out of sight .... so it's not interesting for all cases.

    (Reflection-Probe)
    upload_2020-9-14_19-43-42.png

    (Space Reflection = ON)
    upload_2020-9-14_19-44-54.png


    I also discovered how to make shadows appear in the reflection:)

    As you can see, his reflection is much more accurate than the reflect probe, in addition to being much sharper too, which helps a lot


    But I kind of broke it again, lol. :p

    upload_2020-9-14_19-46-16.png


    It can't be used as a mirror:rolleyes: (would it be a bug?)

    I haven't been able to test yet if it's heavier than the real-time reflection probe, but it seems to be lighter.:D
     
  9. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    645
    I'm not really sure of what I'm seeing on this last screenshot.
    Are you trying to use screen space reflection on a plane to act like a mirror that displays all this row of cubes/spheres ?

    This will not work. As the name states "Screen Space Reflection", it will only reflect what is visible on screen. Meaning that you can't see anything that is not already rendered on screen (back faces of the cubes and spheres).

    You might want to look at the planar reflection probe for this kind of effect ?
    https://docs.unity3d.com/Packages/c...ition@7.5/manual/Planar-Reflection-Probe.html
     
    FernandoMK likes this.
  10. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,152
    I had the same issues with testing reflection in HDRP (including bad looking SSR streaks).

    SSR is not really a good technique for that kind of reflection (or maybe most reflections!) as is very limited by it only reflecting what is on-screen. I think it is best used for patchy or rough floor reflections

    On the other hand Reflection probes are problematic as things like no shadows and you need a lot of them across the scene to accurately reflect the right parts.

    Ray-traced reflections will be the solution I hope (not got gfx card for them yet)
    Not sure if there are learning docs on HDRP reflections but could use a resource to point these limitations out
     
    FernandoMK likes this.
  11. FernandoMK

    FernandoMK

    Joined:
    Feb 21, 2017
    Posts:
    174
    Yes, that is exactly what I tried to do.:rolleyes:

    But now I understand why it is so light, it does not take into account what is being seen behind the objects. But I just wanted to know if it worked. (does not work:))

    Exactly, the SSR can be used in cases that only take what we see on the screen. like reflections on the floor or things like that. Still, it is much lighter than ray tracing, so in terms of optimization, you can include this for low cost hardware, while raytracing is at the highest level ...
    As you can see, in some cases it is much better than the Reflect probe, so just doing a test to see in which situations one is better than the other.;)
     
    Last edited: Sep 16, 2020
    andyz likes this.