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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

How to create Ambient Probe data?

Discussion in 'Global Illumination' started by bitinn, Apr 21, 2020.

  1. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    958
    This might sound like a strange question, but for some reasons I would like to swap the RenderSettings.ambientProbe data with a custom one. (Because we are not using lights-map or baked GI, I believe they are past as spherical harmonics to shader, and then use in combination with Reflection probe in PBR shading.)

    The problem is, I believe ambient probe contains diffuse data from skybox: but I really don't get how SphericalHarmonicsL2 class allow us to generate such data?

    So say I have 2 skybox each will obviously create its own ambient probe data, how can I swap them?

    (This is obviously a different question from swapping light maps, because you only sample ambient probe when both lights-map and custom light probes are missing.)

    Thx in advance!
     
  2. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    958
    Wait, I was silly to have overlooked the AddAmbientLight method, I don't know how Unity devise the color from skybox but at least I can approximate ambient color now, that's good for now.
     
    kristijonas_unity likes this.
  3. ahumanbeing

    ahumanbeing

    Joined:
    Dec 5, 2016
    Posts:
    15
    How did you resolve this? I'd like to change the ambient light only for specific indoor environment area. I am not a good programmer