Pirate Shaders For Reshade3 (Yar!)

More
4 years 11 months ago #41 by OtisInf
Replied by OtisInf on topic Pirate Shaders For Reshade3 (Yar!)

Things to note:
-Blur between camera and focal point isn't photorealistic, main reason for that is speed.

Why cater for speed? The existing DoF's already don't do blur bleed into focus plane, it would be nice to have at least one which does. Admitted, it's not the easiest effect to implement that way (as you need to use 2 buffers, not 1) but still, for screenshotters like myself it would be awesome to have a DoF which does bleed near plane blur into focus plane (and at the same time of course doesn't bleed focus plane into far blur plane like Marty's does if Bokeh is active, but you can't have everything ;)).

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

More
4 years 11 months ago - 4 years 11 months ago #42 by PirateKitty
Replied by PirateKitty on topic Pirate Shaders For Reshade3 (Yar!)
There's a couple ways that I could implement it without much trouble. But the speed you gain from ignoring focused pixels will be gone.

I might as well do that as a toggle, so you can choose.
Last edit: 4 years 11 months ago by PirateKitty.

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

More
4 years 11 months ago #43 by PirateKitty
Replied by PirateKitty on topic Pirate Shaders For Reshade3 (Yar!)
Fixed an error that wouldn't let the DOF compile in dx10/11 games.

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

More
4 years 11 months ago - 4 years 11 months ago #44 by Androll
Replied by Androll on topic Pirate Shaders For Reshade3 (Yar!)
Hi, is there any chance for making simple depth check in bloom shader, so only depth = 1 gets bloomed, ie. only sky?
Last edit: 4 years 11 months ago by Androll.

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

More
4 years 11 months ago #45 by PirateKitty
Replied by PirateKitty on topic Pirate Shaders For Reshade3 (Yar!)

Hi, is there any chance for making simple depth check in bloom shader, so only depth = 1 gets bloomed, ie. only sky?

I don't want to include depth into bloom. But when I'm done rewriting scatter, you should have the effect you want.

In other news, screenshot from yesterday while I was fixing compile errors for dx11

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

More
4 years 11 months ago #46 by Androll
Replied by Androll on topic Pirate Shaders For Reshade3 (Yar!)
I don't know what is this scatter thing, but just modified bloom shader code myself and its working as desired. Have a good day.

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

More
4 years 11 months ago #47 by GP-Unity
Replied by GP-Unity on topic Pirate Shaders For Reshade3 (Yar!)
Can you share the modified bloom code if possible please?

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

More
4 years 11 months ago #48 by PirateKitty
Replied by PirateKitty on topic Pirate Shaders For Reshade3 (Yar!)
You can edit it yourself by adding this somewhere on top:
texture2D	texDepth : DEPTH;
sampler2D	SamplerDepth {Texture = texDepth; MinFilter = LINEAR; MagFilter = LINEAR; MipFilter = LINEAR; AddressU = Clamp; AddressV = Clamp;};

Then change
float4 GaussBlurFirstPass(float2 coords : TEXCOORD) : COLOR {
	float4 ret = max(tex2D(SamplerColor, coords) - BLOOM_THRESHOLD, 0.0);
to
float4 GaussBlurFirstPass(float2 coords : TEXCOORD) : COLOR {
	if (tex2D(SamplerDepth, coords).x != 1.0) return 0.0;
	float4 ret = max(tex2D(SamplerColor, coords) - BLOOM_THRESHOLD, 0.0);

Quick and dirty way of doing it.
The following user(s) said Thank You: Androll, GP-Unity

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

More
4 years 11 months ago #49 by Marty McFly
Replied by Marty McFly on topic Pirate Shaders For Reshade3 (Yar!)

Things to note:
-Blur between camera and focal point isn't photorealistic, main reason for that is speed.

Why cater for speed? The existing DoF's already don't do blur bleed into focus plane, it would be nice to have at least one which does. Admitted, it's not the easiest effect to implement that way (as you need to use 2 buffers, not 1) but still, for screenshotters like myself it would be awesome to have a DoF which does bleed near plane blur into focus plane (and at the same time of course doesn't bleed focus plane into far blur plane like Marty's does if Bokeh is active, but you can't have everything ;)).


Oh, I didn't know ppl cared about that, this is the first feedback I read concerning this. Sure can do :)
The following user(s) said Thank You: piltrafus, OtisInf

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

More
4 years 11 months ago - 4 years 11 months ago #50 by piltrafus
Replied by piltrafus on topic Pirate Shaders For Reshade3 (Yar!)
+1 for fixing the focus bleed in marty's advanced DOF. I love the look of the bokeh on it. However the masking system doesn't really work as it should IMHO.
I still think ADV. DOF is the best DOF I've seen, however an update with a better masking would be greatly appreciated. MAGIC DOF does a great job at masking the focused elements from defocused BG.

And kudos to piratekitty for the work done in his own suite of effects. Haven't tested them yet but from screenshots it looks like something I'll love to play with as soon as I get some spare time.
Last edit: 4 years 11 months ago by piltrafus.

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

More
4 years 11 months ago #51 by PirateKitty
Replied by PirateKitty on topic Pirate Shaders For Reshade3 (Yar!)


Added a more photorealistic near blur option. The only caveat is that you need to set the DOF texture size to 1.0.

I will probably have to clean the code more later, let me know if you find bugs or something. Also, Bokeh bias affects the near blur, so you might want to toy with that too to have the kind of effect you want.

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

More
4 years 11 months ago #52 by Marty McFly
Replied by Marty McFly on topic Pirate Shaders For Reshade3 (Yar!)
Just a suggestion: don't use "photorealistic". It's by far the most overused word in graphics programming and it has never been achieved. If I see something that calls itself "photorealistic", I automatically assume it's shit. And I'm not alone with that. Your shaders are just fine (reinventions of the wheel though, sometimes), but I wouldn't use that word if I were you.

I still think ADV. DOF is the best DOF I've seen, however an update with a better masking would be greatly appreciated. MAGIC DOF does a great job at masking the focused elements from defocused BG.

Uhm Magic DoF actually has a shit masking and the ADOF masking is by far my best work. There can't be a perfect masking with pixel shader DoF though.

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

More
4 years 11 months ago #53 by PirateKitty
Replied by PirateKitty on topic Pirate Shaders For Reshade3 (Yar!)

Just a suggestion: don't use "photorealistic". It's by far the most overused word in graphics programming and it has never been achieved.

Dang bro, your shaders are such a P word!


No, really, I don't care what sort of words people have issues with.

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

More
4 years 11 months ago - 4 years 11 months ago #54 by OtisInf
Replied by OtisInf on topic Pirate Shaders For Reshade3 (Yar!)

Things to note:
-Blur between camera and focal point isn't photorealistic, main reason for that is speed.

Why cater for speed? The existing DoF's already don't do blur bleed into focus plane, it would be nice to have at least one which does. Admitted, it's not the easiest effect to implement that way (as you need to use 2 buffers, not 1) but still, for screenshotters like myself it would be awesome to have a DoF which does bleed near plane blur into focus plane (and at the same time of course doesn't bleed focus plane into far blur plane like Marty's does if Bokeh is active, but you can't have everything ;)).


Oh, I didn't know ppl cared about that, this is the first feedback I read concerning this. Sure can do :)

Awesome news :) Looking forward to the update!

I still think ADV. DOF is the best DOF I've seen, however an update with a better masking would be greatly appreciated. MAGIC DOF does a great job at masking the focused elements from defocused BG.

Uhm Magic DoF actually has a shit masking and the ADOF masking is by far my best work. There can't be a perfect masking with pixel shader DoF though.

I don't know what you mean with masking, as with ADOF there's little masking going on if bokeh is enabled, as there's massive halo/bleeding present, so the masking doesn't really do much (I mean, even the naive masking in my depthhaze shader is doing a better job masking edgebleed out B) ). Do you refer to something else perhaps? For near blur bleed you need 2 buffers instead of one, like you use now, but I guess you already knew that ;). There are quite a few papers on this online but all of them seem to compromise one way or the other as it's performance intensive and / or there are always side effects as you refer to as well (e.g. hair in the foreground with gaps: the hair should be sharp but the gaps are likely so small, blurring them isn't going to work well as there's little left to do the blur with, so these gaps tend to be less blurred.

For screenshotting slow performance is fine though, shots are taken at massive resolutions anyway with very low framerates.
Last edit: 4 years 11 months ago by OtisInf.

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

More
4 years 11 months ago - 4 years 11 months ago #55 by PirateKitty
Replied by PirateKitty on topic Pirate Shaders For Reshade3 (Yar!)

The numbers I put in mine are for speed. You can always crank it up and even make forced macro shots.

For near blur bleed you need 2 buffers instead of one

Not really. The only reason I use 2 buffers... or rather, textures, is because of a limitation of pixel shaders and I used it before I made the near blur more p-wordy. I can get more technical with what I do in PBR, and it can be adapted to a game engine but that is a bit off the point.

gaps

Most of the time this is the depth buffer's fault. If you look up at the GTAV screenshot, there's a bit of halo on his shirt, that's because the depth I used was half the resolution (1/4 of the pixels). But it also happens because of how it handles transparency and certain elements like sprites for example. You have no control over that with reshade, so you just have to live with it. Another example, hair strands a lot of the times tend to be a flat surface with a transparent texture, so the depth just see the shape in which the texture is overlaid upon, so you get the blur/ao defects.
Last edit: 4 years 11 months ago by PirateKitty.

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

More
4 years 11 months ago - 4 years 11 months ago #56 by OtisInf
Replied by OtisInf on topic Pirate Shaders For Reshade3 (Yar!)

For near blur bleed you need 2 buffers instead of one

Not really. The only reason I use 2 buffers... or rather, textures, is because of a limitation of pixel shaders and I used it before I made the near blur more p-wordy. I can get more technical with what I do in PBR, and it can be adapted to a game engine but that is a bit off the point.

I think you do need 2, see: www.crytek.com/download/Sousa_Graphics_Gems_CryENGINE3.pdf, page 41 and further.
and more info from the author of the particular shader: www.gamedev.net/topic/675214-dof-near-field-bleeding/

gaps

Most of the time this is the depth buffer's fault. If you look up at the GTAV screenshot, there's a bit of halo on his shirt, that's because the depth I used was half the resolution (1/4 of the pixels). But it also happens because of how it handles transparency and certain elements like sprites for example. You have no control over that with reshade, so you just have to live with it. Another example, hair strands a lot of the times tend to be a flat surface with a transparent texture, so the depth just see the shape in which the texture is overlaid upon, so you get the blur/ao defects.

That's not what I was referring to ;) I know that, the thing I was referring to was e.g. visible in The Division, where hair has separate rendered strands and the DoF in between strands is not as strong as outside the hair area, which is obvious as the # of pixels between strands to blur with is very low, i.e.: a simple mask based on weights whether a blur input pixel candidate is within CoC range will filter out most pixels as they're likely part of one of the strands of hair.

I think there are two usages of DoF in gaming: 1) in real time in gameplay, which can be of lesser quality and 2) in cutscenes / high-res screenshot scenes which have to be of topnotch quality. Every DoF shader out there more or less can do the former, the latter is what I'm after (and others in the screenshotting community are too! ;)) in particular. It would be cool if your shader has configuration parameters to achieve the latter too :)
Last edit: 4 years 11 months ago by OtisInf.

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

More
4 years 11 months ago #57 by PirateKitty
Replied by PirateKitty on topic Pirate Shaders For Reshade3 (Yar!)

The Division, where hair has separate rendered strands and the DoF in between strands is not as strong as outside the hair area, which is obvious as the # of pixels between strands to blur with is very low,

Haven't played that game or seen enough screenshots of it to notice. But most DoF in games are horrible. I absolutely hate gaussian blur. If I'm playing a game and it has gaussian blur as DoF, I just turn it off if I can. That and fake bokeh effects are the two things that bother me in DoFs and make me turn them off.

I haven't seen this happening in mine and it shouldn't unless the depth has issues. There are some artifacts that can happen in mine, but only when using more extreme values on the settings.

in particular. It would be cool if your shader has configuration parameters to achieve the latter too

I see no reason why not. If you use it and find things you don't like, just let me know and I will give it a look.


The original code for it was used in quite a lot of ENB presets for skyrim.

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

More
4 years 11 months ago - 4 years 11 months ago #58 by Marty McFly
Replied by Marty McFly on topic Pirate Shaders For Reshade3 (Yar!)

I don't know what you mean with masking, as with ADOF there's little masking going on if bokeh is enabled, as there's massive halo/bleeding present, so the masking doesn't really do much (I mean, even the naive masking in my depthhaze shader is doing a better job masking edgebleed out B) ). Do you refer to something else perhaps? For near blur bleed you need 2 buffers instead of one, like you use now, but I guess you already knew that ;). There are quite a few papers on this online but all of them seem to compromise one way or the other as it's performance intensive and / or there are always side effects as you refer to as well (e.g. hair in the foreground with gaps: the hair should be sharp but the gaps are likely so small, blurring them isn't going to work well as there's little left to do the blur with, so these gaps tend to be less blurred.

For screenshotting slow performance is fine though, shots are taken at massive resolutions anyway with very low framerates.


I am not sure if we mean the same. ADOF masks perfectly if pixels are in focus. If they are *close* to focus however, they MUST bleed. Look here:

Warning: Spoiler!


My guess is that you'd say the white roof should not bleed into the blurred background. But as it's slightly out of focus, it HAS to bleed into the more blurred background. Otherwise we have 2 areas with differently strong blur, separated by a sharp line.

PirateKitty Didn't expect you to make fun of me for disliking the "photorealistic" term, even making a github mention on that. Expected a bit more politeness given the fact that a lot of your shaders have been heavily, let's say "inspired" by mine, without bothering to ask if it's okay.
Last edit: 4 years 11 months ago by Marty McFly.

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

More
4 years 11 months ago - 4 years 11 months ago #59 by piltrafus
Replied by piltrafus on topic Pirate Shaders For Reshade3 (Yar!)
Marty,
that's the problem Otis is referring to:
the face is in focus but it's color bleeds into the out of focus area.


perhaps this discussion could be continued in the ADOF thread instead?
Last edit: 4 years 11 months ago by piltrafus.

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

More
4 years 11 months ago #60 by Marty McFly
Replied by Marty McFly on topic Pirate Shaders For Reshade3 (Yar!)
Yes, that'd be ideal. Otis, if you want to answer, do just reply to ADOF thread :)

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