Pirate Shaders For Reshade3 (Yar!)

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

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.

It's my sense of humor, it made me giggle.Sorry if it bothered you.

I rarely look at others codes and the only code I looked at that may be yours is the normal generation. So don't say a lot when it's one snippet and inspired, well, it has been commented where it was from since the very first release here. I could remove it as well, I think I solved the problem I had a while ago, was just too lazy to move over.

Most of my reshade code has been a port from my shaders for ENB from 2013. They are still in the Nexus if you want to look at them. Sorry if my humor bothered you, but there's no need to make insinuations like that.

the face is in focus but it's color bleeds into the out of focus area.

Mine doesn't have this issue, so yeah, no point in discussing this here.
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 #62 by PirateKitty
Replied by PirateKitty on topic Pirate Shaders For Reshade3 (Yar!)
Did a rewrite of how normals work. Now it properly takes FOV into consideration, giving much better results to normal & projection dependent effects. Alongside with this change, AO will be receiving an update, it will only be doing AO and it's now looking even better. Global Illumination has been rewritten already and now runs separate from AO. The effect is looking a lot more natural.




This is with only the diffuse applied, but GI will be receiving a reflective effect as well. If free-time allows, it should be done by the weekend.
Feel free to leave comments/suggestions.
Last edit: 4 years 11 months ago by PirateKitty.
The following user(s) said Thank You: Genrix, GP-Unity

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

More
4 years 11 months ago #63 by Martigen
Replied by Martigen on topic Pirate Shaders For Reshade3 (Yar!)
:woohoo:

Also, thanks for all your work, love your shaders!
The following user(s) said Thank You: PirateKitty

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

More
4 years 11 months ago #64 by PirateKitty
Replied by PirateKitty on topic Pirate Shaders For Reshade3 (Yar!)
Somewhat large update done to the way normals are done, AO and GI. I'm also working on a horizon option for AO for later.

Didn't have time to make a proper tutorial, so this wont be a full release, more like for testing, go for the master.zip or clone.

Quick guide on how to set up depth and normals:
0. Gotta have the Preprocess and AO on at least, Pre on top, AO under it
1. Make sure depth is working as intended, black for near objects, white for far. Smooth linear looking gradient.
2. Go to a place in game where you have a flat floor and flat walls around you, possibly flat ceiling too.
3. Turn on FoV config toggle
4. Now mess with the FoV value until those long flat surfaces have a single shade instead of being a gradient. The closer you get to a single color per surface the better.

This is how it looks for me on Grimrock2 with FoV set to 75. This is what you want to see, single grey colors for any flat surfaces.


I will do a more in-depth tutorial whenever I have time.
The following user(s) said Thank You: Gar Stazi, Sinclair

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

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

Somewhat large update done to the way normals are done, AO and GI. I'm also working on a horizon option for AO for later.

Didn't have time to make a proper tutorial, so this wont be a full release, more like for testing, go for the master.zip or clone.

Quick guide on how to set up depth and normals:
0. Gotta have the Preprocess and AO on at least, Pre on top, AO under it
1. Make sure depth is working as intended, black for near objects, white for far. Smooth linear looking gradient.
2. Go to a place in game where you have a flat floor and flat walls around you, possibly flat ceiling too.
3. Turn on FoV config toggle
4. Now mess with the FoV value until those long flat surfaces have a single shade instead of being a gradient. The closer you get to a single color per surface the better.

This is how it looks for me on Grimrock2 with FoV set to 75. This is what you want to see, single grey colors for any flat surfaces.


I will do a more in-depth tutorial whenever I have time.

idk what the problem is currently comparing code between mxao and reshade values for detecting depth to maybe see a messup but your ao/gi/dof dont get any info using the correct depth settings that work on some games where if i use default reshade shader packages mxao works correctly along with the dof , unity engine games are upside down with mxao i set this and it works correctly , when i use yours it keeps showing nothing inside the buffer any idea what would be causing this ?

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

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

But preprocess always has to be on for the depth effects and above the other depth effects in the list. You can click and drag to reorder if needed.

The main depth buffer should be the same regardless of what shaders are on.

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

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

No idea.

But preprocess always has to be on for the depth effects and above the other depth effects in the list. You can click and drag to reorder if needed.

The main depth buffer should be the same regardless of what shaders are on.

just curiosity why did you add in a option for depth buffer type when reshade handles this its self? Cause when i use mxao which uses how reshade determines the buffer type the correct one works correctly but when i use your shaders on random games literally random engine doesnt seem to matter and i use the buffer type it should be, nothing is inside it ive got games where enabling log depth is only way for it to show when its not a log depth buffer. Im just confused how this can happen when the code put in is correct for converting is it possible its running again over what reshade is doing and not getting the correct depth info on some games ?

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

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

just curiosity why did you add in a option for depth buffer type when reshade handles this its self?

Reshade handles it inside reshade.fxh. Since I have to use miplevels and normals in most of my depth based effects, there's no reason to re-do the same process to each shader, which would happen if I were to get rid of that unified depth effect file. It's a way of not wasting FPS.

enabling log depth is only way for it to show when its not a log depth buffer.

By default, reshade linearization is akin to setting farplane on in my shader with the farplane set to 1000. Most games require that to be on.


There's no reason why you can see depth using other shaders but can't see it using mine. Take a screenshot of a game where this happens with your shader settings open. Can't really help you debug unless I get a lot more info with what settings you have on reshade depth and then on my preprocess to compare.

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

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

the face is in focus but it's color bleeds into the out of focus area.

Mine doesn't have this issue, so yeah, no point in discussing this here.

That's great, but the other issue I referred to, you ignore, and that's actually the issue that made me reply in this thread in the first place. The paper / article I linked to discuss 2 parts: 1) the bleed of in-focus pixels into the far plan (you say you don't have that problem, good), and 2) the bleed of near-plane pixels into the in-focus plane. You don't do this, and neither of the existing Reshade dofs do this. Point 2) is what I was referring to.

You need two buffers for this: one for the in-focus plane + far plane (near plane isn't blurred) and one for the near-plane + alpha blur (which consists of only near plane pixels, blurred with alpha). The result of the second part is blended with the result of the first part to create the needed bleed of near-plane pixels into the in-focus plane. Blur is done this way: you blur the complete buffer where a pixel which isn't in the near plane is replaced with a transparent pixel: color fragments are only used when the source pixel read is in the near-plane. Alpha is always used.

It's not easy, but it's IMHO essential for creating nice looking near-plane blur.
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 #70 by PirateKitty
Replied by PirateKitty on topic Pirate Shaders For Reshade3 (Yar!)
I've already added it. And a while back too. It probably passed unoticed in that silly argument.

And no. You don't need two buffers for that.
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 #71 by OtisInf
Replied by OtisInf on topic Pirate Shaders For Reshade3 (Yar!)

I've already added it. And a while back too. It probably passed unoticed in that silly argument.

It's not a silly argument, but a valid one. Please try to be less annoying when someone gives feedback on your code. People don't have to do that, you know.

And no. You don't need two buffers for that.

Interesting that everyone who has ever written a dof shader and written an article or paper about it and implemented this feature has used 2 buffers, but you can do it in one. Thing is: how would you do it in 1 buffer if the pixel which is in focus is not blurred for the focus->far plane pass, but IS blurred for the near->focus pass (due to blending)? (I know you can also do it by modifying the CoC for near plane pixels, but afaik, that gives less good results (see paper written by COD developer regarding their dof and this problem)

(edit) Let's try this magical 1 buffer dof which implements this.


See the pole in the area I marked? It's in focus. The blurry square in front if it is in near plane, and blurred. Its edge is very sharp however, where it edges the in-focus pole, which is wrong: it should have been blurry there, like with a real lens, if you indeed would have implemented this. I.e. it should bleed the blur into the in-focus plane, like the paper I linked to discussed and what I was trying to tell you a couple of times.

Now, don't get me wrong, I don't mind if you haven't implemented this, it's free stuff you put online for free, and you have no obligation to anyone. I write OSS software for a long time, I know the drill. The thing is: if I ask you if you would like to implement this and you tell me you have and that what's needed is wrong and you know better, then it's a bit odd it actually turns out not to be the case, don't you think?

Anyway, the DOF should pick the linearization settings from the reshade settings, IMHO. It's also hard to use, as what one wants is to point at a coord which should be in-focus, or at least define a plane on the camera look vector which is in-focus and an area around that plane which is in focus. The area before that in-focus area is near-plane and affected by near-plane blur curves, the area after that in-focus area is the far-plane and affected by the far plane curve. That gives a fixed set to work with. your settings confuse as the focus area is moved when you change the various settings: so it's very hard to focus on an area which should be in-focus.

I spent 10 minutes fiddling with the settings to get more blur in the far plane but each time I changed a setting the focus area moved, i.e. towards the camera. This of course doesn't work: the focus area should be around the in-focus plane, not move. Perhaps it's me, but it's now not user friendly IMHO.

(edit2). Ah, I see DOF_P_WORD_NEAR, in a cfg file. Setting it up with texture quality 1.0 and manual focus, will give me 1 plane (near plane) blur which 'bleeds' (not really nicely tho, the blur isn't great. I used 25 taps in my tests). But no far plane. It's impossible to setup a focal plane with a near and far with manual focus, and have the near plane bleed into the focal plane. I tried all additional settings for log buffer / inverse (this is the witcher3, which uses an inversed log depth buffer).

Switching off DOF_USE_LENS_SCRATCH gives a compile error btw:
28/12/2016 17:52:34:590 [03972] | ERROR | Failed to compile 'C:\Program Files (x86)\GalaxyClient\Games\The Witcher 3 Wild Hunt\bin\x64\reshade-shaders\Shaders\Pirate_Depth.fx':
C:\Program Files (x86)\GalaxyClient\Games\The Witcher 3 Wild Hunt\bin\x64\reshade-shaders\Shaders\Pirate_Depth_DOF.fxh(311, 56): error X3004: undeclared identifier 'SamplerLensScratches'
C:\Program Files (x86)\GalaxyClient\Games\The Witcher 3 Wild Hunt\bin\x64\reshade-shaders\Shaders\Pirate_Depth_DOF.fxh(311, 76): error X3000: syntax error: unexpected ','

Which is here: github.com/Heathen/Pirate-Shaders/blob/m...e_Depth_DOF.fxh#L311
which is logical, as the variable is defined here:
github.com/Heathen/Pirate-Shaders/blob/m...e_Depth_DOF.fxh#L311
which of course isn't going to be defined if scratch is switched off.

So, I had a simple request to setup a focus point, which defines the focus plane orthogonal on the camera look vector, and near / far planes which are blurred, and I couldn't get it to work: either only near plane with the blur bleed (but no far plane) or both (after fiddling with the settings till the focus area is moved at the right spot) and no blur overlap.

Anyway, enough time wasted on this. Do with the feedback what you want.
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 #72 by Kleio420
Replied by Kleio420 on topic Pirate Shaders For Reshade3 (Yar!)

I've already added it. And a while back too. It probably passed unoticed in that silly argument.

And no. You don't need two buffers for that.

you asked for an example of your shader buffer not working correctly here's said example just in one game many games have this issue idk y and all default settings btw.You can clearly see theres nothing inside that buffer , this game is a dx9 game with a normal buffer for the most part if i inverse it your shaders work yet martys do not correctly something is wrong here.Open gl and unity games are far worse then this sounds like something on your end just my opinion do what you want with it , also my opinion your shaders are a different look and something new and a nice change then the same stuff we have had for the last what 4 months which is why im giving feedback of what i believe is a bug.

Mxao example: imgur.com/zukfsHs


pirate shader ssao example: i.imgur.com/rsygCqz.png

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

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

It's not a silly argument, but a valid one. Please try to be less annoying when someone gives feedback on your code. People don't have to do that, you know.

I wasn't referring to the arguments over DoF or anything you have said.

Interesting that everyone who has ever written a dof shader and written an article or paper about it and implemented this feature has used 2 buffers, but you can do it in one.

I actually have two "buffers" for the dof, but for a different reason. It's the same reason why most blurs use two textures. Since you want to get technical, I can explain to you what I'm doing and why.

The kind of dof I'm doing is based on circle of confusion. The reason why that sharp transition happens in your example is that when we look at the pixels that are in focus there, we decide either we don't do anything to it, or if the code is wasteful, it does a tiny coc that doesn't blur anything. This why you have a sudden transition from in focus to out of focus when it's the near plane, because this is the effect you want for far planes, otherwise, like in that face example, the colors bleed out.

One solution would be, you use variable coc for the far plane, then a fixed coc for near plane, then smartly blend them together so the nearplane can bleed out. This is one way of doing what you mention as being two buffers. What I do is different and it was a conscious choice, as I know it only blurs outwards (And I will explain why in the next paragraph). I simply read the focus data ahead of time, instead of during blur, to know the coc size. By using the appropriate blur range, it naturally gathers the out of focus pixels from the near plane, so it bleeds out. The disadvantage of this is that I can't simply tell the code to ignore pixels that are apparently in focus. I know I can increase performance on it a bit more, just haven't had time to get around to do it. In any case, it's a bit more photorealistic than most of other options. It would be even more if I cared to blur in as well as out for the near plane. I suppose I could work on that whenever I mess with DoF again.

Now, for actual photorealistic renders, and this has nothing to do with gaming, whenever I have to use a low number of samples and provide a realistic dof, I split the scene in near and far plane. This is because I have to actually render what is behind the near objects I want to blur. The reason behind this is that photons from one side of the lens can actually see behind a given near object compared to photons in front or on the other side of the lens. With small enough objects, you can fully see through them when you have a wide aperture and they are out of focus near the camera. You could implement this in a gaming engine, for sure, but that's beyond that reshade allows us to do.

I hope this clarifies a bit.

Anyway, the DOF should pick the linearization settings from the reshade settings, IMHO

I'm going to be adding this option, for all depth effects. Only caveat is that people will have to download reshade.fxh from the default shader package in order to use it. This will help you with your witcher 3 issue.

Switching off DOF_USE_LENS_SCRATCH gives a compile error btw:

Thanks for letting me know. I missed that when I added the near blur. Should fix it next time I update the shaders.

im giving feedback of what i believe is a bug.

Hopefully when I add the option to use the default reshade depth settings, this will stop happening for you. It still seems like it's not setup right and I know it's not as easy to set up.
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 #74 by PirateKitty
Replied by PirateKitty on topic Pirate Shaders For Reshade3 (Yar!)
Fixed the DOF_USE_LENS_SCRATCH compile error when using near blur and added the ability to use reshade's default linearization.

In order to use it, you need to download it from raw.githubusercontent.com/crosire/reshad.../Shaders/ReShade.fxh or let reshade download the default shader package and then turn it on in pirate_depth.cfg.

Edit: You still have to use preprocess and still have to configure FoV for AO and GI. But the linearization settings like farplane, log, invert, etc are all set like you would in other shaders.
Last edit: 4 years 11 months ago by PirateKitty.
The following user(s) said Thank You: Sinclair

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

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

Fixed the DOF_USE_LENS_SCRATCH compile error when using near blur and added the ability to use reshade's default linearization.

In order to use it, you need to download it from raw.githubusercontent.com/crosire/reshad.../Shaders/ReShade.fxh or let reshade download the default shader package and then turn it on in pirate_depth.cfg.

Edit: You still have to use preprocess and still have to configure FoV for AO and GI. But the linearization settings like farplane, log, invert, etc are all set like you would in other shaders.

there lays the problem your pre-processor settings is incorrect causing any depth info for those effects to either not be there or completely wrong dof has the same issue its how i figured the depth was wrong and im sure its the problem they are having with your dof cause its rendering incorrectly if the depth is correct it behaves differently when its not it looks right but you get weird spots in it that arnt right.

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

More
4 years 11 months ago #76 by OtisInf
Replied by OtisInf on topic Pirate Shaders For Reshade3 (Yar!)
Thanks for clearing that up. I know how dof works technically, but didn't anticipate on doing it this way.

Still it might be a good idea to create some user-facing settings which you internally translate to real variables, so it's easier to setup for a user. Currently, as I said, I couldn't get the overlap feature to work and also a far-plane blur (everything stayed in-focus after the blurred near plane, up to the horizon). This should be easier to do for a user.

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

More
4 years 11 months ago #77 by PirateKitty
Replied by PirateKitty on topic Pirate Shaders For Reshade3 (Yar!)
Both you guys problems should be fixed with a proper tutorial on how to set things up and also on each shader.

Still it might be a good idea to create some user-facing settings which you internally translate to real variables

My blender shaders actually use aperture, lens size, lens to sensor distance, etc, so you can mimic real life lenses. But then you run into the problem that most people don't know lens terms either and we end in the same situation. The best I can do is provide a tutorial and give examples on what the settings do.

I couldn't get the overlap feature to work and also a far-plane blur (everything stayed in-focus after the blurred near plane, up to the horizon). This should be easier to do for a user.

Set hyperfocal to 1.0, Focal range to 0.0 and drop focal curve under 1.0. You can also increase near/far strength to adjust the kind of effect you want. I know the near plane isn't blending as well as it could be with the focal plane, I will work a bit more on it when I have time, try to make it look better. Right now it's doing a quick jump from 100% in focus to 50/50 near/focus on the first blurred pixel in the worst case scenarios. This should be a much smoother transition, which I will have to fix later.
The following user(s) said Thank You: jminternelia, Sinclair

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

More
4 years 7 months ago #78 by Insomnia
Replied by Insomnia on topic Pirate Shaders For Reshade3 (Yar!)
Love your shaders!! Using your eye adaptation on top of the load order before anything.
I also like your bloom very much, and would like to ask if it is possible for you to add a depth function to the bloom shader so bright spots near the camera such as armour, specular on grounds or water puddles triggers the bloom. :)

Thank you so much for your shaders!

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

More
4 years 6 months ago - 4 years 6 months ago #79 by Piereligio
Replied by Piereligio on topic Pirate Shaders For Reshade3 (Yar!)

Initial release of my shaders for Reshade 3.0

Distributed as is. I haven't tested it with other shaders, but should work anyway. Delete any .fx files you're not using to compile faster. The folder structure is the same generated from reshade, so putting the files in shouldn't be a big deal.

Effects included:
-Bloom
-Contrast Curve
-FXAA
-Light Adaptation (Auto contrast, equalization and exposure)
-Luma Sharpen
-SSAO + Illumination + Scatter (Alchemy AO included as an alternative)
-1D Tonemap (Includes a few examples in the texture folder, if you want a more complex tonemap, try 3Dtonemap aka LUT that is available in other shaders)
-Vibrance
-Vignette

Effects that have settings outside of the in-game shift+f2 menu have an included .cfg file where you can find those settings. Most of these settings are things you can't change without recompiling shaders, so after you change the .cfg rile, just reload the shaders in game to see the changes.

Github link. Download the latest master.zip or check releases.


Hi, I'm having a weird "dots" look with GI shader, is it normal? I'm trying it on assetto corsa. I hope there's a solution, for the rest it works awesome!
Last edit: 4 years 6 months ago by Piereligio.

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

More
4 years 1 month ago #80 by DannyG
Replied by DannyG on topic Pirate Shaders For Reshade3 (Yar!)
Dude. Doooood. Will you port Posterize? I want to fix Borderlands'... khe-khem... "cel-shading".

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