Depth of Field Help
- Zireael
- Topic Author
Is it possible to make the depth of field bleed outwards from an object's edges?
I've noticed that instead blurred objects become "thinner", it looks like the edges shift inwards, which looks bad and does not resemble real DOF
Can anything be done about this?
Please Log in or Create an account to join the conversation.
- FierySwordswoman
I prefer Matso, personally. Not as much customization as Advanced, but produces a better overall result.
Please Log in or Create an account to join the conversation.
- Zireael
- Topic Author
FierySwordswoman wrote: Adjust the settings some and try different DOF styles.
I prefer Matso, personally. Not as much customization as Advanced, but produces a better overall result.
I only use DOF for screenshots, everything except Marty's is rubbish if you want real high quality results.
How is telling me to adjust settings helpful in any way? I already do that extensively, I wanted help from someone who knew more than me.
Please Log in or Create an account to join the conversation.
- FierySwordswoman
Now, I'm not a shader programmer, I mostly just work in GIMP and a tiny bit in Blender, so my explanations might sound weird...
When blurring something, you need information from everything around it. When it can't get information (hitting edge of blur region), it refers to an abyss policy, usually a clamp (take what information it *does* have and stretch it to fill the gaps) or void (just blend with alpha/transparency).
In the DOF shaders, they have to decide between two abyss policies: blur everything or limit based on local depth.
This results in two artifacts depending on which one of the two the shader favors...
EDIT: Didn't like the amount of images I had. Here's links.
Depth-based approaches give sharp edges, as demonstrated here:
i.imgur.com/hCqRllV.png
Here's RingDOF since it leans heavily in the depth-based policy. Notice the sharp edges, even with really distant objects.
i.imgur.com/3hsEGXN.png
Here's MatsoDOF, which leans heavily in the "blur everything and it's grandma" policy. No sharp edges near two out-of-focus objects anymore.
On the flipside, blur-happy shaders tend to give the "focus halos" around objects.
i.imgur.com/yxnxIpO.png
Here's MatsoDOF again. Notice how the in-focus object has it's color information used for the out-of-focus blurring.
i.imgur.com/u22AORq.png
And finally here's RingDOF, in which the heavy depth-based approach resolves that issue.
So, *that's* why I recommended trying different depth shaders and even fiddling with the options (bokeh can hide these sometimes).
Please Log in or Create an account to join the conversation.
- Marty McFly
So there's 2 approaches: if a pixel has a certain blur radius, just read all samples in this radius.
This means you could miss pixels farther away that have a bigger blur radius. And discard a number of pixels that cannot blur onto the current one (like in focus ones onto blurred area). But it's fast.
Then there's scatter as gather, search the maximum blur radius and discard everything that can't possibly scatter its colors onto the current pixel. This means you have to compute a big blur for the entire image and discard 99 percent of the read pixels. Accurate, but slow AF. It's what you're looking for but it'll cut your fps in half.
All DoF shaders for ReShade work with the first method. Magic DoF and Matso are multipass, where the information if a pixel can scatter color is partially lost so the blur is much more even, at the expense of bleeding artifacts around focus objects because pixels in blurred area lose the information if the in focus one should blur into the DoF area or not.
TLDR: What you want is possible, but slow as hell. All DoF shaders use some sort of tradeoff, for performance. My DoF focuses on minimizing bleeding artifacts, others just blur everything.
PS: If you lower the Bokeh Curve of mine, you get a more even blur.
Please Log in or Create an account to join the conversation.
- Zireael
- Topic Author
Marty McFly wrote:
TLDR: What you want is possible, but slow as hell. All DoF shaders use some sort of tradeoff, for performance. My DoF focuses on minimizing bleeding artifacts, others just blur everything.
PS: If you lower the Bokeh Curve of mine, you get a more even blur.
Thanks for taking the time to write up that explanation.
Would it be too much work to create a shader, or to add some code to the existing DOF shaders in order to achieve what I was talking about?
I don't have an issue with it being slow as hell since I only use it for screenshots, could turn it into a slideshow for all I care (something I've already done by using a really high shape quality value).
Please Log in or Create an account to join the conversation.
- FierySwordswoman
Please Log in or Create an account to join the conversation.
- Marty McFly
Please Log in or Create an account to join the conversation.
- Zireael
- Topic Author
Marty McFly wrote: Well I could supply a scatter as gather DoF. Insane performance hog but if that's what you want...
I would greatly appreciate that.
Thank you for your time.
Please Log in or Create an account to join the conversation.
- Zireael
- Topic Author
Hey just wanted to know if you were still planning to provide this DoF.Marty McFly wrote: Well I could supply a scatter as gather DoF. Insane performance hog but if that's what you want...
Thanks.
Please Log in or Create an account to join the conversation.