Skip to main content

sh3_sample_by_direction

sh3_sample_by_direction(result, result_offset, harmonics, harmonics_offset, dimension_count, direction, direction_offset)

Sample value from a 3-band spherical harmonic defined by 9 coefficients

Kind: global function
See

ParamTypeDescription
resultArray.<number>Result will be written here
result_offsetnumber
harmonicsArray.<number>coefficients are read from here
harmonics_offsetnumberoffset into coefficients array where to start reading the data
dimension_countnumbernumber of encoded dimensions, this is essentially a shortcut for multiple harmonics being read at the same time, such as with RGB values
directionArray.<number>3d vector read from here, we will read 3 values from here to sample spherical harmonic, direction is assumed to be normalized
direction_offsetnumberoffset into direction array