getColorEstimate
fun getColorEstimate(sh: FloatArray, x: Float, y: Float, z: Float, out: FloatArray? = null): FloatArray
Helper to estimate the color and relative intensity of the environment represented by spherical harmonics in a given direction.
This can be used to set the color and intensity of a directional light. In this case make sure to multiply the returned intensity by the intensity of this indirect light.
Return
A vector of 4 floats: first 3 components are the linear color, 4th is the intensity
Parameters
sh
3-band spherical harmonics coefficients (must be 9 float3 values, or 27 floats if flattened)
x
Direction X component (should form a unit vector with y and z)
y
Direction Y component (should form a unit vector with x and z)
z
Direction Z component (should form a unit vector with x and y)
out
Optional FloatArray for result; created if null