Line thinning
- crabshank
- Topic Author
S-curves + Line thinning + Gamma on right (for the PES 2020 screenshots):
"DrawText_mod.fxh" for 2D input (like in my White Point and Grey gamma shaders):
Video shader version is here .
Please Log in or Create an account to join the conversation.
- Wicked Sick
EDIT: By the way. the split slider to test the changes should be default in all shaders and also in ReShade itself, maybe haha Thanks for this.
Please Log in or Create an account to join the conversation.
- crabshank
- Topic Author
Please Log in or Create an account to join the conversation.
- Wicked Sick
Please Log in or Create an account to join the conversation.
- Viper_Joe
Please Log in or Create an account to join the conversation.
- crabshank
- Topic Author
- TreyM
- crabshank
- Topic Author
EDIT: Just updated the code to add a final grey S-curve after the thinning as a finishing touch.
Please Log in or Create an account to join the conversation.
- TreyM
Please Log in or Create an account to join the conversation.
- Martigen
Really? This would be great for Borderlands to reduce the often exagerrated black outlines while maintaining the rest of the visuals.TreyM wrote: There is no need for this in gaming...
Just bizarre you've posted this response to him in two of his threads now. You may not be able to think of a use for a shader, but everyone else is not you.
Thank you Crabshank for sharing your shaders. Please keep doing so. The more shaders Reshade has, the more flexible and powerful it becomes.
Please Log in or Create an account to join the conversation.
- crabshank
- Topic Author
Martigen wrote:
Really? This would be great for Borderlands to reduce the often exagerrated black outlines while maintaining the rest of the visuals.TreyM wrote: There is no need for this in gaming...
Just bizarre you've posted this response to him in two of his threads now. You may not be able to think of a use for a shader, but everyone else is not you.
Thank you Crabshank for sharing your shaders. Please keep doing so. The more shaders Reshade has, the more flexible and powerful it becomes.
Just because you create something for one purpose doesn't mean it can't be useful for other things, this is the basis of ingenuity.
Please Log in or Create an account to join the conversation.
- TreyM
My response is not "bizarre." It's grounded in reality, and if you want to adjust the outlines in BL2, just go edit the shader manually in the game files.
Please Log in or Create an account to join the conversation.
- OtisInf
A ps shader running on the CPU?TreyM wrote: These are video filters designed to run on the CPU (you can see this easily if you look at the code) for dealing with artifacts from video codecs. Game input to reshade is not compressed with a codec... There is no need for these filters in reshade for gaming.
Video post processing also runs on GPUs, why bother doing that on a CPU if a GPU is much more efficient for that?
There's no need for this kind of reply, someone made a shader, you don't like it, big deal.My response is not "bizarre." It's grounded in reality, and if you want to adjust the outlines in BL2, just go edit the shader manually in the game files.
PS: your attitude like in the post above was the main reason I left the Reshade discord.
Please Log in or Create an account to join the conversation.
- TreyM
EDIT: Someone please lock this thread before it gets pointless.
Please Log in or Create an account to join the conversation.
- Marty McFly
That being said, the shaders from crabshank making excessive use of branching and often not leveraging vector types suggests that the original code (if it's a port) was originally done for something else than a shader language or the author is used to CPU programming so Trey isn't that far off with his assumption.
In which case I'd suggest to read up a bit on the ReShade reference, make use of newest UI widgets and also follow some coding style guideline to make it more readable for future maintainers - I ported many old ReShade shaders to newest format and more often than not it was a huge pain.
Personally I don't see a point in this shader since its changes are miniscule but then again, I think that about 80% of shaders and my opinion isn't universal. Let everyone have their opinions, as long as it's not insulting anyone, I guess it's fine.
@Otis: Lol I haven't noticed you left. Don't let your fun be spoiled by one singular person, that's what the blocking feature in Discord is for. If I left every Discord where I don't like someone, I would be on none. And you're also more than capable of voicing your opinion if you dislike something
@Trey: If you see no purpose in something, that's fine. If the shader is in fact useless, no one will use it, no harm done. As long as it's not bloating the ReShade repository, it's fine to share them, that's why we have this section.
@crabshank: It would be cool if you followed some coding guidelines since your code seems a bit all over the place but that might be due to me copying it from the browser. Useful variable names also help. Video cards dislike it a lot if you use branching, better use alternatives, Otis for example learned the hard way that in a DoF shader, it's faster to compute stuff you might need and then throw it away than only computing it if required. Branching is only fast when a lot of neighbouring pixels follow the same path and also larger code chunks are skipped. Also in several of your filters you reuse the same code, if you plan to add more shaders, consider using a common file for shared code. To only use luma, just do dot(color.rgb, 0.333) or some luma weight to compute it, miles faster than doing the entire HSV conversion.
Please Log in or Create an account to join the conversation.
- TreyM
Please Log in or Create an account to join the conversation.
- CeeJay.dk
Your interests and expertise supplement ours - we are better as a whole.
Trey have promised to improve going forward.
He has already taken the first and most important step and acknowledged that he is often rude, and wants to change that.
Please Log in or Create an account to join the conversation.
- crabshank
- Topic Author
Marty McFly wrote: Video stuff like H264 decoding also commonly runs on the CPU.
That being said, the shaders from crabshank making excessive use of branching and often not leveraging vector types suggests that the original code (if it's a port) was originally done for something else than a shader language or the author is used to CPU programming so Trey isn't that far off with his assumption.
In which case I'd suggest to read up a bit on the ReShade reference, make use of newest UI widgets and also follow some coding style guideline to make it more readable for future maintainers - I ported many old ReShade shaders to newest format and more often than not it was a huge pain.
Personally I don't see a point in this shader since its changes are miniscule but then again, I think that about 80% of shaders and my opinion isn't universal. Let everyone have their opinions, as long as it's not insulting anyone, I guess it's fine.
@Otis: Lol I haven't noticed you left. Don't let your fun be spoiled by one singular person, that's what the blocking feature in Discord is for. If I left every Discord where I don't like someone, I would be on none. And you're also more than capable of voicing your opinion if you dislike somethingI should know
@Trey: If you see no purpose in something, that's fine. If the shader is in fact useless, no one will use it, no harm done. As long as it's not bloating the ReShade repository, it's fine to share them, that's why we have this section.
@crabshank: It would be cool if you followed some coding guidelines since your code seems a bit all over the place but that might be due to me copying it from the browser. Useful variable names also help. Video cards dislike it a lot if you use branching, better use alternatives, Otis for example learned the hard way that in a DoF shader, it's faster to compute stuff you might need and then throw it away than only computing it if required. Branching is only fast when a lot of neighbouring pixels follow the same path and also larger code chunks are skipped. Also in several of your filters you reuse the same code, if you plan to add more shaders, consider using a common file for shared code. To only use luma, just do dot(color.rgb, 0.333) or some luma weight to compute it, miles faster than doing the entire HSV conversion.
@Marty McFly -
TL; DR: I don't fully know what you mean.
You've made me see that I'm a noob lol. When you speak of coding guidelines, I'm not sure what you mean because the .hlsl versions of my code look like a lot of other hlsl code I've seen. I don't know if such code is written differently for Reshade than for .hlsl but if it is I'd like to see the best practice for Reshade so that I could port it better. Until I know how best to do it I'll write code as I have been then re-port when I find out.
By branching I'm guessing you mean if statements but I don't know a better alternative, step functions?
Would adding a common file look like "#include "crabshanksCommon.fx";''? I've written the code the same way I would write Javascript. The variable names make sense to me but maybe that's just because I know the code intimately. I will look at optimisations once I'm sure everything's finalised and update then, thanks for your feedback.
@TreyM - I was wondering if you only posted on shaders you disagreed with.
Please Log in or Create an account to join the conversation.
- OtisInf
@crabshank: imperative programming doesn't work well in shaders, as it's not a single thread you're focusing on but a part that's run in parallel many times, and parallelism can only be reached if they're doing a lot of work that's equal, e.g. working on pixels that are next to each other. 'If statements' create different code paths and a 'wave' of threads therefore can't operate as a block over the data but has to wait for the various threads doing different work.
Often the if statement simply contains 2 different calculations, which is then assigned to a variable, and for that the ?: instruction is the best way, as it doesn't cause a branch. If an operation is very expensive it still hurts your performance if you calculate it and throw it away in situations, so in those cases precalculation is the best way (doing a pass over the data, calculate your new values and store them in a texture with a format that can contain the values, e.g. RG16 for 2 floats with 16bit precision)
E.g. you can write:
Please Log in or Create an account to join the conversation.
- crabshank
- Topic Author
Please Log in or Create an account to join the conversation.