Back to Filament

radiance

docs/android/dokka/filament-android/com.google.android.filament/-indirect-light/-builder/radiance.md

1.75.01.5 KB
Original Source

//filament-android/com.google.android.filament/IndirectLight/Builder/radiance

radiance

[main]
open fun radiance(bands: Int, sh: Array<Float>): IndirectLight.Builder

Sets the irradiance from the radiance expressed as Spherical Harmonics.

The radiance must be specified as Spherical Harmonics coefficients Ll,m, where each coefficient is comprised of three floats for red, green and blue components, respectively

The index in the sh array is given by: index(l, m) = 3 × (l * (l + 1) + m)``sh[index(l,m) + 0] = LRl,m``sh[index(l,m) + 1] = LGl,m``sh[index(l,m) + 2] = LBl,m

Return

This Builder, for chaining calls.

Parameters

main

bandsNumber of spherical harmonics bands. Must be 1, 2 or 3.
shArray containing the spherical harmonics coefficients. The size of the array must be 3 × bands2(i.e. 1, 4 or 9 float3 coefficients respectively).

Throws

ArrayIndexOutOfBoundsExceptionif the sh array length is smaller than 3 × bands2