Skip to content

Commit

Permalink
Merge pull request crosire#206 from Fubaxiusz/master
Browse files Browse the repository at this point in the history
  • Loading branch information
crosire committed Mar 25, 2020
2 parents f606113 + 068afa6 commit e33e97e
Show file tree
Hide file tree
Showing 4 changed files with 336 additions and 244 deletions.
14 changes: 7 additions & 7 deletions Shaders/FilmicAnamorphSharpen.fx
@@ -1,5 +1,5 @@
/*
Filmic Anamorph Sharpen PS v1.4.1 (c) 2018 Jakub Maximilian Fober
Filmic Anamorph Sharpen PS v1.4.3 (c) 2018 Jakub Maximilian Fober
This work is licensed under the Creative Commons
Attribution-ShareAlike 4.0 International License.
Expand All @@ -16,33 +16,30 @@ http://creativecommons.org/licenses/by-sa/4.0/.

uniform float Strength < __UNIFORM_SLIDER_FLOAT1
ui_label = "Strength";
ui_category = "Settings";
ui_min = 0.0; ui_max = 100.0; ui_step = 0.01;
> = 60.0;

uniform float Offset < __UNIFORM_SLIDER_FLOAT1
ui_label = "Radius";
ui_tooltip = "High-pass cross offset in pixels";
ui_category = "Settings";
ui_min = 0.0; ui_max = 2.0; ui_step = 0.01;
> = 0.1;

uniform float Clamp < __UNIFORM_SLIDER_FLOAT1
ui_label = "Clamping";
ui_category = "Settings";
ui_min = 0.5; ui_max = 1.0; ui_step = 0.001;
> = 0.65;

uniform bool UseMask < __UNIFORM_INPUT_BOOL1
ui_label = "Sharpen only center";
ui_category = "Settings";
ui_tooltip = "Sharpen only in center of the image";
> = false;

uniform bool DepthMask < __UNIFORM_INPUT_BOOL1
ui_label = "Enable depth rim masking";
ui_tooltip = "Depth high-pass mask switch";
ui_category = "Depth mask";
ui_category_closed = true;
> = false;

uniform int DepthMaskContrast < __UNIFORM_DRAG_INT1
Expand All @@ -57,6 +54,7 @@ uniform int Coefficient < __UNIFORM_RADIO_INT1
ui_label = "YUV coefficients";
ui_items = "BT.709 - digital\0BT.601 - analog\0";
ui_category = "Additional settings";
ui_category_closed = true;
> = 0;

uniform bool Preview < __UNIFORM_INPUT_BOOL1
Expand All @@ -65,6 +63,7 @@ uniform bool Preview < __UNIFORM_INPUT_BOOL1
"If you don't see red strokes,\n"
"try changing Preprocessor Definitions in the Settings tab.";
ui_category = "Debug View";
ui_category_closed = true;
> = false;


Expand Down Expand Up @@ -98,7 +97,7 @@ float Overlay(float LayerAB)
}

// Sharpen pass
float3 FilmicAnamorphSharpenPS(float4 vois : SV_Position, float2 UvCoord : TexCoord) : SV_Target
float3 FilmicAnamorphSharpenPS(float4 pos : SV_Position, float2 UvCoord : TEXCOORD0) : SV_Target
{
// Sample display image
float3 Source = tex2D(ReShade::BackBuffer, UvCoord).rgb;
Expand Down Expand Up @@ -196,7 +195,8 @@ float3 FilmicAnamorphSharpenPS(float4 vois : SV_Position, float2 UvCoord : TexCo
// Luma high-pass color
float HighPassColor = 0.0;
[unroll]
for(int s = 0; s < 4; s++) HighPassColor += dot(tex2D(ReShade::BackBuffer, NorSouWesEst[s]).rgb, LumaCoefficient);
for(int s = 0; s < 4; s++)
HighPassColor += dot(tex2D(ReShade::BackBuffer, NorSouWesEst[s]).rgb, LumaCoefficient);
HighPassColor = 0.5 - 0.5 * (HighPassColor * 0.25 - dot(Source, LumaCoefficient));

// Sharpen strength
Expand Down

0 comments on commit e33e97e

Please sign in to comment.