Pirate Shaders For Reshade3 (Yar!)
- OtisInf
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 ).PirateKitty wrote: Things to note:
-Blur between camera and focal point isn't photorealistic, main reason for that is speed.
Please Log in or Create an account to join the conversation.
- PirateKitty
- Topic Author
I might as well do that as a toggle, so you can choose.
Please Log in or Create an account to join the conversation.
- PirateKitty
- Topic Author
Please Log in or Create an account to join the conversation.
- Androll
Please Log in or Create an account to join the conversation.
- PirateKitty
- Topic Author
I don't want to include depth into bloom. But when I'm done rewriting scatter, you should have the effect you want.Androll wrote: Hi, is there any chance for making simple depth check in bloom shader, so only depth = 1 gets bloomed, ie. only sky?
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.
- Androll
Please Log in or Create an account to join the conversation.
- GP-Unity
Please Log in or Create an account to join the conversation.
- PirateKitty
- Topic Author
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);
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.
Please Log in or Create an account to join the conversation.
- Marty McFly
OtisInf wrote:
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 ).PirateKitty wrote: Things to note:
-Blur between camera and focal point isn't photorealistic, main reason for that is speed.
Oh, I didn't know ppl cared about that, this is the first feedback I read concerning this. Sure can do
Please Log in or Create an account to join the conversation.
- piltrafus
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.
Please Log in or Create an account to join the conversation.
- PirateKitty
- Topic Author
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.
- Marty McFly
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 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.
Please Log in or Create an account to join the conversation.
- PirateKitty
- Topic Author
Dang bro, your shaders are such a P word!Just a suggestion: don't use "photorealistic". It's by far the most overused word in graphics programming and it has never been achieved.
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.
- OtisInf
Awesome news Looking forward to the update!Marty McFly wrote:
OtisInf wrote:
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 ).PirateKitty wrote: Things to note:
-Blur between camera and focal point isn't photorealistic, main reason for that is speed.
Oh, I didn't know ppl cared about that, this is the first feedback I read concerning this. Sure can do
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 ). 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.
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 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.
For screenshotting slow performance is fine though, shots are taken at massive resolutions anyway with very low framerates.
Please Log in or Create an account to join the conversation.
- PirateKitty
- Topic Author
The numbers I put in mine are for speed. You can always crank it up and even make forced macro shots.
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.For near blur bleed you need 2 buffers instead of one
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.gaps
Please Log in or Create an account to join the conversation.
- OtisInf
I think you do need 2, see: www.crytek.com/download/Sousa_Graphics_Gems_CryENGINE3.pdf , page 41 and further.PirateKitty wrote:
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.For near blur bleed you need 2 buffers instead of one
and more info from the author of the particular shader: www.gamedev.net/topic/675214-dof-near-field-bleeding/
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.
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.gaps
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
Please Log in or Create an account to join the conversation.
- PirateKitty
- Topic Author
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.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 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.
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.in particular. It would be cool if your shader has configuration parameters to achieve the latter too
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.
- Marty McFly
OtisInf wrote: 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 ). 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:
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.
Please Log in or Create an account to join the conversation.
- piltrafus
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?
Please Log in or Create an account to join the conversation.
- Marty McFly
Please Log in or Create an account to join the conversation.