Hi!
Wasted an entire week trying to salvage this plan I had for a new depth of field shader. To up the performance, I came up with this really awkward mipmapping scheme, because for some reason I was convinced the weighted blending filter needed wasn't separable. A few minutes reconsidering this just now and it turns out a two pass method is perfectly feasible - so a quick rewrite later and I have this:
This version gets rid of the worst bleeding artifacts in both the near and far field by adjusting any texel's circle-of-confusion radius based on the depth values of neighboring (and occluding) texels.
I apply a basic dilation filter to bring out the brighter values, but I think I'm probably going to have to render some small point sprites to really have those distinct iris blade patterns pop out.
[media]
I hate and love your posts.
First, I hate them because they are so amazing and it makes me wish I worked with you on a team!
Second, I love them because they are so amazing and it makes me wish I workded with you on a team!
Seriously though, some great work. My only issue is that I cant tell where the DoF is coming from for its central focus. Perhaps you could create a scene with two objects in varying distance that are on the far sides of each of the screen. Then, you can change the focus to the far object (say on the left) and watch the DoF shift. Then, you can change the focus to the near object (say on the right) and watch the shift.
Still, I enjoy reading every post because they always come with sexy pictures/video!