/*--------------------*/
#define PI    radians(180.0)
#define PI_HALF    radians(180.0)*0.5
#define ROOT_PI 1.772453851
#define HPI   (PI * 0.5)
#define TAU   (PI * 2.0)
#define RCPPI (1.0 / PI)
#define PHI   sqrt(5.0) * 0.5 + 0.5
#define GOLDEN_ANGLE (TAU / PHI / PHI)
#define LOG2 log(2.0)
#define RCPLOG2 (1.0 / LOG2)
#define GOLDEN_RATIO 1.61803398875
#define PLASTIC_CONSTANT 1.32471795724
#define ROOT_TWO 1.41421356237
#define ROOT_THREE 1.73205080757
#define ROOT_FIVE 2.236067977
const vec4 torroidalShift = vec4(GOLDEN_RATIO, PLASTIC_CONSTANT, ROOT_TWO, ROOT_THREE);


#define lumaCoeff       vec3(0.2125, 0.7154, 0.0721)
#define RGB_Wavelengths vec3(750.0, 570.0, 495.0)

#define air_IOR   1.0002
#define water_IOR 1.3333
#define BK7_IOR   1.5176
#define IORtoF0(IOR) pow2(abs((1.0 - IOR) / (1.0 + IOR)))

#define waterAbsorbCoeff     vec3(0.996078, 0.406863, 0.25098) * 0.125 / LOG2
#define waterScatterCoeff    vec3(0.01) / LOG2

#define mieScatteringAngle   0.86

#define SUN_NEE_PDF 14880.05108