-
Notifications
You must be signed in to change notification settings - Fork 418
Update AdaptiveSharpen, Colourfulness, FXAA, SMAA #63
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
Conversation
iryoku/smaa pull request 11: Fix incorrect calculation of local contrast adaption in color edge detection
Raise max limits for settings according to comments in SMAA.fxh
- FXAA_LINEAR_LIGHT, run FXAA in linear or gamma corrected light - Fix luma pass gamma correction mismatch
| float4 FXAALumaPass(float4 vpos : SV_Position, noperspective float2 texcoord : TEXCOORD) : SV_Target | ||
| { | ||
| float4 color = tex2D(ReShade::BackBuffer, texcoord.xy); | ||
| color.a = sqrt(dot(color.rgb*color.rgb, float3(0.299, 0.587, 0.114))); |
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.
Why use the square of the color?
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 lightness/luma weights should be multiplied with the color in linear light to be correct. It can be done in gamma light with some error but the speed difference is negligible.
Before, color was decoded with sRGB gamma and then encoded in the alpha channel with 1/2.0 gamma, resulting in slight error in lightness. Now its decoded with 2.0 gamma and encoded with 1/2.0 gamma.
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.
Ah. I see. Didn't realize the change in the line right above.
| // Calculate left-left and top-top deltas: | ||
| float3 Cleftleft = SMAASamplePoint(colorTex, offset[2].xy).rgb; | ||
| t = abs(C - Cleftleft); | ||
| t = abs(Cleft - Cleftleft); |
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.
Not sure what this change does. It reduces the distance between the two samples the delta is calculated of, but why?
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.
Not sure if it helps but this is the commit for that particular change with explanation. :)
iryoku/smaa#11
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.
Under luma edge detection the Calculate left-left and top-top deltas are computed with left & leftleft and top & toptop pixels ( line 730 ). But for the Color Edge Detection it uses the center pixel instead of the left and top one.
Both ways cant be correct! Im not so sure anymore which one is correct, perhaps I should send a mail to Jorge Jimenez and ask politely.
No description provided.