Depth Of Field

So this thread got me to re-examine depth of field in the context of plain, vanilla OpenGL. Well, you need two texture units :slight_smile:
http://www.mindcontrol.org/~hplus/graphics/dof.html

No vendor-specific extensions used!

Can’t say it looks that good, though.

[This message has been edited by jwatte (edited 01-26-2003).]


Thanks for at least trying Jon, that looks…kinda interesting.
Doesn’t look like depth of field, though.
Only seems to ‘blur’ distant objects, not ‘near’ ones - so no focal plane being considered.
Also looks like you’ve got nearest as a texture filter - why not linear?
Why are you using projective texturing? Why not render the scene and then do a screen aligned quad?
Maybe I was a little harsh with my earlier tantrum - some of you are interested in more than terminology after all.

Hi guys!

I don’t think this is really what you want to do, but I just wanted to make my contribution to this interesting subject.

You can get pretty nice depth blur effect by pre-blurring your mipmaps and using a kind of variation of the edge antialiasing algorithm. It looks good
http://www.hut.fi/~ikuusela/images/depthblur.jpg
, but is a mess to implement since it’s ultimately just a group of hacks. You need to hack it seperately for every type of object you have.

-Ilkka

Edit: Damn, I never get my links right on a first attempt!

[This message has been edited by JustHanging (edited 01-27-2003).]

Kurious,

If you read the code, you see that it does indeed consider a plane, and things closer than the plane do get blurred (well, at least on the GF2 and R9700 I tried it on).

You can increase quality by increasing the size of the first pass.

Note the specific goal of that sample: do depth of field-like blurring with vanilla OpenGL. If you have hardware that can easily render to different targets, and access the depth buffer as a texture, and use fragment programs, then the stakes become quite different :slight_smile: