New shader: cinematic depth of field

More
1 year 8 months ago #101 by OtisInf
Replied by OtisInf on topic New shader: cinematic depth of field
I surely could skip near plane objects.... if they're in the depth buffer :) UI elements aren't so the pixels appear as if they're in the background, and are blurred accordingly. If you enable the "DisplayDepth" shader, you'll see that the elements aren't in the depth buffer (or click the view CoC option in cinematic dof). So there's little I can do regarding that.

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #102 by Sami 1999
Replied by Sami 1999 on topic New shader: cinematic depth of field
Removing the HUD completely would be a better option then.

I'm fine with blurry UI though. The bigger issue where near objects looked pixelated is solved. So it's all fine now

Please Log in or Create an account to join the conversation.

More
1 year 6 months ago - 1 year 6 months ago #103 by OtisInf
Replied by OtisInf on topic New shader: cinematic depth of field
New version (v1.1.8 ). Version in reshade repo is v1.1.3, so I made PR to get it updated in the reshade repo as well.

New features:

v1.1.8: Added anamorphic bokeh support, so bokehs now get stretched and rotated based on the distance from the center of the screen, with various tweaks.
v1.1.7: Added 9-tap tent filter as described in [Jimenez2014] for mitigating undersampling. Implementation is from KinoBokeh (see credits in file).
v1.1.6: When near plane max blur is set to 0, the original fragment is now used in the near plane instead of the half-res pixel.
v1.1.5: Added far plane highlight normalizing for non-gained highlights. Added tooltip for reshade v4.x
v1.1.4: Far plane weight calculation tweaked a bit as near-focus plane elements could lead to hard edges which looked ugly. Highlight far plane adjustments have been reworked because of this.

PR: github.com/crosire/reshade-shaders/pull/153

(edit) merged
Last edit: 1 year 6 months ago by OtisInf.
The following user(s) said Thank You: Wicked Sick, Ryukou36, AssassinsDecree, Sami 1999

Please Log in or Create an account to join the conversation.

More
1 year 6 months ago #104 by Tom Yum 72
Replied by Tom Yum 72 on topic New shader: cinematic depth of field
I can not thank you enough !

Please Log in or Create an account to join the conversation.

More
1 year 6 months ago #105 by OtisInf
Replied by OtisInf on topic New shader: cinematic depth of field
A guide for all the settings has been added to the FRAMED screenshot website: framedsc.github.io/ReshadeGuides/Shaders/cinematicdof.htm
The following user(s) said Thank You: Wicked Sick

Please Log in or Create an account to join the conversation.

More
1 year 6 months ago - 1 year 6 months ago #106 by Marty McFly
Replied by Marty McFly on topic New shader: cinematic depth of field
Suggestion: modify the "anamorphic" option. Right now, it squeezes the bokeh disc and rotates it so the effect swirls around the center. I think you're throwing two different bokeh properties together: anamorphic bokeh is caused by recording video with anamorph lenses which allow to record horizontally wider image on narrow film. Has the side effect of squeezing bokeh horizontally - on the entire screen with the same orientation, so nothing center aligned going on.

What the option in your DoF currently does is somewhat mimicking the occlusion of the aperture by the camera lens itself, which doesn't look like squeezed bokeh but like the boolean intersection of two circles, like in the first picture below. While it is possible to have an effect like yours, it's caused by lens distortion and only happens on severely fish-eyed images.

500px.com/photo/149434545/a-world-with-y...e=photos&ctx_q=bokeh

Which looks different to what your DoF currently does:



And anamorphic bokeh looks like this

Last edit: 1 year 6 months ago by Marty McFly.

Please Log in or Create an account to join the conversation.

More
1 year 6 months ago - 1 year 6 months ago #107 by OtisInf
Replied by OtisInf on topic New shader: cinematic depth of field
With different setting values you can achieve that tho: (so like the picture you quoted last, with vertical ellipses) It's also in the same doc page (almost at the bottom ;) )


I used an example image with slightly rotated anamorphic bokehs in the corners to build the effect, so I added that rotation option too so you could achieve that. You can get overboard with it, but that's not the intention. To be honest, I used www.eoshd.com/comments/topic/2035-why-is-anamorphic-bokeh-oval/ as basis for an explanation of what it was and built the code from there.

That said, what's suggested is indeed that the rotation aspect is part of what an anamorphic lens does, and that's not the case. I'll see what I can do to update that.

(edit) updated the wording of the section a bit. I'm not going to update the settings of the shader.
Last edit: 1 year 6 months ago by OtisInf.

Please Log in or Create an account to join the conversation.

More
1 year 4 months ago #108 by OtisInf
Replied by OtisInf on topic New shader: cinematic depth of field
new version: github.com/crosire/reshade-shaders/pull/169
  • Added white boost/correction in gathering passes to have lower-intensity highlights become less prominent.
  • Added further weight adjustment tweaks. Changed highlight defaults to utilize new sample weight code
  • Better near-plane bleed mask. Better far plane pixel weights so more samples get accepted.

Guide updated with new shots: framedsc.github.io/ReshadeGuides/Shaders/cinematicdof.htm

The following user(s) said Thank You: Alex_outer, Tom Yum 72, Uncle Crassius, Ryukou36, Zarathustra, Duran.te, Marot, marmamowl

Please Log in or Create an account to join the conversation.

More
1 year 4 months ago #109 by jim2point0
Replied by jim2point0 on topic New shader: cinematic depth of field
Not sure what else to say other than.... thanks! Time to go near DOF all the things :)
The following user(s) said Thank You: OtisInf

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago #110 by Sami 1999
Replied by Sami 1999 on topic New shader: cinematic depth of field
Is there a way to make Auto focus ignore upto a certain distance?

In games like House of dead 1, 2, 3 the auto focus almost works perfectly with the following settings:

Near blur set to 0 so that near objects never blur out, and far blur set according to preference. That way during cutscenes or whenenemies come close to player the DOF works very well. Except, there's one problem:

The gun cursor and the flame textures that appear on cursor when firing is at absolute 0 distance from the screen. So every time I take the cursor to centre, the auto focus focuses on it, causing even the mid distant objects to blur out. Removing the cursor texture doesn't work well either since the the flame textures are still there.

So if it's possible to make auto focus ignore focusing upto a certain distance, it will be possible to use DOF on those games.

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago #111 by OtisInf
Replied by OtisInf on topic New shader: cinematic depth of field
Nope, sorry. You could perhaps set the autofocus point close to the center of the screen but a bit outside the cursor that's otherwise being focused on?

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago - 1 year 3 months ago #112 by OtisInf
Replied by OtisInf on topic New shader: cinematic depth of field
New version, with rewritten highlight pipeline, removal of redundant controls, New weight calculation for far plane, Near plane alpha optimization.

Highlight/bokeh now finally looks how I wanted it to look when I started. The bug that plagued me for a long time and caused a lot of controls/workarounds has been removed. Highlights now properly blend with one another, are consistent and easy to setup (it simply works out of the box).

Examples:




PR: github.com/crosire/reshade-shaders/pull/179

Merged
Last edit: 1 year 3 months ago by OtisInf.
The following user(s) said Thank You: Wicked Sick, Tom Yum 72, JBeckman, Uncle Crassius, Zarathustra, AssassinsDecree

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago #113 by Sami 1999
Replied by Sami 1999 on topic New shader: cinematic depth of field

OtisInf wrote: Nope, sorry. You could perhaps set the autofocus point close to the center of the screen but a bit outside the cursor that's otherwise being focused on?


Nah it's fine. Thanks for the answer.

Changing auto focus point wouldn't work in this game because it's a rail shooter game and the cursor could be anywhere on the screen. So even if say auto focus is slightly off-centre, bringing the cursor to that point would still result in focusing on the cursor.

Please Log in or Create an account to join the conversation.

More
1 year 1 month ago #114 by anontsuki
Replied by anontsuki on topic New shader: cinematic depth of field
Heya, OtisInf, I have a question for you, looking over the parameters we have to use, we can't change the bokeh shape, can we? It's always assumed that are aperture rings are circular/smooth in shape; I know I'm in a minority, both for game graphics and in the real world photography aspect, I heavily prefer polygonal shapes instead of the drab and ever so boring perfect circle.

I'd love to use this Cinematic DOF Shader, but we can't change that, can we?

Please Log in or Create an account to join the conversation.

More
1 year 1 month ago #115 by OtisInf
Replied by OtisInf on topic New shader: cinematic depth of field
That's right, there's no way to change the shape, it's always a perfect circle :)

Please Log in or Create an account to join the conversation.

More
1 year 3 weeks ago #116 by marmamowl
Replied by marmamowl on topic New shader: cinematic depth of field
Request: Would it be possible to integrate Emphasize.fx into Cinematic DoF? Both shaders work really well together and my main issue is always having to guess the correct depth for Emphasize. Would be a lot nicer if it relied on the same focus point or at least have a similar "autofocus" function. Also, is "highlight preservation" possible for Emphasize? I use it mainly to darken the BG but how it affects things like sparks floating in the air sucks. Thanks so much for the great shaders! :)

Please Log in or Create an account to join the conversation.

More
1 year 3 weeks ago #117 by OtisInf
Replied by OtisInf on topic New shader: cinematic depth of field
the first shader code I ever wrote was what later became emphasize and was added to kingeric's dof for skyrim. It worked great, but ultimately felt off: it's not a logical part of a dof, it was only there because it worked on a depth buffer too and with the same focusing code.

To darken the background you could also use Adaptive Fog with a black color (I use that most of the time if I need to darken the background). Sparks, fire etc. are often not part of the depth buffer, so are always seen as far away as the pixel they obscure. So they'll always be darkened, there's no solution for that.

So, no I won't add this to cinematic dof, sorry.

Please Log in or Create an account to join the conversation.

More
7 months 1 week ago - 6 months 3 weeks ago #118 by OtisInf
Replied by OtisInf on topic New shader: cinematic depth of field
v1.1.15:
github.com/crosire/reshade-shaders/pull/204

- Better near plane alpha calculations so pointy edges are no longer sticking out and edges of softness is now a bit translucent as it should be.
- fixed issue with near-in focus elements in near plane which weren't blurred particularly well.
- Changed default of focal length from 120 to 100mm

(edit) Merged
Last edit: 6 months 3 weeks ago by OtisInf.

Please Log in or Create an account to join the conversation.