Bokeh to the Future

Published March 17, 2016
Advertisement

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:

019_a.png

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.

019_b.png

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]

[/media]

Previous Entry Cloud.gen
7 likes 4 comments

Comments

riuthamus

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!

March 17, 2016 04:29 PM
eppo

Thanks for the love and the hate, Riu. tongue.png

Here's a vid that shows a gradual shift of focus from the front to the back of the scene:

[media]https://www.youtube.com/watch?v=Dd9VQxDpF9Q[/media]

March 18, 2016 09:37 AM
riuthamus

oh yeah, that is much better, and looks REALLY good!

March 18, 2016 02:07 PM
Gooey

Wow! It is nice to see you have got it done after all that time spent on it and it looks wow!

March 23, 2016 01:51 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement