-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
GS: Add gamma control to ShadeBoost #12653
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
base: master
Are you sure you want to change the base?
Conversation
I had a doubt about that, I saw those weird spacing in the git diff but in my text editor don't appear. I would see if I can change them. |
You are using spaces not tabs. |
ca28159
to
1d1905a
Compare
I still have errors... |
@@ -30,6 +30,7 @@ vec4 ContrastSaturationBrightness(vec4 color) | |||
float brt = params.x; | |||
float con = params.y; | |||
float sat = params.z; | |||
float gam = params.w; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still using spaces here.
1d1905a
to
482dd50
Compare
I think it's ok now, sorry for the problems. |
Do you plan to add these to Direct3D 11 and 12? |
I hadn’t planned on it, but I have no problem doing it if you’d like. At a glance, it should be pretty much the same. |
It would be good to have it on all backends if possible. |
482dd50
to
ada37e2
Compare
I believe this change is sufficient for Direct3D 11 and 12, but I have no way to verify that it works. I would appreciate it if someone could test it so I can make any necessary adjustments. |
idk if the shadercache version needs bumped |
Tested on the Windows side, the following changes makes the dx11 shader changes work. float3 satColor = lerp(intensity, brtColor, sat);
float3 conColor = lerp(AvgLumin, satColor, con);
- vec3 csb = conColor;
- csb = pow(csb, vec3(1.0 / gam));
+ float gam_inv = 1.0/gam;
+ float3 csb = conColor;
+ csb = pow(csb, float3(gam_inv, gam_inv, gam_inv));
color.rgb = csb;
return color; Also, the new GUI control does not follow the enable/disable state from the shadeboost checkbox. Other than that, it seems to work. 👍 |
color.rgb = conColor; | ||
|
||
vec3 csb = conColor; | ||
csb = pow(csb, vec3(1.0 / gam)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
float3, same for the above.
@@ -4334,6 +4334,8 @@ void FullscreenUI::DrawGraphicsSettingsPage(SettingsInterface* bsi, bool show_ad | |||
"ShadeBoost_Contrast", 50, 1, 100, "%d", shadeboost_active); | |||
DrawIntRangeSetting(bsi, FSUI_CSTR("Shade Boost Saturation"), FSUI_CSTR("Adjusts saturation. 50 is normal."), "EmuCore/GS", | |||
"ShadeBoost_Saturation", 50, 1, 100, "%d", shadeboost_active); | |||
DrawIntRangeSetting(bsi, FSUI_CSTR("Shade Boost Gamma"), FSUI_CSTR("Adjusts gamma. 50 is normal."), "EmuCore/GS", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to move it between contrast and saturation to keep alphabetical order, same for other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metal remaining.
That might be good for another PR, to make that tab more organized. There's probably enough room for nice sliders too while at it. |
ada37e2
to
f0f7887
Compare
In this last commit I have changed:
What I didn't do:
As is obvious, if any problems are encountered whether in dx11/12 or metal I'll be glad to fix them. |
https://github.com/PCSX2/pcsx2/blob/master/pcsx2/ShaderCacheVersion.h#L6 You'll want to increment the shader cache version by one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The macOS compile is failing because cb
in Metal is currently declared as a float3
, which has no w
. You should change it to a float4
.
@@ -417,6 +417,7 @@ fragment float4 ps_shadeboost(float4 p [[position]], DirectReadTextureIn<float> | |||
const float brt = cb.x; | |||
const float con = cb.y; | |||
const float sat = cb.z; | |||
const float gam = cb.w; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const float gam = cb.w; | |
const float gam = cb.w; |
f0f7887
to
5e3a894
Compare
5e3a894
to
6f4921e
Compare
Description of Changes
Rationale behind Changes
Gamma control lets users adjust mid-tones independently of brightness/contrast/saturation. Fulfills feature request #12515.
Suggested Testing Steps