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.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Bent normals confusion

Discussion in 'Graphics Experimental Previews' started by EricFFG, Apr 23, 2022.

  1. EricFFG

    EricFFG

    Joined:
    May 10, 2021
    Posts:
    85
    TLDR: Does unity create me a bent normal automatically if I have a normal and an AO map?

    Ive been reading this thread about specular occlusion https://forum.unity.com/threads/specular-occlusion.963929/

    But now im noticing that if I just turn on Specular Occlusion from AO and Bent normal in the shader,
    I am getting a bent normal generated somehow from unity and it works as if I had added a baked bent normal

    I cant find anything about that


    From AO:
    FromAO.png

    From Bent and AO:
    Clearly a big improvement here and I dont have a bent normal texture
    BentAndAO.png

    Is this really how it works?

    Btw Custom ones can also work well:

    Custom.png

    Based on light direction
    upload_2022-4-23_1-15-0.png

    Anyone seeing this, really turn on the setting for AO and Bent normal
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    upload_2022-4-23_16-55-33.png

    Which mode are you using for without the maps? Perhaps it's a UI thing...
     
  3. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    25
    On a shadergrah, if no bent normal is provided the normal is used instead.
    Then it uses a different algorithm than the "From AO" option, which may result in a better result if the mesh normal is pointing somewhat towards the light (ie. if it's close to the bent normal)
     
  4. EricFFG

    EricFFG

    Joined:
    May 10, 2021
    Posts:
    85
    Ah I see, thats a good deed

    Id definitely recommend for people to use that when having baked normal meshes
    This should be in the documentation however
     
  5. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    25
    Yes and actually it's weird that this behavior isn't consistent with our Lit shader. I'll make a note to add that in the documentation and unify the behaviors. Thanks for reporting it !