sky_hosek_compute_irradiance_by_direction
Classes
Members
- mRadXYZ[0] :
Float32Array
Overall average radiance Vec3f
Functions
- EvalQuintic_2(w, data, data_offset) ⇒
number
- EvalQuintic_3(w, data, data_offset, coeffs, coeffs_offset)
- FindQuinticWeights(s, w)
- ZenithLuminance(thetaS, T) ⇒
number
- sky_hosek_precompute(mCoeffsXYZ, mRadXYZ, sun_direction, turbidity, rgbAlbedo, overcast)
- sky_hosek_compute_irradiance_by_direction(out, mCoeffsXYZ, mRadXYZ, mToSun, direction_x, direction_y, direction_z)
FindHosekCoeffs
Kind: global class
new FindHosekCoeffs(dataset9, datasetR, turbidity, albedo, solarElevation, coeffs, coeffs_offset)
Param | Type | Description |
---|---|---|
dataset9 | Array.<number> | Float32Array | albedo x 2, turbidity x 10, quintics x 6, weights x 9 |
datasetR | Array.<number> | Float32Array | albedo x 2, turbidity x 10, quintics x 6 |
turbidity | number | |
albedo | number | |
solarElevation | number | |
coeffs | Array.<number> | Float32Array | result is written here |
coeffs_offset | number |
EvalHosekCoeffs
Kind: global class
new EvalHosekCoeffs(coeffs, coeffs_offset, cosTheta, gamma, cosGamma)
Hosek: (1 + A e ^ (B / cos(t))) (1 + C e ^ (D g) + E cos(g) ^ 2 + F mieM(g, G) + H cos(t)^1/2 + (I - 1))
These bits are the same as Preetham, but do different jobs in some cases A: sky gradient, carries white -> blue gradient B: sky tightness C: sun, carries most of sun-centred blue term D: sun tightness, higher = tighter E: rosy hue around sun
Hosek-specific: F: mie term, does most of the heavy lifting for sunset glow G: mie tuning H: zenith gradient I: constant term balanced with H
Notes: A/B still carries some of the "blue" base of sky, but much comes from C/D C/E minimal effect in sunset situations, carry bulk of sun halo in sun-overhead F/G sunset glow, but also takes sun halo from yellowish to white overhead
Param | Type |
---|---|
coeffs | Array.<number> | Float32Array |
coeffs_offset | number |
cosTheta | number |
gamma | number |
cosGamma | number |
mRadXYZ[0] : Float32Array
Overall average radiance Vec3f
Kind: global variable
EvalQuintic_2(w, data, data_offset) ⇒ number
Kind: global function
Param | Type | Description |
---|---|---|
w | Array.<number> | Float32Array | float[6] |
data | Array.<number> | Float32Array | float[6] |
data_offset | number |
EvalQuintic_3(w, data, data_offset, coeffs, coeffs_offset)
Kind: global function
Param | Type | Description |
---|---|---|
w | Array.<number> | Float32Array | float[6] |
data | Array.<number> | Float32Array | float[6][9] flattened |
data_offset | number | |
coeffs | Array.<number> | Float32Array | float[9] output is written here |
coeffs_offset | number |
FindQuinticWeights(s, w)
Kind: global function
Param | Type |
---|---|
s | number |
w | Array.<number> | ArrayLike.<number> | Float32Array |
ZenithLuminance(thetaS, T) ⇒ number
Kind: global function
Param | Type |
---|---|
thetaS | number |
T | number |
sky_hosek_precompute(mCoeffsXYZ, mRadXYZ, sun_direction, turbidity, rgbAlbedo, overcast)
Kind: global function
See: https://github.com/andrewwillmott/sun-sky/blob/master/SunSky.cpp
Param | Type | Description |
---|---|---|
mCoeffsXYZ | Array.<number> | output, float[3][9], Hosek 9-term distribution coefficients |
mRadXYZ | Array.<number> | output, vec3, Overall average radiance |
sun_direction | vec3 | |
turbidity | number | should be between 1 and 10 |
rgbAlbedo | vec3 | albedo in linear color space (make sure it's not sRGB) |
overcast | number |
sky_hosek_compute_irradiance_by_direction(out, mCoeffsXYZ, mRadXYZ, mToSun, direction_x, direction_y, direction_z)
Kind: global function
Param | Type | Description |
---|---|---|
out | Array.<number> | Float32Array | vec3 in RGB color space |
mCoeffsXYZ | Array.<number> | Float32Array | float[3][9] |
mRadXYZ | Array.<number> | Float32Array | vec3 |
mToSun | Array.<number> | Float32Array | vec3 |
direction_x | number | |
direction_y | number | |
direction_z | number |