From 4fdf28fb79da340aa754c30097c7caef785204c8 Mon Sep 17 00:00:00 2001 From: Frost Date: Sat, 2 Oct 2021 12:01:14 -0700 Subject: [PATCH 1/4] Add reflections to frame for better glossiness I mean, it's how it works in the real world; it's added to the frame's base color, not occluded by the frame. --- app/qml/ShaderTerminal.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/qml/ShaderTerminal.qml b/app/qml/ShaderTerminal.qml index bb46df2..7e280d8 100644 --- a/app/qml/ShaderTerminal.qml +++ b/app/qml/ShaderTerminal.qml @@ -321,7 +321,7 @@ Item { (displayTerminalFrame ? "vec4 frameColor = texture2D(frameSource, qt_TexCoord0); - finalColor = mix(finalColor, frameColor.rgb, frameColor.a);" + finalColor = mix(finalColor, frameColor.rgb + finalColor, frameColor.a);" : "") + "gl_FragColor = vec4(finalColor, qt_Opacity);" + From 5b0b091ab680d869a7dc37db62adfb84b9302f39 Mon Sep 17 00:00:00 2001 From: Frost Date: Sat, 2 Oct 2021 12:17:04 -0700 Subject: [PATCH 2/4] Add frame color setting It's saved in the profile, and defaults to white. --- app/qml/ApplicationSettings.qml | 4 ++++ app/qml/SettingsTerminalTab.qml | 7 +++++++ app/qml/TerminalFrame.qml | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/qml/ApplicationSettings.qml b/app/qml/ApplicationSettings.qml index 2e5c762..9bb05fc 100644 --- a/app/qml/ApplicationSettings.qml +++ b/app/qml/ApplicationSettings.qml @@ -71,6 +71,7 @@ QtObject { property string _backgroundColor: "#000000" property string _fontColor: "#ff8100" + property string _frameColor: "#ffffff" property string saturatedColor: Utils.mix(Utils.strToColor("#FFFFFF"), Utils.strToColor(_fontColor), saturationColor * 0.5) @@ -81,6 +82,7 @@ QtObject { _backgroundColor), Utils.strToColor(saturatedColor), 0.7 + (contrast * 0.3)) + property color frameColor: Utils.strToColor(_frameColor) property real staticNoise: 0.12 property real screenCurvature: 0.3 @@ -251,6 +253,7 @@ QtObject { var settings = { "backgroundColor": _backgroundColor, "fontColor": _fontColor, + "frameColor": _frameColor, "flickering": flickering, "horizontalSync": horizontalSync, "staticNoise": staticNoise, @@ -345,6 +348,7 @@ QtObject { _backgroundColor = settings.backgroundColor !== undefined ? settings.backgroundColor : _backgroundColor _fontColor = settings.fontColor !== undefined ? settings.fontColor : _fontColor + _frameColor = settings.frameColor !== undefined ? settings.frameColor : _frameColor horizontalSync = settings.horizontalSync !== undefined ? settings.horizontalSync : horizontalSync diff --git a/app/qml/SettingsTerminalTab.qml b/app/qml/SettingsTerminalTab.qml index 222ea78..0f03c75 100644 --- a/app/qml/SettingsTerminalTab.qml +++ b/app/qml/SettingsTerminalTab.qml @@ -166,6 +166,13 @@ ColumnLayout { onColorSelected: appSettings._backgroundColor = color color: appSettings._backgroundColor } + ColorButton { + name: qsTr("Frame") + height: 50 + Layout.fillWidth: true + onColorSelected: appSettings._frameColor = color + color: appSettings._frameColor + } } } } diff --git a/app/qml/TerminalFrame.qml b/app/qml/TerminalFrame.qml index 49baa2c..210a909 100644 --- a/app/qml/TerminalFrame.qml +++ b/app/qml/TerminalFrame.qml @@ -22,13 +22,13 @@ import QtQuick 2.0 import "utils.js" as Utils ShaderEffect { - property color _staticFrameColor: "#fff" + property color _frameColor: appSettings.frameColor property color _backgroundColor: appSettings.backgroundColor property color _fontColor: appSettings.fontColor property color _lightColor: Utils.mix(_fontColor, _backgroundColor, 0.2) property real _ambientLight: Utils.lint(0.2, 0.8, appSettings.ambientLight) - property color frameColor: Utils.mix(_staticFrameColor, _lightColor, _ambientLight) + property color frameColor: Utils.mix(_frameColor, _lightColor, _ambientLight) property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize // Coefficient of the log curve used to approximate shadowing From e3161f64f61aa2cdcb599231a73ee3eeddf0210d Mon Sep 17 00:00:00 2001 From: Frost Date: Sat, 2 Oct 2021 12:29:56 -0700 Subject: [PATCH 3/4] 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 9bb05fc..055531d 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 7e280d8..85578bf 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);" + From 5ecd7d754d725b21c6c5e404123438c33484bd87 Mon Sep 17 00:00:00 2001 From: Frost Date: Sat, 2 Oct 2021 12:36:04 -0700 Subject: [PATCH 4/4] Add frame color/gloss to the default profiles --- app/qml/ApplicationSettings.qml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/qml/ApplicationSettings.qml b/app/qml/ApplicationSettings.qml index 055531d..e2e2acb 100644 --- a/app/qml/ApplicationSettings.qml +++ b/app/qml/ApplicationSettings.qml @@ -466,6 +466,8 @@ QtObject { "rbgShift": 0, "saturationColor": 0.2483, "screenCurvature": 0.3, + "frameColor": "#ffffff", + "frameGloss": 0, "staticNoise": 0.1198, "windowOpacity": 1, "margin": 0.5, @@ -495,6 +497,8 @@ QtObject { "rbgShift": 0, "saturationColor": 0.0, "screenCurvature": 0.3, + "frameColor": "#ffffff", + "frameGloss": 0, "staticNoise": 0.1198, "windowOpacity": 1, "margin": 0.5, @@ -524,6 +528,8 @@ QtObject { "rbgShift": 0, "saturationColor": 0.5, "screenCurvature": 0.3, + "frameColor": "#ffffff", + "frameGloss": 0, "staticNoise": 0.15, "windowOpacity": 1, "margin": 0.5, @@ -553,6 +559,8 @@ QtObject { "rbgShift": 0, "saturationColor": 0, "screenCurvature": 0, + "frameColor": "#ffffff", + "frameGloss": 0, "staticNoise": 0.15, "windowOpacity": 1, "margin": 0.5, @@ -582,6 +590,8 @@ QtObject { "rbgShift": 0, "saturationColor": 0, "screenCurvature": 0.5, + "frameColor": "#ffffff", + "frameGloss": 0, "staticNoise": 0.099, "windowOpacity": 1, "margin": 0.5, @@ -611,6 +621,8 @@ QtObject { "rbgShift": 0.2969, "saturationColor": 0, "screenCurvature": 0.5, + "frameColor": "#ffffff", + "frameGloss": 0, "staticNoise": 0.2969, "windowOpacity": 1, "margin": 0.5, @@ -640,6 +652,8 @@ QtObject { "rbgShift": 0.3524, "saturationColor": 0, "screenCurvature": 0.4, + "frameColor": "#ffffff", + "frameGloss": 0, "staticNoise": 0.0503, "windowOpacity": 1, "margin": 0.5, @@ -669,6 +683,8 @@ QtObject { "rbgShift": 0, "saturationColor": 0, "screenCurvature": 0.2, + "frameColor": "#ffffff", + "frameGloss": 0, "staticNoise": 0, "windowOpacity": 1, "margin": 0.5, @@ -698,6 +714,8 @@ QtObject { "rbgShift": 0, "saturationColor": 0.4983, "screenCurvature": 0, + "frameColor": "#ffffff", + "frameGloss": 0, "staticNoise": 0.0955, "windowOpacity": 0.7, "margin": 0.1,