From a9e5901f106d385b31c78b5bf316e9297a1c2df9 Mon Sep 17 00:00:00 2001 From: Frost Date: Sat, 2 Oct 2021 12:29:56 -0700 Subject: [PATCH] Add frame gloss setting Lets you turn off the bright reflections. --- app/qml/ApplicationSettings.qml | 3 +++ app/qml/SettingsTerminalTab.qml | 5 +++++ app/qml/ShaderTerminal.qml | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/qml/ApplicationSettings.qml b/app/qml/ApplicationSettings.qml index 4c27ba0..1339cb4 100644 --- a/app/qml/ApplicationSettings.qml +++ b/app/qml/ApplicationSettings.qml @@ -92,6 +92,7 @@ QtObject { property real chromaColor: 0.25 property real saturationColor: 0.25 + property real frameGloss: 0 property real jitter: 0.2 @@ -259,6 +260,7 @@ QtObject { "staticNoise": staticNoise, "chromaColor": chromaColor, "saturationColor": saturationColor, + "frameGloss": frameGloss, "screenCurvature": screenCurvature, "glowingLine": glowingLine, "burnIn": burnIn, @@ -357,6 +359,7 @@ QtObject { chromaColor = settings.chromaColor !== undefined ? settings.chromaColor : chromaColor saturationColor = settings.saturationColor !== undefined ? settings.saturationColor : saturationColor + frameGloss = settings.frameGloss !== undefined ? settings.frameGloss : frameGloss screenCurvature = settings.screenCurvature !== undefined ? settings.screenCurvature : screenCurvature glowingLine = settings.glowingLine !== undefined ? settings.glowingLine : glowingLine diff --git a/app/qml/SettingsTerminalTab.qml b/app/qml/SettingsTerminalTab.qml index 0f03c75..3a424b2 100644 --- a/app/qml/SettingsTerminalTab.qml +++ b/app/qml/SettingsTerminalTab.qml @@ -149,6 +149,11 @@ ColumnLayout { value: appSettings.saturationColor enabled: appSettings.chromaColor !== 0 } + CheckableSlider { + name: qsTr("Frame Gloss") + onNewValue: appSettings.frameGloss = newValue + value: appSettings.frameGloss + } } RowLayout { Layout.fillWidth: true diff --git a/app/qml/ShaderTerminal.qml b/app/qml/ShaderTerminal.qml index ccc3fac..1c1ba3e 100644 --- a/app/qml/ShaderTerminal.qml +++ b/app/qml/ShaderTerminal.qml @@ -37,6 +37,8 @@ Item { property real ambientLight: appSettings.ambientLight * 0.2 + property real frameGloss: appSettings.frameGloss + property size virtualResolution property size screenResolution @@ -59,6 +61,7 @@ Item { property real screenCurvature: parent.screenCurvature property real chromaColor: parent.chromaColor property real ambientLight: parent.ambientLight + property real frameGloss: parent.frameGloss property real flickering: appSettings.flickering property real horizontalSync: appSettings.horizontalSync @@ -172,6 +175,7 @@ Item { uniform highp vec4 fontColor; uniform highp vec4 backgroundColor; uniform lowp float shadowLength; + uniform lowp float frameGloss; uniform highp vec2 virtualResolution; uniform lowp float rasterizationIntensity;\n" + @@ -321,7 +325,7 @@ Item { (displayTerminalFrame ? "vec4 frameColor = texture2D(frameSource, qt_TexCoord0); - finalColor = mix(finalColor, frameColor.rgb + finalColor, frameColor.a);" + finalColor = mix(finalColor, frameColor.rgb + (finalColor*frameGloss), frameColor.a);" : "") + "gl_FragColor = vec4(finalColor, qt_Opacity);" +