EEVEE-Next: Fixing shifted blur for non constant Shutter Curve #121320

Closed
Vitalijs Komasilovs wants to merge 1 commits from Vitalijs-Komasilovs:eevee-next-fix-shutter-curve into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 1 additions and 1 deletions

View File

@ -322,7 +322,7 @@ void Sampling::cdf_invert(Vector<float> &cdf, Vector<float> &inverted_cdf)
if (i == cdf.size() - 1) {
inverted_cdf[u] = 1.0f;
}
else if (cdf[i] >= x) {
else if (cdf[i] >= x && cdf[i + 1] != cdf[i]) {
float t = (x - cdf[i]) / (cdf[i + 1] - cdf[i]);
inverted_cdf[u] = (float(i) + t) / float(cdf.size() - 1);
break;