-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feedback request for Contrast Adaptive Sharpening shader port #9711
Comments
Hi, I added #ifdef HOOKED_gather
vec4 red_efhi = HOOKED_gather(HOOKED_pos + 0.5 * HOOKED_pt, 0);
vec3 e = vec3( red_efhi.w, red_efhi.w, red_efhi.w);
vec3 f = vec3( red_efhi.z, red_efhi.z, red_efhi.z);
vec3 h = vec3( red_efhi.x, red_efhi.x, red_efhi.x);
vec3 i = vec3( red_efhi.y, red_efhi.y, red_efhi.y);
vec4 green_efhi = HOOKED_gather(HOOKED_pos + 0.5 * HOOKED_pt, 1);
e.g = green_efhi.w;
f.g = green_efhi.z;
h.g = green_efhi.x;
i.g = green_efhi.y;
vec4 blue_efhi = HOOKED_gather(HOOKED_pos + 0.5 * HOOKED_pt, 2);
e.b = blue_efhi.w;
f.b = blue_efhi.z;
h.b = blue_efhi.x;
i.b = blue_efhi.y;
#else
vec3 e = ori.rgb;
vec3 f = HOOKED_texOff(vec2(1.0, 0.0)).rgb;
vec3 h = HOOKED_texOff(vec2(0.0, -1.0)).rgb;
vec3 i = HOOKED_texOff(vec2(1.0, -1.0)).rgb;
#endif |
Did you test it? Does it work on your end? On
Edit: I just saw that you added them very recently. So it makes sense that my build does not have that macro yet. As long as it works as it should, it should be fine though. |
I tested that it compiles, not that the output is correct. It's possible that the channel order is different between HLSL and GLSL gather functions, which would require changing the indices. |
I have modified the code to take into account gather operations and texture coordinates. I think it should work properly, assuming |
@haasn Do you know which colorspace is used during the processing of mpv pixel shaders? Apparently CAS should be working in linear colorspace and I would like to know if there is a way to request linear colorspace from the shader code. Edit: So, I have implemented sRGB to linear and vice versa conversions via in-shader operations. Hopefully, the implementation is correct. If there is a mistake or a better way to lookup linear values, I would like to know. |
I have ported AMD's Contrast Adaptive Sharpening shader to mpv along with ReShade's modifications. However, since this is my first shader port, I would appreciate some feedback from more experienced mpv shader developers before possibly including it in the wiki.
The text was updated successfully, but these errors were encountered: