From 0f3c78a8c731f9153165542a9035f735fa7b0ef4 Mon Sep 17 00:00:00 2001 From: Firemark Date: Thu, 31 Jul 2014 22:21:14 +0200 Subject: [PATCH 1/4] 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 From f167b4d4478b4ec6d6f81c937ac049cef51d992e Mon Sep 17 00:00:00 2001 From: Firemark Date: Thu, 31 Jul 2014 22:41:54 +0200 Subject: [PATCH 2/4] 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 } From e3d8992a35fbf852fc63369b3d71e899966a5697 Mon Sep 17 00:00:00 2001 From: Firemark Date: Fri, 1 Aug 2014 00:04:59 +0200 Subject: [PATCH 3/4] 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 ? " From e1ac0a35b4defb3fea3f95ac2a92e5a1d59d205c Mon Sep 17 00:00:00 2001 From: Firemark Date: Fri, 1 Aug 2014 00:21:34 +0200 Subject: [PATCH 4/4] 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