1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2024-10-05 18:40:49 +01:00

Fix screen brightness consistency in some scenarios.

This commit is contained in:
Filippo Scognamiglio 2018-11-08 23:51:06 +01:00
parent 56e1d80cf4
commit 0a95c5dff3

View File

@ -55,6 +55,8 @@ ShaderEffect {
property real flickering: appSettings.flickering property real flickering: appSettings.flickering
property real horizontalSync: appSettings.horizontalSync * 0.5 property real horizontalSync: appSettings.horizontalSync * 0.5
property int rasterization: appSettings.rasterization
property bool frameReflections: appSettings.frameReflections property bool frameReflections: appSettings.frameReflections
property real disp_top: (frame.displacementTop * appSettings.windowScaling) / height property real disp_top: (frame.displacementTop * appSettings.windowScaling) / height
@ -62,7 +64,7 @@ ShaderEffect {
property real disp_left: (frame.displacementLeft * appSettings.windowScaling) / width property real disp_left: (frame.displacementLeft * appSettings.windowScaling) / width
property real disp_right: (frame.displacementRight * appSettings.windowScaling) / width property real disp_right: (frame.displacementRight * appSettings.windowScaling) / width
property real screen_brightness: appSettings.brightness * 1.5 + 0.5 property real screen_brightness: Utils.lint(0.5, 1.5, appSettings.brightness)
property real dispX property real dispX
property real dispY property real dispY
@ -171,7 +173,7 @@ ShaderEffect {
uniform highp float dispX; uniform highp float dispX;
uniform highp float dispY;" + uniform highp float dispY;" +
(appSettings.rasterization != appSettings.no_rasterization ? (rasterization != appSettings.no_rasterization ?
"uniform lowp sampler2D rasterizationSource;" : "") + "uniform lowp sampler2D rasterizationSource;" : "") +
(bloom !== 0 ? " (bloom !== 0 ? "
@ -308,7 +310,8 @@ ShaderEffect {
: :
"vec3 finalColor = mix(backgroundColor.rgb, fontColor.rgb, greyscale_color);") + "vec3 finalColor = mix(backgroundColor.rgb, fontColor.rgb, greyscale_color);") +
(appSettings.rasterization != appSettings.no_rasterization ? " (rasterization != appSettings.no_rasterization ? "
finalColor *= 2.0;
finalColor *= texture2D(rasterizationSource, staticCoords * (virtual_resolution)).rgb; finalColor *= texture2D(rasterizationSource, staticCoords * (virtual_resolution)).rgb;
" : "") + " : "") +