Skip to content

Conversation

@linusmossberg
Copy link

Hi Benedikt!

I was implementing film and reconstruction functionality in my renderer and I learned a lot from your implementation. I think that I stumbled upon a very tiny problem in your implementation that can have a noticeable effect on the result however.

When you retrieve the cached filter value, you effectively floor the continuous array index (via int cast) rather than rounding it to the closest integer. This will pick the "wrong" value (i.e. not the nearest neighbor) about 50% of the time as shown in the illustration below.

Since we are dealing with positive values, shifting the continuous index to the left by adding 0.5 before flooring is enough to achieve rounding. Here's a comparison between direct filter evaluation as reference, floor and round (using the Lanczos filter):

diff

I removed the normalization of _filter to achieve the same intended filter for these comparisons, since direct evaluation is not normalized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant