In oit_add_transmittance.glsl, line 12~15,
float depth = originalDepth * float(OIT_NUMBER_OF_DEPTH_BINS - 1) / OIT_NUMBER_OF_DEPTH_BINS;
float averageAbsorbance = absorbance * (1 - depth);
coefficients[0] = averageAbsorbance; // accumulated using variable depth
In oit_sample.glsl, line 11~16,
float averageAbsorbance = coefficients[0];
if (averageAbsorbance == 0) {
return 0.0;
}
float currentAverageAbsorbanceContribution = currentAbsorbance * (1 - originalDepth);
averageAbsorbance -= currentAverageAbsorbanceContribution; // subtracted using variable originalDepth
“coefficients[0]” should be accumulated and subtracted using “depth” in order to correctly exclude the factor contributed by the same depth.
Comments 0
No comments.