Bugfix: High resolution "exploded" when using uneven resolutions, sometimes with specific object scaling.

Part of Smoke Development Phase III.

Credit also goes to MiikaH: It was a teamwork effort and took days to track down. :)
This commit is contained in:
Daniel Genrich 2012-08-01 20:29:37 +00:00
parent 6a6bcea817
commit 8a0f6aa2f2

@ -107,7 +107,7 @@ static void downsampleNeumann(const float *from, float *to, int n, int stride)
// if these values are not local incorrect results are generated
float downCoeffs[32] = { DOWNCOEFFS };
const float *const aCoCenter= &downCoeffs[16];
for (int i = 0; i < n / 2; i++) {
for (int i = 0; i < ceil((float)n / 2); i++) {
to[i * stride] = 0;
for (int k = 2 * i - 16; k < 2 * i + 16; k++) {
// handle boundary