So this thread got me to re-examine depth of field in the context of plain, vanilla OpenGL. Well, you need two texture units
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).]
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