Jump to content
  • Advertisement
Sign in to follow this  

Yet another DOF question

This topic is 3412 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

Hello I am trying to create a DOF shader roughly based on the article/presentation: http://ati.amd.com/developer/gdc/Scheuermann_DepthOfField.pdf Summarizing it, DOF is obtained by: [1] Pre-storing depth-and-focal-pont-based blurriness measure (per pixel) [2] Blurring the pixels basing on the pre-stored blurriness measure If you think I should write something more - please tell me, I will expand this hyper-short summary. What I want to ask you about, is a piece of code in the page number 18 of this paper, function PoissonDOFFilter, the line where discRadius ic calculated. discRadius = abs(cOut.a * vMaxCoC.y - vMaxCoC.x); where discRadius is the radius of the Poisson disc filter kernel, vMaxCOC.y and vMaxCOC.x are the diameter and radius of the maximal circle of confusion, respectively (paper hard-sets them to 10 and 5 pixels); cOut.a holds the pre-stored blurriness measure (range [-1, 1]). The question is - why (the heck) is the discRadius calculated in such a strange fashion? As far as my understanding of this thing goes, discRadius should be simply proportional to the absolute value of the blurriness measure, however, if you draw the function y(x) = abs(10 * x - 5), you will see that this is not the case. The values (y) for negative arguments (x) will grow faster than the positive ones (head-start of 5), and for the x-interval [0, 0.5] y (discRadius) actually decreases with the growth of x (blurriness measure)! Well, either I am totally mistaken here or, hm, or I don't know what. If you can make anything out of it - please help. Thanks! PS I guess I can only expect help from someone, who has actually gone through this article or knows the case from their own experience, since my summary cannot be really helpful with my question.

Share this post


Link to post
Share on other sites
Advertisement
Emm, okay, I was wrong. This thread can be killed. Just in the very improbable case some of you had the same problem: in the linked article, when you look at the page number 10, you will see that the blurriness measure (f) is forced into the interval [0, 1] (with 0 and 1 both representing max-blurriness and 0.5 no-blurriness), which makes the aforementioned line simply making discRadius value be in the range [0.5, 5] proportionally to the blurriness measure, with a "minimum" at 0.5.

It also makes me feel like a moron.

Sorry you had to go through that and see you in different threads,
nietakt ;]

[Edited by - nietakt on January 16, 2009 8:21:52 AM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!