Sign in to follow this  

Depth of Field with GLSL

This topic is 3527 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For my first post on this forum I would like to share with you my last experiments on the topic of Depth of Field. I've always been fascinated by this post-processing effect and, since some days, I'm studying a freely available paper from ShaderX2 (Real-Time Depth of Field Simulation) in order to implement it. The source of the demo is not yet freely available because I'm still tuning some parts, but you can already see it in action in this HD video: GLSL_DoF_HD. [wink]

Share this post


Link to post
Share on other sites
Hey Encelo,
there is a more advanced effect in ShaderX3 ... it should actually run even faster.
It comes from the same team and builds on the ShaderX2 article. You might also find the PDF file on the ATI website :-)

Share this post


Link to post
Share on other sites
Quote:
Original post by Matt Aufderheide
What is the obsession poeple have with these fake camera-type effects (DOF, lens flare, bloom, etc).. this is computer rendering, not photography..why fake a defect of optical lenses...


It isn't a "defect". The way we perceive the real world, whether through cameras or through our own human vision system, is shaped by the optics of lenses

Share this post


Link to post
Share on other sites
Depth of Field is how the human eye perceives things (the wider your pupil the more light is let in just like a lens aperature). I agree though on lens flare though, I think its overdone and lens flair is not a desirable effect to have in a photo (Thats why you always shoot with a lens hood especially when using a wide angle! Sorry for the rant, Im a photographer :D).

One thing I do notice though about simulated depth of field it does not create the nice bokeh effects of a real lens. Most simulated depth of field I see just blurs and object the farther away it is relative to where the camera is. Bokeh in a camera lens is different, its created by the shape of the aperature. (Look up Canon 85mm 1.2L pictures for some amazing bokeh).

Share this post


Link to post
Share on other sites
Quote:
It isn't a "defect". The way we perceive the real world, whether through cameras or through our own human vision system, is shaped by the optics of lenses

It is indeed a defect because its prevents perfect viewing of everythang at once in focus...computers dont have that limitations.. why struggle to emulate a deficiency? Especially goign so far as to make it physically (optically) correct...that's just wierd.

I'm not saying such effects may not have a stylistic use in some circumstances, but the original poster gushes over DOF like its a chocolate sundae on his website.. I dont get it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Matt Aufderheide
It is indeed a defect because its prevents perfect viewing of everythang at once in focus...computers dont have that limitations.. why struggle to emulate a deficiency? Especially goign so far as to make it physically (optically) correct...that's just wierd.


I'd guess for the same reason we have gravity, weather, people dying, and other natural phenomena in games: because they happen in real life.


Quote:
Original post by Matt Aufderheide
I'm not saying such effects may not have a stylistic use in some circumstances, but the original poster gushes over DOF like its a chocolate sundae on his website.. I dont get it.


He likes DOF, so what? No need to troll his thread...


Share this post


Link to post
Share on other sites
Quote:
Original post by Chrono1081
One thing I do notice though about simulated depth of field it does not create the nice bokeh effects of a real lens. Most simulated depth of field I see just blurs and object the farther away it is relative to where the camera is. Bokeh in a camera lens is different, its created by the shape of the aperature. (Look up Canon 85mm 1.2L pictures for some amazing bokeh).


Yeah, it's an unfortunate consequence of the techniques used for faking the effect. Real DOF simulation requires more information than what you have rendered to the back-buffer (or render-target surface), and generally it's just too expensive to obtain that information. So a screen-space blur is used instead, despite it being completely wrong (but then again people like to use screen-space blur for shadows too, and that's also completely wrong!).

Share this post


Link to post
Share on other sites
Quote:
Original post by Matt Aufderheide
Quote:
It isn't a "defect". The way we perceive the real world, whether through cameras or through our own human vision system, is shaped by the optics of lenses

It is indeed a defect because its prevents perfect viewing of everythang at once in focus...computers dont have that limitations.. why struggle to emulate a deficiency? Especially goign so far as to make it physically (optically) correct...that's just wierd.

I'm not saying such effects may not have a stylistic use in some circumstances, but the original poster gushes over DOF like its a chocolate sundae on his website.. I dont get it.


Don't worry, I've always found those effects (blur, dof, and even HDR) quite ugly, and I prefer playing without them. But some like them, so let them implement those techniques if they want :D.

Share this post


Link to post
Share on other sites
Quote:
Original post by Matt Aufderheide
It is indeed a defect because its prevents perfect viewing of everythang at once in focus...computers dont have that limitations.. why struggle to emulate a deficiency? Especially goign so far as to make it physically (optically) correct...that's just wierd.


I agree. Just like shadows are obviously a fundamental flaw of nature that prevent us from seeing parts of the world that are in shadow. We should ditch those too.

Come to think of it, what's the deal with opaque surfaces? We should be able to see through walls. Let's get rid of the z buffer entirely. It's obviously just a deficiency of nature that photons don't pass right through solid matter.

Share this post


Link to post
Share on other sites

This topic is 3527 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

Sign in to follow this