Thanks, i have got it. It’s very kind of you to help me. ]]>

float computeEV100FromAvgLuminance ( float avgLuminance )

{

// We later use the middle gray at 12.7% in order to have

// a middle gray at 18% with a sqrt (2) room for specular highlights

// But here we deal with the spot meter measuring the middle gray

// which is fixed at 12.5 for matching standard camera

// constructor settings (i.e. calibration constant K = 12.5)

// Reference : http :// en. wikipedia . org / wiki / Film_speed

return log2 ( avgLuminance * 100.0 f / 12.5 f);

}

you are right, thank you for reporting this typo, it should have been:

EV100 = log2(N^2 / t) – log2(S / 100) instead.

i.e EV100 = log2(N^2*100/(t*S)) as you said.

Will try to see if I can update the doc.

getSample is a GPU random number generator,

It is implemented to generate a stochastic samples to reduce the number of samples required to get good result.

A typical implementation will use Hammersley on GPU

http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html

float radicalInverse_VdC(uint bits) {

bits = (bits <> 16u);

bits = ((bits & 0x55555555u) <> 1u);

bits = ((bits & 0x33333333u) <> 2u);

bits = ((bits & 0x0F0F0F0Fu) <> 4u);

bits = ((bits & 0x00FF00FFu) <> 8u);

return float(bits) * 2.3283064365386963e-10; // / 0x100000000

}

vec2 hammersley2d(uint i, uint N) {

return vec2(float(i)/float(N), radicalInverse_VdC(i));

}