Depth of Field

Started by
7 comments, last by Axiverse 15 years, 5 months ago
Hello guys here i am again! ... :/ I'd like to try implementing a DOF effect in openGL (following this definition http://en.wikipedia.org/wiki/Depth_of_field). In the openGL framework, I've seen the DOF effect should have something to do with the accumulation buffer ... but i really don't know where to start looking. Also, does the DOF effects costs a lot of processing ? is there a way to implement this with a shader (even with CGFX) or is that not appropriate at all ? thanks in advance, and sorry for my broken english cheers
Advertisement
Quote:Original post by carmellose
is there a way to implement this with a shader (even with CGFX) or is that not appropriate at all ?
DOF is almost always implemented with shaders (as are most other effects these days). As an extreme simplification: render the scene to a texture, and then blur that texture based on the depth buffer as you render it to the screen.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

hello,

thank you for your answmer. Ok, i'll try to do it with a shader then ;)
However, i think i might be able to implement a blur effect, but what about the DOF ? could you elaborate on how to proceed and/or the "algorithm" to use? Are there any reference to look at?

thanks!

cheers
uppy up
Just give google a try: http://www.google.com/search?hl=de&rls=com.microsoft%3Ade%3AIE-SearchBox&rlz=1I7ADBR&q=depth+of+field+opengl+filetype%3Apdf&lr= :)
http://ati.amd.com/developer/gdc/Scheuermann_DepthOfField.pdf
The OpenGL red book has an example of DOF.

Look for 'Example 10-5 : Creating a Depth-of-Field Effect: dof.c' on this page :

http://fly.srk.fer.hr/~unreal/theredbook/chapter10.html
a couple of other ways:

Humus depth of field 1
Humus depth of field 2
[size="1"]
thanks everyone!!

i'll see what i can do :)
Starcraft 2 Deferred Rendering & Depth of Field

This topic is closed to new replies.

Advertisement