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. Dismiss Notice

Question AR Foundation 5 - Light Estimation - Do I need Directional Light?

Discussion in 'AR' started by newguy123, Jan 13, 2023.

  1. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,234
    When using ALL Light Estimation, do I need the Directional Light or that will just be another light on top of the light estimation?
     
  2. davidmo_unity

    davidmo_unity

    Unity Technologies

    Joined:
    Jun 18, 2019
    Posts:
    99
    You don't need it but the digital light may not look correct as you move the device around. Light estimation is supposed to be applied to a virtual light, including the direction so virtual content can look as if it's being lit be a real world light source.
     
  3. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,234
    I think I may not have been clear in my question @davidmo_unity
    I meant, do light estimation add its own light into the scene, or does it merely adjust the properties of my existing single directional light?

    IE, if I delete the directional light, will light estimation fail to work, or in ALL cases, light estimation adds its own lights into the scene regardless if I have a directional light in the scene or not?
     
  4. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,234
    I'm asking, since the light estimation doesnt appear to work. I have the default directional light in the scene, with it set to realtime

    I'm indoors, and there's very soft indoor lighting, ie soft shadows. However my directional light seems fixed horizontally like I set it, with hard shadows.

    upload_2023-1-17_14-36-42.png

    upload_2023-1-17_14-37-34.png
     
  5. davidmo_unity

    davidmo_unity

    Unity Technologies

    Joined:
    Jun 18, 2019
    Posts:
    99
    My mistake. You do need a directional light and you need to apply the light estimation to that light as we can't make executive decisions on which light to manipulate in your project.
     
  6. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,234
    How do you mean @davidmo_unity ? How do I APPLY it to the only directional light in my scene?
    I thought all I need to do is to choose a setting for Light Estimation in the AR Camera Manager Script, which is what I've done. Is there more to it?

    From the docs: https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@5.0/manual/features/camera.html
    That 1st table on that page makes me believe all I have to do is choose one of the options. In my case I chose the Everything option.

    Your reply seems to suggest I then need to somehow apply this chosen setting to the light.
     
  7. davidmo_unity

    davidmo_unity

    Unity Technologies

    Joined:
    Jun 18, 2019
    Posts:
    99
    newguy123 likes this.
  8. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,234
    Ah yes, I was using this as a template actually but missed the script attached to the directional light.

    Thanks