New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using non-default samplers #47
Comments
Lens blur filter is not so much tuned so there may be other problems. The main idea is based on https://colinbarrebrisebois.com/2017/04/18/hexagonal-bokeh-blur-revisited/ About your question, I think both way is ok. I personally prefer the “fowarding” way. It gives the caller an opportunity to choose a different address mode (maybe clamp_to_edge works well too?) You can send pull requests if you’d like to refine the lens blur filter. |
I think 'clamp to edge' is the default, 'mirrored repeat' is really the only address mode that minimized edge artifacts for me. |
The default sampler address mode of MTIImage is “clamp to zero”. We think this is the most logical default address mode - when you read a pixel outside an image you get zero. |
Ah, you're right, I was looking at the Metal language specs, not the MTISamplerDescriptor implementation. |
I've been playing around with the lens blur filter and noticed that it tends to produce ugly artifacts near the image edges, especially when using a large blur radius.
Using samplers with their address mode set to 'mirror repeat' alleviates this.
However, simply setting the input images sampler is insufficient, as the filter generates intermediate images which appear to fall back to the default sampler.
I tried two things:
Both approaches worked, but maybe there's a better way?
The text was updated successfully, but these errors were encountered: