From 0f3c78a8c731f9153165542a9035f735fa7b0ef4 Mon Sep 17 00:00:00 2001 From: Firemark Date: Thu, 31 Jul 2014 22:21:14 +0200 Subject: [PATCH 01/20] modify shaders --- app/PreprocessedTerminal.qml | 5 +++-- app/ShaderTerminal.qml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/PreprocessedTerminal.qml b/app/PreprocessedTerminal.qml index 773d00a..da24f08 100644 --- a/app/PreprocessedTerminal.qml +++ b/app/PreprocessedTerminal.qml @@ -218,7 +218,7 @@ Item{ id: finalSource sourceItem: blurredterminal sourceRect: frame.sourceRect - format: ShaderEffectSource.Alpha + //format: ShaderEffectSource.Alpha hideSource: true } ShaderEffect { @@ -261,7 +261,8 @@ Item{ : "") + - "gl_FragColor.a = floor(color) / 256.0;" + + "gl_FragColor = texture2D(source, coords);" + + "gl_FragColor.a = color / 256.0;" + "}" onStatusChanged: if (log) console.log(log) //Print warning messages diff --git a/app/ShaderTerminal.qml b/app/ShaderTerminal.qml index ad3b1d7..5fe5f15 100644 --- a/app/ShaderTerminal.qml +++ b/app/ShaderTerminal.qml @@ -183,8 +183,8 @@ ShaderEffect { (glowing_line_strength !== 0 ? " color += randomPass(coords) * glowing_line_strength;" : "") + - - "vec3 finalColor = mix(background_color, font_color, color).rgb;" + + "vec4 new_font_color = mix(texture2D(source, txt_coords), font_color, 0.2);" + + "vec3 finalColor = mix(background_color, new_font_color, color).rgb;" + "finalColor *= texture2D(rasterizationSource, coords).a;" + (bloom !== 0 ? " @@ -194,6 +194,7 @@ ShaderEffect { finalColor *= brightness;" : "") + "gl_FragColor = vec4(finalColor *"+str(brightness)+", qt_Opacity); + //gl_FragColor = texture2D(source, txt_coords); }" onStatusChanged: if (log) console.log(log) //Print warning messages -- 2.47.2 From f167b4d4478b4ec6d6f81c937ac049cef51d992e Mon Sep 17 00:00:00 2001 From: Firemark Date: Thu, 31 Jul 2014 22:41:54 +0200 Subject: [PATCH 02/20] support many colors in terminal --- app/ShaderTerminal.qml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/ShaderTerminal.qml b/app/ShaderTerminal.qml index 5fe5f15..26a9729 100644 --- a/app/ShaderTerminal.qml +++ b/app/ShaderTerminal.qml @@ -175,7 +175,7 @@ ShaderEffect { vec2 txt_coords = coords + offset * "+str(jitter)+";" : "vec2 txt_coords = coords;") + - "float color = texture2D(source, txt_coords).a;" + + "float color = 0.0;" + (noise_strength !== 0 ? " float noiseVal = texture2D(noiseSource, qt_TexCoord0 + vec2(fract(time / 51.0), fract(time / 237.0))).a; @@ -183,19 +183,22 @@ ShaderEffect { (glowing_line_strength !== 0 ? " color += randomPass(coords) * glowing_line_strength;" : "") + - "vec4 new_font_color = mix(texture2D(source, txt_coords), font_color, 0.2);" + - "vec3 finalColor = mix(background_color, new_font_color, color).rgb;" + + + "vec4 realBackColor = texture2D(source, txt_coords);" + + "vec4 mixedColor = mix(realBackColor * font_color, font_color, 0.0);" + + "vec4 finalBackColor = mix(background_color, mixedColor, realBackColor.a);" + + "vec3 finalColor = mix(finalBackColor, font_color, color).rgb;" + "finalColor *= texture2D(rasterizationSource, coords).a;" + (bloom !== 0 ? " - finalColor += font_color.rgb * texture2D(bloomSource, coords).r *" + str(bloom) + ";" : "") + + finalColor += font_color.rgb *" + + "dot(texture2D(bloomSource, coords).rgb, vec3(0.299, 0.587, 0.114)) *" + str(bloom) + ";" : "") + (brightness_flickering !== 0 ? " finalColor *= brightness;" : "") + - "gl_FragColor = vec4(finalColor *"+str(brightness)+", qt_Opacity); - //gl_FragColor = texture2D(source, txt_coords); - }" + "gl_FragColor = vec4(finalColor *"+str(brightness)+", qt_Opacity);" + + "}" onStatusChanged: if (log) console.log(log) //Print warning messages } -- 2.47.2 From e3d8992a35fbf852fc63369b3d71e899966a5697 Mon Sep 17 00:00:00 2001 From: Firemark Date: Fri, 1 Aug 2014 00:04:59 +0200 Subject: [PATCH 03/20] Add two settings to change colors. --- app/ApplicationSettings.qml | 9 +++++++- app/SettingsTerminalTab.qml | 42 ++++++++++++++++++++++++------------- app/ShaderTerminal.qml | 21 +++++++++++++++---- 3 files changed, 53 insertions(+), 19 deletions(-) diff --git a/app/ApplicationSettings.qml b/app/ApplicationSettings.qml index 9daf9b2..d6e9a58 100644 --- a/app/ApplicationSettings.qml +++ b/app/ApplicationSettings.qml @@ -67,6 +67,9 @@ Item{ property real motion_blur: 0.40 property real bloom_strength: 0.65 + property real chroma_color: 0.0 + property real saturation_color: 0.0 + property real jitter: 0.18 property real horizontal_sincronization: 0.08 @@ -171,6 +174,8 @@ Item{ brightness_flickering: brightness_flickering, horizontal_sincronization: horizontal_sincronization, noise_strength: noise_strength, + chroma_color: chroma_color, + saturation_color: saturation_color, screen_distortion: screen_distortion, glowing_line_strength: glowing_line_strength, frames_index: frames_index, @@ -234,6 +239,8 @@ Item{ horizontal_sincronization = settings.horizontal_sincronization !== undefined ? settings.horizontal_sincronization : horizontal_sincronization brightness_flickering = settings.brightness_flickering !== undefined ? settings.brightness_flickering : brightness_flickering; noise_strength = settings.noise_strength !== undefined ? settings.noise_strength : noise_strength; + chroma_color = settings.chroma_color !== undefined ? settings.chroma_color : chroma_color; + saturation_color = settings.saturation_color !== undefined ? settings.saturation_color : saturation_color; screen_distortion = settings.screen_distortion !== undefined ? settings.screen_distortion : screen_distortion; glowing_line_strength = settings.glowing_line_strength !== undefined ? settings.glowing_line_strength : glowing_line_strength; @@ -333,7 +340,7 @@ Item{ } ListElement{ text: "IBM Dos" - obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.07,"contrast":0.85,"fontIndex":7,"font_color":"#ffffff","frames_index":1,"glowing_line_strength":0.13,"horizontal_sincronization":0,"jitter":0.08,"motion_blur":0.3,"noise_strength":0.03,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1}' + obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.07,"contrast":0.85,"fontIndex":7,"font_color":"#ffffff","frames_index":1,"glowing_line_strength":0.13,"horizontal_sincronization":0,"jitter":0.08,"motion_blur":0.3,"noise_strength":0.03,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":1}' builtin: true } ListElement{ diff --git a/app/SettingsTerminalTab.qml b/app/SettingsTerminalTab.qml index 04e473f..07f5ba6 100644 --- a/app/SettingsTerminalTab.qml +++ b/app/SettingsTerminalTab.qml @@ -92,21 +92,35 @@ Tab{ GroupBox{ title: qsTr("Colors") Layout.fillWidth: true - RowLayout{ - anchors.fill: parent - ColorButton{ - name: qsTr("Font") - height: 50 - Layout.fillWidth: true - onColorSelected: shadersettings._font_color = color; - button_color: shadersettings._font_color + ColumnLayout{ + RowLayout{ + anchors.fill: parent + ColorButton{ + name: qsTr("Font") + height: 50 + Layout.fillWidth: true + onColorSelected: shadersettings._font_color = color; + button_color: shadersettings._font_color + } + ColorButton{ + name: qsTr("Background") + height: 50 + Layout.fillWidth: true + onColorSelected: shadersettings._background_color = color; + button_color: shadersettings._background_color + } } - ColorButton{ - name: qsTr("Background") - height: 50 - Layout.fillWidth: true - onColorSelected: shadersettings._background_color = color; - button_color: shadersettings._background_color + ColumnLayout{ + CheckableSlider{ + name: qsTr("Chroma Color") + onValueChanged: shadersettings.chroma_color = value + _value: shadersettings.chroma_color + } + CheckableSlider{ + name: qsTr("Saturation Color") + onValueChanged: shadersettings.saturation_color = value + _value: shadersettings.saturation_color + } } } } diff --git a/app/ShaderTerminal.qml b/app/ShaderTerminal.qml index 26a9729..9a411d5 100644 --- a/app/ShaderTerminal.qml +++ b/app/ShaderTerminal.qml @@ -39,6 +39,9 @@ ShaderEffect { property real screen_distorsion: shadersettings.screen_distortion property real glowing_line_strength: shadersettings.glowing_line_strength + property real chroma_color: shadersettings.chroma_color; + property real saturation_color: shadersettings.saturation_color; + property real brightness_flickering: shadersettings.brightness_flickering property real horizontal_sincronization: shadersettings.horizontal_sincronization @@ -184,10 +187,20 @@ ShaderEffect { (glowing_line_strength !== 0 ? " color += randomPass(coords) * glowing_line_strength;" : "") + - "vec4 realBackColor = texture2D(source, txt_coords);" + - "vec4 mixedColor = mix(realBackColor * font_color, font_color, 0.0);" + - "vec4 finalBackColor = mix(background_color, mixedColor, realBackColor.a);" + - "vec3 finalColor = mix(finalBackColor, font_color, color).rgb;" + + (chroma_color !== 0 ? + "vec4 realBackColor = texture2D(source, txt_coords);" + + (saturation_color !== 0 ? + "vec4 satured_font_color = mix(font_color, vec4(1) , "+ str(saturation_color) + ");" + + "vec4 mixedColor = mix(font_color, realBackColor * satured_font_color, "+ str(chroma_color) +");": + "vec4 mixedColor = mix(font_color, realBackColor * font_color, "+ str(chroma_color) +");" + ) + + + "vec4 finalBackColor = mix(background_color, mixedColor, realBackColor.a);" + + "vec3 finalColor = mix(finalBackColor, font_color, color).rgb;" : + "color += texture2D(source, txt_coords).a;" + + "vec3 finalColor = mix(background_color, font_color, color).rgb;" + ) + + "finalColor *= texture2D(rasterizationSource, coords).a;" + (bloom !== 0 ? " -- 2.47.2 From e1ac0a35b4defb3fea3f95ac2a92e5a1d59d205c Mon Sep 17 00:00:00 2001 From: Firemark Date: Fri, 1 Aug 2014 00:21:34 +0200 Subject: [PATCH 04/20] Change colors in color scheme --- app/ApplicationSettings.qml | 16 ++++++------ .../assets/color-schemes/cool-old-term.schema | 25 ++++++++++--------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/app/ApplicationSettings.qml b/app/ApplicationSettings.qml index d6e9a58..35a12e8 100644 --- a/app/ApplicationSettings.qml +++ b/app/ApplicationSettings.qml @@ -310,42 +310,42 @@ Item{ id: profileslist ListElement{ text: "Default Amber" - obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.65,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#ff8100","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.08,"jitter":0.18,"motion_blur":0.4,"noise_strength":0.1,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1}' + obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.65,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#ff8100","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.08,"jitter":0.18,"motion_blur":0.4,"noise_strength":0.1,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0}' builtin: true } ListElement{ text: "Default Green" - obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#0ccc68","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.08,"jitter":0.18,"motion_blur":0.45,"noise_strength":0.1,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1}' + obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#0ccc68","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.08,"jitter":0.18,"motion_blur":0.45,"noise_strength":0.1,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0}' builtin: true } ListElement{ text: "Default Scanlines" - obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#00ff5b","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.07,"jitter":0.11,"motion_blur":0.4,"noise_strength":0.05,"rasterization":1,"screen_distortion":0.1,"windowOpacity":1}' + obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#00ff5b","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.07,"jitter":0.11,"motion_blur":0.4,"noise_strength":0.05,"rasterization":1,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0}' builtin: true } ListElement{ text: "Default Pixelated" - obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#ff8100","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.1,"jitter":0,"motion_blur":0.45,"noise_strength":0.14,"rasterization":2,"screen_distortion":0.05,"windowOpacity":1}' + obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.1,"contrast":0.85,"fontIndex":0,"font_color":"#ff8100","frames_index":1,"glowing_line_strength":0.2,"horizontal_sincronization":0.1,"jitter":0,"motion_blur":0.45,"noise_strength":0.14,"rasterization":2,"screen_distortion":0.05,"windowOpacity":1,"chroma_color":0,"saturation_color":0}' builtin: true } ListElement{ text: "Apple ][" - obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.5,"brightness":0.5,"brightness_flickering":0.2,"contrast":0.85,"fontIndex":2,"font_color":"#2fff91","frames_index":1,"glowing_line_strength":0.22,"horizontal_sincronization":0.08,"jitter":0.1,"motion_blur":0.65,"noise_strength":0.08,"rasterization":1,"screen_distortion":0.18,"windowOpacity":1}' + obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.5,"brightness":0.5,"brightness_flickering":0.2,"contrast":0.85,"fontIndex":2,"font_color":"#2fff91","frames_index":1,"glowing_line_strength":0.22,"horizontal_sincronization":0.08,"jitter":0.1,"motion_blur":0.65,"noise_strength":0.08,"rasterization":1,"screen_distortion":0.18,"windowOpacity":1,"chroma_color":0,"saturation_color":0}' builtin: true } ListElement{ text: "Vintage" - obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.54,"contrast":0.85,"fontIndex":0,"font_color":"#00ff3e","frames_index":2,"glowing_line_strength":0.3,"horizontal_sincronization":0.2,"jitter":0.4,"motion_blur":0.75,"noise_strength":0.2,"rasterization":1,"screen_distortion":0.1,"windowOpacity":1}' + obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.54,"contrast":0.85,"fontIndex":0,"font_color":"#00ff3e","frames_index":2,"glowing_line_strength":0.3,"horizontal_sincronization":0.2,"jitter":0.4,"motion_blur":0.75,"noise_strength":0.2,"rasterization":1,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":0,"saturation_color":0}' builtin: true } ListElement{ text: "IBM Dos" - obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.07,"contrast":0.85,"fontIndex":7,"font_color":"#ffffff","frames_index":1,"glowing_line_strength":0.13,"horizontal_sincronization":0,"jitter":0.08,"motion_blur":0.3,"noise_strength":0.03,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":1}' + obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4,"brightness":0.5,"brightness_flickering":0.07,"contrast":0.85,"fontIndex":7,"font_color":"#ffffff","frames_index":1,"glowing_line_strength":0.13,"horizontal_sincronization":0,"jitter":0.08,"motion_blur":0.3,"noise_strength":0.03,"rasterization":0,"screen_distortion":0.1,"windowOpacity":1,"chroma_color":1,"saturation_color":0}' builtin: true } ListElement{ text: "Transparent Green" - obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4549689440993788,"brightness":0.5,"brightness_flickering":0.20341614906832298,"contrast":0.85,"fontIndex":0,"font_color":"#0ccc68","frames_index":0,"glowing_line_strength":0.15993788819875776,"horizontal_sincronization":0.05045871559633028,"jitter":0.20341614906832298,"motion_blur":0.24999999999999997,"noise_strength":0.20031055900621117,"rasterization":0,"screen_distortion":0.05045871559633028,"windowOpacity":0.5956221198156681}' + obj_string: '{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.4549689440993788,"brightness":0.5,"brightness_flickering":0.20341614906832298,"contrast":0.85,"fontIndex":0,"font_color":"#0ccc68","frames_index":0,"glowing_line_strength":0.15993788819875776,"horizontal_sincronization":0.05045871559633028,"jitter":0.20341614906832298,"motion_blur":0.24999999999999997,"noise_strength":0.20031055900621117,"rasterization":0,"screen_distortion":0.05045871559633028,"windowOpacity":0.5956221198156681,"chroma_color":0,"saturation_color":0}' builtin: true } } diff --git a/konsole-qml-plugin/assets/color-schemes/cool-old-term.schema b/konsole-qml-plugin/assets/color-schemes/cool-old-term.schema index 4df8184..6687f35 100644 --- a/konsole-qml-plugin/assets/color-schemes/cool-old-term.schema +++ b/konsole-qml-plugin/assets/color-schemes/cool-old-term.schema @@ -36,22 +36,23 @@ color 1 0 0 0 1 0 # regular background color (Black) color 2 0 0 0 0 0 # regular color 0 Black -color 3 59 59 59 0 0 # regular color 1 Red +color 3 255 43 43 0 0 # regular color 1 Red -color 4 137 137 137 0 0 # regular color 2 Green +color 4 0 28 172 120 0 0 # regular color 2 Green -color 5 116 116 116 0 0 # regular color 3 Yellow +color 5 248 213 104 0 0 # regular color 3 Yellow -color 6 39 39 39 0 0 # regular color 4 Blue +color 6 0 43 108 196 # regular color 4 Blue -color 7 70 70 70 0 0 # regular color 5 Magenta +color 7 255 29 206 0 0 # regular color 5 Magenta -color 8 148 148 148 0 0 # regular color 6 Cyan +color 8 24 167 181 0 0 # regular color 6 Cyan color 9 179 179 179 0 0 # regular color 7 White + # intensive colors @@ -68,17 +69,17 @@ color 11 0 0 0 1 0 # intensive background color color 12 106 106 106 0 0 # intensive color 0 -color 13 122 122 122 0 0 # intensive color 1 +color 13 253 94 83 0 0 # intensive color 1 -color 14 207 207 207 0 0 # intensive color 2 +color 14 168 228 160 0 0 # intensive color 2 -color 15 243 243 243 0 0 # intensive color 3 +color 15 254 254 34 0 0 # intensive color 3 -color 16 99 99 99 0 0 # intensive color 4 +color 16 154 206 235 0 0 # intensive color 4 -color 17 134 134 134 0 0 # intensive color 5 +color 17 252 116 253 0 0 # intensive color 5 -color 18 219 219 219 0 0 # intensive color 6 +color 18 236 234 190 0 0 # intensive color 6 color 19 255 255 255 0 0 # intensive color 7 -- 2.47.2 From c9097795145df1fb05a28cb34e3f01f6193d769b Mon Sep 17 00:00:00 2001 From: Cornelius Schumacher Date: Fri, 1 Aug 2014 00:45:38 +0200 Subject: [PATCH 05/20] Add instructions for compiling on openSUSE --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index ca830a7..54b50f3 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,25 @@ You can also install this [package](https://aur.archlinux.org/packages/cool-old- --- +**openSUSE** + +Install dependencies: + + sudo zypper ar http://download.opensuse.org/repositories/KDE:/Qt5/openSUSE_13.1/ KDE:Qt5 + sudo zypper install libqt5-qtbase-devel libqt5-qtdeclarative-devel libqt5-qtquickcontrols libqt5-qtgraphicaleffects + +Compile: + +```bash +git clone https://github.com/Swordifish90/cool-old-term.git +cd cool-old-term/konsole-qml-plugin +qmake-qt5 && make && make install +cd .. +./cool-old-term +``` + +--- + **Anyone else** Install Qt directly from here http://qt-project.org/downloads . Once done export them in you path (replace "_/opt/Qt5.3.1/5.3/gcc_64/bin_" with your correct folder): -- 2.47.2 From 296c64eb73d2da5adcbfe6dd114c3835c22d66a4 Mon Sep 17 00:00:00 2001 From: KAMiKAZOW Date: Fri, 1 Aug 2014 16:33:50 +0200 Subject: [PATCH 06/20] Create cool-old-term.spec Add a spec file to create RPM packages of cool-old-term. Verified to work with both Fedora 20 and openSUSE Factory. Support for other RPM-based distros (Mageia comes to mind) is as easy as adding additional (Build)Requires conditions. --- cool-old-term.spec | 96 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 cool-old-term.spec diff --git a/cool-old-term.spec b/cool-old-term.spec new file mode 100644 index 0000000..869568d --- /dev/null +++ b/cool-old-term.spec @@ -0,0 +1,96 @@ +# +# spec file for package cool-old-term +# +# Copyright © 2014 Markus S. +# +# Contains snippets from https://aur.archlinux.org/packages/cool-old-term-git +# by Glen Oakley +# and Doug Newgard +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +Name: cool-old-term +Summary: Cool Old Terminal +Version: 0.9 +Release: 0%{?dist} +Group: System/GUI/Other +License: GPLv3 +URL: http://swordfishslabs.wordpress.com/ + +# For this spec file to work, the ympd sources must be located in a directory +# named cool-old-term-0.9 (with "0.9" being the version number defined above). +# If the sources are compressed in another format than ZIP, change the +# file extension accordingly. +Source0: %{name}-%{version}.zip + +# Package names only verified with Fedora and openSUSE. +# Should the packages in your distro be named dirrerently, +# see http://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto +%if 0%{?fedora} +BuildRequires: qt5-qtbase-devel +BuildRequires: qt5-qtdeclarative-devel +BuildRequires: unzip +Requires: qt5-qtbase +Requires: qt5-qtbase-gui +Requires: qt5-qtdeclarative +Requires: qt5-qtgraphicaleffects +Requires: qt5-qtquickcontrols +%endif + +%if 0%{?suse_version} +BuildRequires: libqt5-qtbase-devel +BuildRequires: libqt5-qtdeclarative-devel +BuildRequires: unzip +Requires: libqt5-qtquickcontrols +Requires: libqt5-qtbase +Requires: libQt5Gui5 +Requires: libqt5-qtdeclarative +Requires: libqt5-qtgraphicaleffects +%endif + +%description +cool-old-term is a terminal emulator which tries to mimic the look and feel +of the old cathode tube screens. It has been designed to be eye-candy, +customizable, and reasonably lightweight. + +%prep +%setup -q + +%build +pushd konsole-qml-plugin +qmake-qt5 -o Makefile konsole-qml-plugin.pro +make %{?_smp_mflags} +popd + +%install +pushd konsole-qml-plugin +%{make_install} +popd + +install -d "%{buildroot}/%{_datadir}/%{name}/" "%{buildroot}/%{_bindir}" +cp -a app imports "%{buildroot}/%{_datadir}/%{name}/" +echo -e '#!/bin/bash\nqmlscene -I /usr/share/cool-old-term/{imports,app/main.qml}' > "%{buildroot}/%{_bindir}/%{name}" +chmod 755 "%{buildroot}/%{_bindir}/%{name}" + +%files +%doc gpl-2.0.txt gpl-3.0.txt README.md +%{_bindir}/%{name} +%{_datadir}/%{name} +# FIXME: Icon and Desktop files +# %{_datadir}/applications/%{name}.desktop +# %{_datadir}/pixmaps/%{name}.png +# %{_datadir}/icons/hicolor/*/*/* + +%clean +rm -rf %{buildroot} -- 2.47.2 From 0de719b67f5e042cc3d81836e97054637fd33342 Mon Sep 17 00:00:00 2001 From: Cornelius Schumacher Date: Fri, 1 Aug 2014 16:38:29 +0200 Subject: [PATCH 07/20] Special Qt5 repo only needed for openSUSE 13.1 --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 54b50f3..3004ae6 100644 --- a/README.md +++ b/README.md @@ -65,9 +65,12 @@ You can also install this [package](https://aur.archlinux.org/packages/cool-old- **openSUSE** -Install dependencies: +Add repository with latest Qt 5 (this is only needed on openSUSE 13.1, Factory already has it): sudo zypper ar http://download.opensuse.org/repositories/KDE:/Qt5/openSUSE_13.1/ KDE:Qt5 + +Install dependencies: + sudo zypper install libqt5-qtbase-devel libqt5-qtdeclarative-devel libqt5-qtquickcontrols libqt5-qtgraphicaleffects Compile: -- 2.47.2 From b81818f74d9cbf51046970073a85b70375a3b136 Mon Sep 17 00:00:00 2001 From: KAMiKAZOW Date: Fri, 1 Aug 2014 16:43:41 +0200 Subject: [PATCH 08/20] Update cool-old-term.spec Name fix --- cool-old-term.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cool-old-term.spec b/cool-old-term.spec index 869568d..a07739b 100644 --- a/cool-old-term.spec +++ b/cool-old-term.spec @@ -28,7 +28,7 @@ Group: System/GUI/Other License: GPLv3 URL: http://swordfishslabs.wordpress.com/ -# For this spec file to work, the ympd sources must be located in a directory +# For this spec file to work, the cool-old-term sources must be located in a directory # named cool-old-term-0.9 (with "0.9" being the version number defined above). # If the sources are compressed in another format than ZIP, change the # file extension accordingly. -- 2.47.2 From 876e6079d469b2101a90fede89e2d8a29ac0a33f Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Sat, 2 Aug 2014 20:03:16 +0200 Subject: [PATCH 09/20] Fix: color layout in settings window. --- app/SettingsTerminalTab.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/SettingsTerminalTab.qml b/app/SettingsTerminalTab.qml index 07f5ba6..f8116c8 100644 --- a/app/SettingsTerminalTab.qml +++ b/app/SettingsTerminalTab.qml @@ -93,8 +93,9 @@ Tab{ title: qsTr("Colors") Layout.fillWidth: true ColumnLayout{ + anchors.fill: parent RowLayout{ - anchors.fill: parent + Layout.fillWidth: true ColorButton{ name: qsTr("Font") height: 50 @@ -111,6 +112,7 @@ Tab{ } } ColumnLayout{ + Layout.fillWidth: true CheckableSlider{ name: qsTr("Chroma Color") onValueChanged: shadersettings.chroma_color = value -- 2.47.2 From 4b4fabaee34d3104bb3aae3e9880213d9079343a Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Sun, 3 Aug 2014 10:36:07 +0200 Subject: [PATCH 10/20] Fix issues between colors and motion blur. --- app/PreprocessedTerminal.qml | 8 +++++--- app/ShaderTerminal.qml | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/PreprocessedTerminal.qml b/app/PreprocessedTerminal.qml index 223e2e5..b3b5553 100644 --- a/app/PreprocessedTerminal.qml +++ b/app/PreprocessedTerminal.qml @@ -255,16 +255,18 @@ Item{ : "") + "coords = coords + delta;" + "vec4 vcolor = texture2D(source, coords) * 256.0; - float color = vcolor.r * 0.21 + vcolor.g * 0.72 + vcolor.b + 0.04;" + + float color = vcolor.r * 0.21 + vcolor.g * 0.72 + vcolor.b * 0.04;" + (mBlur !== 0 ? + "vec4 blurredVcolor = texture2D(blurredSource, coords) * 256.0;" + "float blurredSourceColor = texture2D(blurredSource, coords).a * 256.0;" + "blurredSourceColor = blurredSourceColor - blurredSourceColor * " + (1.0 - motionBlurCoefficient) * fpsAttenuation+ ";" + + "vcolor = step(1.0, color) * vcolor + step(color, 1.0) * blurredVcolor;" + "color = step(1.0, color) * color + step(color, 1.0) * blurredSourceColor;" : "") + - "gl_FragColor = texture2D(source, coords);" + - "gl_FragColor.a = color / 256.0;" + + "gl_FragColor = floor(vcolor) / 256.0;" + + "gl_FragColor.a = floor(color) / 256.0;" + "}" onStatusChanged: if (log) console.log(log) //Print warning messages diff --git a/app/ShaderTerminal.qml b/app/ShaderTerminal.qml index 9a411d5..a2e1c0d 100644 --- a/app/ShaderTerminal.qml +++ b/app/ShaderTerminal.qml @@ -191,7 +191,8 @@ ShaderEffect { "vec4 realBackColor = texture2D(source, txt_coords);" + (saturation_color !== 0 ? "vec4 satured_font_color = mix(font_color, vec4(1) , "+ str(saturation_color) + ");" + - "vec4 mixedColor = mix(font_color, realBackColor * satured_font_color, "+ str(chroma_color) +");": + "vec4 mixedColor = mix(font_color, realBackColor * satured_font_color, "+ str(chroma_color) +");" + : "vec4 mixedColor = mix(font_color, realBackColor * font_color, "+ str(chroma_color) +");" ) + -- 2.47.2 From a7210c69ed999e8f6d0a385ab7cb3f8b4bcfffe8 Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Sun, 3 Aug 2014 10:44:25 +0200 Subject: [PATCH 11/20] Fix incorrect colors scheme. --- konsole-qml-plugin/assets/color-schemes/cool-old-term.schema | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/konsole-qml-plugin/assets/color-schemes/cool-old-term.schema b/konsole-qml-plugin/assets/color-schemes/cool-old-term.schema index 6687f35..b9340a7 100644 --- a/konsole-qml-plugin/assets/color-schemes/cool-old-term.schema +++ b/konsole-qml-plugin/assets/color-schemes/cool-old-term.schema @@ -38,11 +38,11 @@ color 2 0 0 0 0 0 # regular color 0 Black color 3 255 43 43 0 0 # regular color 1 Red -color 4 0 28 172 120 0 0 # regular color 2 Green +color 4 28 172 120 0 0 # regular color 2 Green color 5 248 213 104 0 0 # regular color 3 Yellow -color 6 0 43 108 196 # regular color 4 Blue +color 6 43 108 196 0 0 # regular color 4 Blue color 7 255 29 206 0 0 # regular color 5 Magenta -- 2.47.2 From 1902e34d04cc8092f2ab1c422df730e8bca79560 Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Sun, 3 Aug 2014 14:43:36 +0200 Subject: [PATCH 12/20] Fix issues between colors and bloom. --- app/PreprocessedTerminal.qml | 6 +++++- app/ShaderTerminal.qml | 23 ++++++++++++++++------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/app/PreprocessedTerminal.qml b/app/PreprocessedTerminal.qml index b3b5553..11f6cc5 100644 --- a/app/PreprocessedTerminal.qml +++ b/app/PreprocessedTerminal.qml @@ -246,6 +246,10 @@ Item{ "uniform lowp sampler2D blurredSource;" : "") + + "float rgb2grey(vec3 v){ + return dot(v, vec3(0.21, 0.72, 0.04)); + }" + + "void main() {" + "vec2 coords = qt_TexCoord0;" + (mScanlines != shadersettings.no_rasterization ? " @@ -255,7 +259,7 @@ Item{ : "") + "coords = coords + delta;" + "vec4 vcolor = texture2D(source, coords) * 256.0; - float color = vcolor.r * 0.21 + vcolor.g * 0.72 + vcolor.b * 0.04;" + + float color = rgb2grey(vcolor);" + (mBlur !== 0 ? "vec4 blurredVcolor = texture2D(blurredSource, coords) * 256.0;" + "float blurredSourceColor = texture2D(blurredSource, coords).a * 256.0;" + diff --git a/app/ShaderTerminal.qml b/app/ShaderTerminal.qml index a2e1c0d..f53d077 100644 --- a/app/ShaderTerminal.qml +++ b/app/ShaderTerminal.qml @@ -146,6 +146,9 @@ ShaderEffect { return fract(smoothstep(-0.2, 0.0, coords.y - 3.0 * fract(time * 0.0001))) * glowing_line_strength; }" : "") + + "float rgb2grey(vec3 v){ + return dot(v, vec3(0.21, 0.72, 0.04)); + }" + "void main() {" + "vec2 cc = vec2(0.5) - qt_TexCoord0;" + @@ -187,26 +190,32 @@ ShaderEffect { (glowing_line_strength !== 0 ? " color += randomPass(coords) * glowing_line_strength;" : "") + - (chroma_color !== 0 ? + (chroma_color !== 0 ? "vec4 realBackColor = texture2D(source, txt_coords);" + (saturation_color !== 0 ? "vec4 satured_font_color = mix(font_color, vec4(1) , "+ str(saturation_color) + ");" + "vec4 mixedColor = mix(font_color, realBackColor * satured_font_color, "+ str(chroma_color) +");" : "vec4 mixedColor = mix(font_color, realBackColor * font_color, "+ str(chroma_color) +");" - ) + - + ) + + "vec4 finalBackColor = mix(background_color, mixedColor, realBackColor.a);" + - "vec3 finalColor = mix(finalBackColor, font_color, color).rgb;" : + "vec3 finalColor = mix(finalBackColor, font_color, color).rgb;" + : "color += texture2D(source, txt_coords).a;" + "vec3 finalColor = mix(background_color, font_color, color).rgb;" ) + "finalColor *= texture2D(rasterizationSource, coords).a;" + - (bloom !== 0 ? " - finalColor += font_color.rgb *" + - "dot(texture2D(bloomSource, coords).rgb, vec3(0.299, 0.587, 0.114)) *" + str(bloom) + ";" : "") + + (bloom !== 0 ? + "vec3 bloomColor = texture2D(bloomSource, coords).rgb;" + + (chroma_color !== 0 ? + "bloomColor = font_color.rgb * mix(vec3(rgb2grey(bloomColor)), bloomColor, "+str(chroma_color)+");" + : + "bloomColor = font_color.rgb * rgb2grey(bloomColor);") + + "finalColor += bloomColor * "+str(bloom)+";" + : "") + (brightness_flickering !== 0 ? " finalColor *= brightness;" : "") + -- 2.47.2 From f4771d4f37408275ac4f06ec9ef8849827db3239 Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Sun, 3 Aug 2014 16:39:28 +0200 Subject: [PATCH 13/20] Rewrite motion blur with colors. It now simpler. --- app/PreprocessedTerminal.qml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/app/PreprocessedTerminal.qml b/app/PreprocessedTerminal.qml index 11f6cc5..7720f49 100644 --- a/app/PreprocessedTerminal.qml +++ b/app/PreprocessedTerminal.qml @@ -220,7 +220,6 @@ Item{ id: finalSource sourceItem: blurredterminal sourceRect: frame.sourceRect - //format: ShaderEffectSource.Alpha hideSource: true } ShaderEffect { @@ -258,19 +257,18 @@ Item{ coords.x = floor(virtual_resolution.x * coords.x) / virtual_resolution.x;" : "") : "") + "coords = coords + delta;" + - "vec4 vcolor = texture2D(source, coords) * 256.0; - float color = rgb2grey(vcolor);" + + + "vec4 color = texture2D(source, coords) * 256.0; + color.a = rgb2grey(color.rgb);" + + (mBlur !== 0 ? - "vec4 blurredVcolor = texture2D(blurredSource, coords) * 256.0;" + - "float blurredSourceColor = texture2D(blurredSource, coords).a * 256.0;" + - "blurredSourceColor = blurredSourceColor - blurredSourceColor * " + (1.0 - motionBlurCoefficient) * fpsAttenuation+ ";" + - "vcolor = step(1.0, color) * vcolor + step(color, 1.0) * blurredVcolor;" + - "color = step(1.0, color) * color + step(color, 1.0) * blurredSourceColor;" + "vec4 blur_color = texture2D(blurredSource, coords) * 256.0;" + + "blur_color.a = blur_color.a - blur_color.a * " + (1.0 - motionBlurCoefficient) * fpsAttenuation+ ";" + + "color = step(1.0, color.a) * color + step(color.a, 1.0) * blur_color;" : "") + - "gl_FragColor = floor(vcolor) / 256.0;" + - "gl_FragColor.a = floor(color) / 256.0;" + + "gl_FragColor = floor(color) / 256.0;" + "}" onStatusChanged: if (log) console.log(log) //Print warning messages -- 2.47.2 From 17f605275e7755114a2ab702967780884d93ef74 Mon Sep 17 00:00:00 2001 From: KAMiKAZOW Date: Mon, 4 Aug 2014 01:34:44 +0200 Subject: [PATCH 14/20] Update and rename cool-old-term.spec to rpm/cool-old-term.spec Put specfile in a subdirectory and add a line that was missing before --- cool-old-term.spec => rpm/cool-old-term.spec | 1 + 1 file changed, 1 insertion(+) rename cool-old-term.spec => rpm/cool-old-term.spec (99%) diff --git a/cool-old-term.spec b/rpm/cool-old-term.spec similarity index 99% rename from cool-old-term.spec rename to rpm/cool-old-term.spec index a07739b..1f6f8b7 100644 --- a/cool-old-term.spec +++ b/rpm/cool-old-term.spec @@ -84,6 +84,7 @@ echo -e '#!/bin/bash\nqmlscene -I /usr/share/cool-old-term/{imports,app/main.qml chmod 755 "%{buildroot}/%{_bindir}/%{name}" %files +%defattr(-,root,root,-) %doc gpl-2.0.txt gpl-3.0.txt README.md %{_bindir}/%{name} %{_datadir}/%{name} -- 2.47.2 From eab0eec74697e430c5b7b0ad53d641146bd1e922 Mon Sep 17 00:00:00 2001 From: KAMiKAZOW Date: Mon, 4 Aug 2014 01:35:46 +0200 Subject: [PATCH 15/20] Rename rpm/cool-old-term.spec to packaging/rpm/cool-old-term.spec --- {rpm => packaging/rpm}/cool-old-term.spec | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {rpm => packaging/rpm}/cool-old-term.spec (100%) diff --git a/rpm/cool-old-term.spec b/packaging/rpm/cool-old-term.spec similarity index 100% rename from rpm/cool-old-term.spec rename to packaging/rpm/cool-old-term.spec -- 2.47.2 From 1cd41ce0b964aadf4b2701533375b0ae20375fd1 Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Mon, 4 Aug 2014 01:46:07 +0200 Subject: [PATCH 16/20] Fix 27 : profile name is now validated. --- app/InsertNameDialog.qml | 46 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/app/InsertNameDialog.qml b/app/InsertNameDialog.qml index 3e16d81..85e86c1 100644 --- a/app/InsertNameDialog.qml +++ b/app/InsertNameDialog.qml @@ -22,16 +22,41 @@ import QtQuick 2.2 import QtQuick.Window 2.0 import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 +import QtQuick.Dialogs 1.1 Window{ id: insertnamedialog width: 400 height: 100 modality: Qt.ApplicationModal - title: qsTr("Save current profile") + title: qsTr("Save new profile") signal nameSelected(string name) + MessageDialog { + id: errorDialog + title: qsTr("Error") + visible: false + + function showError(message){ + text = message; + open(); + } + } + + function validateName(name){ + var profile_list = shadersettings.profiles_list; + if (name === "") + return 1; + + for (var i = 0; i < profile_list.count; i++){ + if(profile_list.get(i).text === name) + return 2; + } + + return 0; + } + ColumnLayout{ anchors.margins: 10 anchors.fill: parent @@ -41,16 +66,29 @@ Window{ id: namefield Layout.fillWidth: true Component.onCompleted: forceActiveFocus() + onAccepted: okbutton.clickAction() } } RowLayout{ anchors.right: parent.right anchors.bottom: parent.bottom Button{ + id: okbutton text: qsTr("OK") - onClicked: { - nameSelected(namefield.text); - close(); + onClicked: clickAction() + function clickAction(){ + var name = namefield.text; + switch(validateName(name)){ + case 1: + errorDialog.showError(qsTr("The name you inserted is empty. Please choose a different one.")); + break; + case 2: + errorDialog.showError(qsTr("The name you inserted already exists. Please choose a different one.")); + break; + default: + nameSelected(name); + close(); + } } } Button{ -- 2.47.2 From 3d705f71785995f8af6550eba4a2c7c07f6cd13d Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Mon, 4 Aug 2014 01:49:48 +0200 Subject: [PATCH 17/20] Fix 28 : Save New Profile is clearer. --- app/SettingsGeneralTab.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/SettingsGeneralTab.qml b/app/SettingsGeneralTab.qml index 12ab3cf..b560b5d 100644 --- a/app/SettingsGeneralTab.qml +++ b/app/SettingsGeneralTab.qml @@ -49,7 +49,7 @@ Tab{ } Button{ Layout.fillWidth: true - text: qsTr("Store current") + text: qsTr("Save New Profile") onClicked: insertname.show() } Button{ -- 2.47.2 From 7f5a47f8a42edef1e1fb9f689b1463747ef5774d Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Wed, 6 Aug 2014 19:07:30 +0200 Subject: [PATCH 18/20] Use offline saturation color. Better and a little bit faster. --- app/ApplicationSettings.qml | 5 +++-- app/ShaderTerminal.qml | 7 +------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/ApplicationSettings.qml b/app/ApplicationSettings.qml index 386e110..5d38948 100644 --- a/app/ApplicationSettings.qml +++ b/app/ApplicationSettings.qml @@ -59,8 +59,9 @@ Item{ property string _background_color: "#000000" property string _font_color: "#ff8100" - property color font_color: mix(strToColor(_font_color), strToColor(_background_color), 0.7 + (contrast * 0.3)) - property color background_color: mix(strToColor(_background_color), strToColor(_font_color), 0.7 + (contrast * 0.3)) + property string saturated_color: mix(strToColor("#FFFFFF"), strToColor(_font_color), saturation_color) + property color font_color: mix(strToColor(saturated_color), strToColor(_background_color), 0.7 + (contrast * 0.3)) + property color background_color: mix(strToColor(_background_color), strToColor(saturated_color), 0.7 + (contrast * 0.3)) property real noise_strength: 0.1 property real screen_distortion: 0.1 diff --git a/app/ShaderTerminal.qml b/app/ShaderTerminal.qml index f53d077..b4b12e1 100644 --- a/app/ShaderTerminal.qml +++ b/app/ShaderTerminal.qml @@ -192,12 +192,7 @@ ShaderEffect { (chroma_color !== 0 ? "vec4 realBackColor = texture2D(source, txt_coords);" + - (saturation_color !== 0 ? - "vec4 satured_font_color = mix(font_color, vec4(1) , "+ str(saturation_color) + ");" + - "vec4 mixedColor = mix(font_color, realBackColor * satured_font_color, "+ str(chroma_color) +");" - : - "vec4 mixedColor = mix(font_color, realBackColor * font_color, "+ str(chroma_color) +");" - ) + + "vec4 mixedColor = mix(font_color, realBackColor * font_color, "+ str(chroma_color) +");" + "vec4 finalBackColor = mix(background_color, mixedColor, realBackColor.a);" + "vec3 finalColor = mix(finalBackColor, font_color, color).rgb;" -- 2.47.2 From 40d34c2cca6ca05a72775499c161db3e58c97c2a Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Thu, 7 Aug 2014 00:18:44 +0200 Subject: [PATCH 19/20] Fix: colors play nicely with frames reflections now. --- app/frames/utils/FrameShader.qml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/app/frames/utils/FrameShader.qml b/app/frames/utils/FrameShader.qml index fee9045..78a1142 100644 --- a/app/frames/utils/FrameShader.qml +++ b/app/frames/utils/FrameShader.qml @@ -13,6 +13,8 @@ ShaderEffect{ property bool frameReflections: shadersettings.frameReflections property variant lightSource: reflectionEffectSourceLoader.item + property real chroma_color: shadersettings.chroma_color + Loader{ id: reflectionEffectLoader width: parent.width * 0.33 @@ -62,6 +64,10 @@ ShaderEffect{ return (coords + cc * (1.0 + dist) * dist); } + float rgb2grey(vec3 v){ + return dot(v, vec3(0.21, 0.72, 0.04)); + } + void main(){ vec2 coords = distortCoordinates(qt_TexCoord0); vec4 txt_color = texture2D(source, coords); @@ -72,16 +78,20 @@ ShaderEffect{ float dotProd = dot(normal, light_direction);" + (frameReflections ? " - float screenLight = texture2D(lightSource, coords).r; + vec3 realLightColor = texture2D(lightSource, coords).rgb; + float screenLight = rgb2grey(realLightColor); float clampedDotProd = clamp(dotProd, 0.05, 1.0); float diffuseReflection = clamp(screenLight * 1.5 * clampedDotProd, 0.0, 0.35); - float reflectionAlpha = mix(1.0, 0.90, dotProd);" + float reflectionAlpha = mix(1.0, 0.90, dotProd); + vec3 lightColor = mix(font_color.rgb * screenLight, font_color.rgb * realLightColor, "+chroma_color.toFixed(2)+");" : " float diffuseReflection = 0.0; - float reflectionAlpha = 1.0;") + " + float reflectionAlpha = 1.0; + vec3 lightColor = font_color.rgb;") + " + vec3 back_color = background_color.rgb * (0.2 + 0.5 * dotProd); - vec3 front_color = font_color.rgb * (0.05 + diffuseReflection); + vec3 front_color = lightColor * (0.05 + diffuseReflection); vec4 dark_color = vec4((back_color + front_color) * txt_normal.a, txt_normal.a * reflectionAlpha); gl_FragColor = mix(dark_color, txt_color, ambient_light); -- 2.47.2 From 307f6403273b8c2e9cf5d14eb32ffb43063e9b27 Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Thu, 7 Aug 2014 00:21:40 +0200 Subject: [PATCH 20/20] Capping saturation to 50% --- app/ApplicationSettings.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ApplicationSettings.qml b/app/ApplicationSettings.qml index 5d38948..242f681 100644 --- a/app/ApplicationSettings.qml +++ b/app/ApplicationSettings.qml @@ -59,7 +59,7 @@ Item{ property string _background_color: "#000000" property string _font_color: "#ff8100" - property string saturated_color: mix(strToColor("#FFFFFF"), strToColor(_font_color), saturation_color) + property string saturated_color: mix(strToColor("#FFFFFF"), strToColor(_font_color), saturation_color * 0.5) property color font_color: mix(strToColor(saturated_color), strToColor(_background_color), 0.7 + (contrast * 0.3)) property color background_color: mix(strToColor(_background_color), strToColor(saturated_color), 0.7 + (contrast * 0.3)) -- 2.47.2