Jump to content
  • Advertisement
  • entries
  • comments
  • views

Bokeh to the Future

Sign in to follow this  



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.



Sign in to follow this  


Recommended Comments

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!

Share this comment

Link to comment

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:



Share this comment

Link to comment

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

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!