@5am If there is "Sharpness" filter on mac and you don't use it, then you can replace the shader program of the filter (named "sharpness.effect") by this text:
C:
// Based on Sharpness shader of OBS Studio v27.0.0,
// And https://github.com/Oncorporation/obs-shaderfilter/
uniform float4x4 ViewProj;
uniform texture2d image;
uniform float sharpness;
uniform float texture_width;
uniform float texture_height;
sampler_state def_sampler {
Filter = Linear;
AddressU = Clamp;
AddressV = Clamp;
};
struct VertData {
float4 pos : POSITION;
float2 uv : TEXCOORD0;
};
VertData VSDefault(VertData v_in)
{
VertData vert_out;
vert_out.pos = mul(float4(v_in.pos.xyz, 1.0), ViewProj);
vert_out.uv = v_in.uv;
return vert_out;
}
float4 PSDrawBare(VertData v_in) : TARGET
{
int center_x_percent = 50;
int center_y_percent = 50;
float power = -sharpness;
float2 uv_pixel_interval;
uv_pixel_interval.x = 1.0 / texture_width;
uv_pixel_interval.y = 1.0 / texture_height;
float2 center_pos = float2(center_x_percent * .01, center_y_percent * .01);
float2 uv = v_in.uv;
float b;
if (uv_pixel_interval.x < uv_pixel_interval.y){
b = center_pos.x;
} else {
b = center_pos.y;
}
uv = center_pos + normalize(v_in.uv - center_pos) * atan(distance(center_pos, v_in.uv) * -power * 10.0) * b / atan(-power * b * 10.0);
return image.Sample(def_sampler, uv);
}
technique Draw
{
pass
{
vertex_shader = VSDefault(v_in);
pixel_shader = PSDrawBare(v_in);
}
}
Now the OBS Studio filter named Sharpness will start to act like "unfish" (the sharpness value now controls the amount of the distortion, 0.18 is OK for the image provided by the topic starter).
And keep copy of the original "sharpness.effect" just in case.
Hi Suslik,
thank you so much for your efforts, I've registered here to to reply here, I too been having this issue on macOS for a long time, I did as follows, renamed the file sharpness.effect to sharpness.bak and then put the above in place, although sharpen is there to select, there are no options to adjust anything, no bar, nothing. I double check the code maybe I didn't copy correctly but all is is exact.
Then....SUCCESS folks, it really works!!!
Right click on the newly created file sharpness.effect , then select get info, under name & extension you will see a box underneath labelled hide extension make sure it is unticked, then goto file name and you may well see it is actually sharpness.effect.txt , yes remove the txt and thats it, start obs and slider will appear after applying the sharpen filter to the input vid.
Big one to Suslik, nice one!!!!
Dee