docs/android/dokka/filament-android/com.google.android.filament/-indirect-light/get-direction-estimate.md
//filament-android/com.google.android.filament/IndirectLight/getDirectionEstimate
[main]
open fun getDirectionEstimate(sh: Array<Float>, direction: Array<Float>): Array<Float>
Helper to estimate the direction of the dominant light in the environment.
This assumes that there is only a single dominant light (such as the sun in outdoors environments), if it's not the case the direction returned will be an average of the various lights based on their intensity.
If there are no clear dominant light, as is often the case with low dynamic range (LDR) environments, this method may return a wrong or unexpected direction.
The dominant light direction can be used to set a directional light's direction, for instance to produce shadows that match the environment.
the direction paramter if it was provided, or a newly allocated float array containing a unit vector representing the direction of the dominant light
main
| sh | pre-scaled 3-bands spherical harmonics |
| direction | an array of 3 floats to receive a unit vector representing the direction of the dominant light or null |
| LightManager.Builder |
| getColorEstimate |
[main]
open fun getDirectionEstimate(direction: Array<Float>): Array<Float>