2013-12-28 14:52:10 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright (c) 2013 "Filippo Scognamiglio"
|
2014-09-03 22:19:34 +02:00
|
|
|
* https://github.com/Swordfish90/cool-retro-term
|
2013-12-28 14:52:10 +01:00
|
|
|
*
|
2014-09-03 22:19:34 +02:00
|
|
|
* This file is part of cool-retro-term.
|
2013-12-28 14:52:10 +01:00
|
|
|
*
|
2014-09-03 22:19:34 +02:00
|
|
|
* cool-retro-term is free software: you can redistribute it and/or modify
|
2013-12-28 14:52:10 +01:00
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*******************************************************************************/
|
|
|
|
|
2014-04-17 13:56:13 +02:00
|
|
|
import QtQuick 2.2
|
2014-03-26 20:26:20 +01:00
|
|
|
import QtGraphicalEffects 1.0
|
2013-12-28 14:37:43 +01:00
|
|
|
|
2015-01-20 00:57:23 +01:00
|
|
|
import "utils.js" as Utils
|
|
|
|
|
2013-12-28 14:37:43 +01:00
|
|
|
ShaderEffect {
|
2014-12-11 10:40:14 +01:00
|
|
|
property ShaderEffectSource source
|
2014-12-15 02:35:13 +01:00
|
|
|
property ShaderEffectSource blurredSource
|
2014-12-11 10:40:14 +01:00
|
|
|
property ShaderEffectSource bloomSource
|
2018-11-05 00:16:52 +01:00
|
|
|
property ShaderEffectSource rasterizationSource
|
2014-12-11 10:40:14 +01:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
property color fontColor: appSettings.fontColor
|
|
|
|
property color backgroundColor: appSettings.backgroundColor
|
2018-11-01 23:35:55 +01:00
|
|
|
property real bloom: appSettings.bloom * 2.0
|
2014-03-26 20:26:20 +01:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
property real burnIn: appSettings.burnIn
|
2014-12-15 02:35:13 +01:00
|
|
|
|
2014-12-11 12:08:15 +01:00
|
|
|
property real jitter: appSettings.jitter * 0.007
|
2014-12-23 18:13:34 +01:00
|
|
|
property real staticNoise: appSettings.staticNoise
|
|
|
|
property size scaleNoiseSize: Qt.size((width) / (noiseTexture.width * appSettings.windowScaling * appSettings.fontScaling),
|
|
|
|
(height) / (noiseTexture.height * appSettings.windowScaling * appSettings.fontScaling))
|
2014-12-13 16:53:45 +01:00
|
|
|
|
2014-12-26 19:47:11 +01:00
|
|
|
property real screenCurvature: appSettings.screenCurvature
|
2015-01-22 01:44:30 +01:00
|
|
|
property real glowingLine: appSettings.glowingLine * 0.2
|
2013-12-28 14:37:43 +01:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
property real chromaColor: appSettings.chromaColor;
|
2014-08-01 00:04:59 +02:00
|
|
|
|
2018-10-28 23:54:56 +01:00
|
|
|
property real rbgShift: (appSettings.rbgShift / width) * (appSettings.chromaColor !== 0 ? 1.0 : 0.0)
|
2014-08-11 19:23:03 +02:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
property real flickering: appSettings.flickering
|
2014-12-26 19:47:11 +01:00
|
|
|
property real horizontalSync: appSettings.horizontalSync * 0.5
|
2014-03-25 16:30:07 +01:00
|
|
|
|
2014-12-11 12:08:15 +01:00
|
|
|
property bool frameReflections: appSettings.frameReflections
|
2014-04-20 22:59:46 +02:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
property real disp_top: (frame.displacementTop * appSettings.windowScaling) / height
|
|
|
|
property real disp_bottom: (frame.displacementBottom * appSettings.windowScaling) / height
|
|
|
|
property real disp_left: (frame.displacementLeft * appSettings.windowScaling) / width
|
|
|
|
property real disp_right: (frame.displacementRight * appSettings.windowScaling) / width
|
2014-04-05 15:14:52 +02:00
|
|
|
|
2014-12-11 12:08:15 +01:00
|
|
|
property real screen_brightness: appSettings.brightness * 1.5 + 0.5
|
2014-03-31 17:26:51 +02:00
|
|
|
|
2014-12-14 10:31:38 +01:00
|
|
|
property real dispX
|
|
|
|
property real dispY
|
|
|
|
property size virtual_resolution
|
|
|
|
|
2014-11-09 15:20:05 +01:00
|
|
|
TimeManager{
|
|
|
|
id: timeManager
|
|
|
|
enableTimer: terminalWindow.visible
|
|
|
|
}
|
|
|
|
|
|
|
|
property alias time: timeManager.time
|
2014-12-26 19:47:11 +01:00
|
|
|
property ShaderEffectSource noiseSource: noiseShaderSource
|
2014-03-31 14:13:51 +02:00
|
|
|
|
2014-10-04 14:09:49 +02:00
|
|
|
// If something goes wrong activate the fallback version of the shader.
|
|
|
|
property bool fallBack: false
|
|
|
|
|
2014-06-11 00:54:47 +02:00
|
|
|
blending: false
|
|
|
|
|
2014-07-12 01:51:53 +02:00
|
|
|
//Smooth random texture used for flickering effect.
|
|
|
|
Image{
|
2014-12-13 16:53:45 +01:00
|
|
|
id: noiseTexture
|
|
|
|
source: "images/allNoise512.png"
|
2014-07-12 01:51:53 +02:00
|
|
|
width: 512
|
|
|
|
height: 512
|
2014-12-13 16:53:45 +01:00
|
|
|
fillMode: Image.Tile
|
|
|
|
visible: false
|
2014-07-12 01:51:53 +02:00
|
|
|
}
|
|
|
|
ShaderEffectSource{
|
2014-12-13 16:53:45 +01:00
|
|
|
id: noiseShaderSource
|
|
|
|
sourceItem: noiseTexture
|
2014-07-12 01:51:53 +02:00
|
|
|
wrapMode: ShaderEffectSource.Repeat
|
2014-12-11 00:52:09 +01:00
|
|
|
visible: false
|
2014-12-13 16:53:45 +01:00
|
|
|
smooth: true
|
2014-07-12 01:51:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//Print the number with a reasonable precision for the shader.
|
2014-05-31 21:28:25 +02:00
|
|
|
function str(num){
|
|
|
|
return num.toFixed(8);
|
|
|
|
}
|
|
|
|
|
2014-03-31 14:13:51 +02:00
|
|
|
vertexShader: "
|
2014-05-31 21:28:25 +02:00
|
|
|
uniform highp mat4 qt_Matrix;
|
|
|
|
uniform highp float time;
|
2014-09-14 00:45:34 +02:00
|
|
|
|
|
|
|
uniform highp float disp_left;
|
|
|
|
uniform highp float disp_right;
|
|
|
|
uniform highp float disp_top;
|
|
|
|
uniform highp float disp_bottom;
|
2014-05-31 21:28:25 +02:00
|
|
|
|
|
|
|
attribute highp vec4 qt_Vertex;
|
|
|
|
attribute highp vec2 qt_MultiTexCoord0;
|
|
|
|
|
|
|
|
varying highp vec2 qt_TexCoord0;" +
|
|
|
|
|
2014-10-04 14:09:49 +02:00
|
|
|
(!fallBack ? "
|
2014-12-13 16:53:45 +01:00
|
|
|
uniform sampler2D noiseSource;" : "") +
|
2014-10-04 14:09:49 +02:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
(!fallBack && flickering !== 0.0 ?"
|
2014-08-08 22:57:51 +02:00
|
|
|
varying lowp float brightness;
|
2014-12-23 18:13:34 +01:00
|
|
|
uniform lowp float flickering;" : "") +
|
|
|
|
(!fallBack && horizontalSync !== 0.0 ?"
|
|
|
|
uniform lowp float horizontalSync;
|
2014-12-14 09:44:23 +01:00
|
|
|
varying lowp float distortionScale;
|
|
|
|
varying lowp float distortionFreq;" : "") +
|
|
|
|
|
2014-05-31 21:28:25 +02:00
|
|
|
"
|
|
|
|
void main() {
|
2014-09-14 02:43:48 +02:00
|
|
|
qt_TexCoord0.x = (qt_MultiTexCoord0.x - disp_left) / (1.0 - disp_left - disp_right);
|
|
|
|
qt_TexCoord0.y = (qt_MultiTexCoord0.y - disp_top) / (1.0 - disp_top - disp_bottom);
|
2014-05-31 21:28:25 +02:00
|
|
|
vec2 coords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));" +
|
2014-12-13 16:53:45 +01:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
(!fallBack && (flickering !== 0.0 || horizontalSync !== 0.0) ?
|
2014-12-13 16:53:45 +01:00
|
|
|
"vec4 initialNoiseTexel = texture2D(noiseSource, coords);"
|
|
|
|
: "") +
|
2014-12-23 18:13:34 +01:00
|
|
|
(!fallBack && flickering !== 0.0 ? "
|
|
|
|
brightness = 1.0 + (initialNoiseTexel.g - 0.5) * flickering;"
|
2014-12-13 16:53:45 +01:00
|
|
|
: "") +
|
2014-05-31 21:28:25 +02:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
(!fallBack && horizontalSync !== 0.0 ? "
|
|
|
|
float randval = horizontalSync - initialNoiseTexel.r;
|
|
|
|
distortionScale = step(0.0, randval) * randval * horizontalSync;
|
2014-12-14 09:44:23 +01:00
|
|
|
distortionFreq = mix(4.0, 40.0, initialNoiseTexel.g);"
|
2014-05-31 21:28:25 +02:00
|
|
|
: "") +
|
|
|
|
|
|
|
|
"gl_Position = qt_Matrix * qt_Vertex;
|
|
|
|
}"
|
2013-12-28 14:37:43 +01:00
|
|
|
|
|
|
|
fragmentShader: "
|
2015-01-28 11:14:42 +01:00
|
|
|
#ifdef GL_ES
|
|
|
|
precision mediump float;
|
|
|
|
#endif
|
2015-01-27 23:48:05 +01:00
|
|
|
|
2014-05-31 21:28:25 +02:00
|
|
|
uniform sampler2D source;
|
|
|
|
uniform highp float qt_Opacity;
|
|
|
|
uniform highp float time;
|
|
|
|
varying highp vec2 qt_TexCoord0;
|
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
uniform highp vec4 fontColor;
|
|
|
|
uniform highp vec4 backgroundColor;
|
2014-12-14 10:31:38 +01:00
|
|
|
uniform lowp float screen_brightness;
|
|
|
|
|
|
|
|
uniform highp vec2 virtual_resolution;
|
|
|
|
uniform highp float dispX;
|
|
|
|
uniform highp float dispY;" +
|
2013-12-28 14:37:43 +01:00
|
|
|
|
2018-11-05 00:16:52 +01:00
|
|
|
(appSettings.rasterization != appSettings.no_rasterization ?
|
|
|
|
"uniform lowp sampler2D rasterizationSource;" : "") +
|
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
(bloom !== 0 ? "
|
2014-08-08 22:57:51 +02:00
|
|
|
uniform highp sampler2D bloomSource;
|
2014-12-23 18:13:34 +01:00
|
|
|
uniform lowp float bloom;" : "") +
|
|
|
|
(burnIn !== 0 ? "
|
2015-01-19 17:31:37 +01:00
|
|
|
uniform sampler2D blurredSource;" : "") +
|
2014-12-23 18:13:34 +01:00
|
|
|
(staticNoise !== 0 ? "
|
|
|
|
uniform highp float staticNoise;" : "") +
|
|
|
|
(((staticNoise !== 0 || jitter !== 0 || rbgShift)
|
|
|
|
||(fallBack && (flickering || horizontalSync))) ? "
|
2014-12-13 16:53:45 +01:00
|
|
|
uniform lowp sampler2D noiseSource;
|
|
|
|
uniform highp vec2 scaleNoiseSize;" : "") +
|
2014-12-26 19:47:11 +01:00
|
|
|
(screenCurvature !== 0 ? "
|
|
|
|
uniform highp float screenCurvature;" : "") +
|
2014-12-23 18:13:34 +01:00
|
|
|
(glowingLine !== 0 ? "
|
|
|
|
uniform highp float glowingLine;" : "") +
|
|
|
|
(chromaColor !== 0 ? "
|
|
|
|
uniform lowp float chromaColor;" : "") +
|
2014-08-08 22:57:51 +02:00
|
|
|
(jitter !== 0 ? "
|
|
|
|
uniform lowp float jitter;" : "") +
|
2014-12-23 18:13:34 +01:00
|
|
|
(rbgShift !== 0 ? "
|
|
|
|
uniform lowp float rbgShift;" : "") +
|
|
|
|
|
|
|
|
(fallBack && horizontalSync !== 0 ? "
|
|
|
|
uniform lowp float horizontalSync;" : "") +
|
|
|
|
(fallBack && flickering !== 0.0 ?"
|
|
|
|
uniform lowp float flickering;" : "") +
|
|
|
|
(!fallBack && flickering !== 0 ? "
|
2014-12-14 09:44:23 +01:00
|
|
|
varying lowp float brightness;"
|
|
|
|
: "") +
|
2014-12-23 18:13:34 +01:00
|
|
|
(!fallBack && horizontalSync !== 0 ? "
|
2014-12-14 09:44:23 +01:00
|
|
|
varying lowp float distortionScale;
|
|
|
|
varying lowp float distortionFreq;" : "") +
|
2014-05-31 21:28:25 +02:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
(glowingLine !== 0 ? "
|
2014-05-31 21:28:25 +02:00
|
|
|
float randomPass(vec2 coords){
|
2015-01-22 01:44:30 +01:00
|
|
|
return fract(smoothstep(-120.0, 0.0, coords.y - (virtual_resolution.y + 120.0) * fract(time * 0.00015)));
|
2014-05-31 21:28:25 +02:00
|
|
|
}" : "") +
|
2014-04-03 15:22:39 +02:00
|
|
|
|
2018-11-05 00:16:52 +01:00
|
|
|
"float min2(vec2 v) {
|
2018-10-27 22:16:11 +02:00
|
|
|
return min(v.x, v.y);
|
|
|
|
}
|
|
|
|
|
2014-12-14 10:31:38 +01:00
|
|
|
float rgb2grey(vec3 v){
|
2014-08-03 14:43:36 +02:00
|
|
|
return dot(v, vec3(0.21, 0.72, 0.04));
|
|
|
|
}" +
|
2014-03-26 01:22:02 +01:00
|
|
|
|
2014-05-31 21:28:25 +02:00
|
|
|
"void main() {" +
|
|
|
|
"vec2 cc = vec2(0.5) - qt_TexCoord0;" +
|
|
|
|
"float distance = length(cc);" +
|
2014-04-06 17:59:19 +02:00
|
|
|
|
2014-12-14 09:44:23 +01:00
|
|
|
//FallBack if there are problems
|
2014-12-23 18:13:34 +01:00
|
|
|
(fallBack && (flickering !== 0.0 || horizontalSync !== 0.0) ?
|
2014-12-14 09:44:23 +01:00
|
|
|
"vec2 initialCoords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));
|
|
|
|
vec4 initialNoiseTexel = texture2D(noiseSource, initialCoords);"
|
|
|
|
: "") +
|
2014-12-23 18:13:34 +01:00
|
|
|
(fallBack && flickering !== 0.0 ? "
|
|
|
|
float brightness = 1.0 + (initialNoiseTexel.g - 0.5) * flickering;"
|
2014-12-14 09:44:23 +01:00
|
|
|
: "") +
|
2014-12-23 18:13:34 +01:00
|
|
|
(fallBack && horizontalSync !== 0.0 ? "
|
|
|
|
float randval = horizontalSync - initialNoiseTexel.r;
|
|
|
|
float distortionScale = step(0.0, randval) * randval * horizontalSync;
|
2014-12-14 09:44:23 +01:00
|
|
|
float distortionFreq = mix(4.0, 40.0, initialNoiseTexel.g);"
|
2014-10-04 14:09:49 +02:00
|
|
|
: "") +
|
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
(staticNoise ? "
|
|
|
|
float noise = staticNoise;" : "") +
|
2013-12-28 14:37:43 +01:00
|
|
|
|
2014-12-26 19:47:11 +01:00
|
|
|
(screenCurvature !== 0 ? "
|
|
|
|
float distortion = dot(cc, cc) * screenCurvature;
|
2014-12-23 13:58:22 +01:00
|
|
|
vec2 staticCoords = (qt_TexCoord0 - cc * (1.0 + distortion) * distortion);"
|
2014-05-31 21:28:25 +02:00
|
|
|
:"
|
2014-12-23 13:58:22 +01:00
|
|
|
vec2 staticCoords = qt_TexCoord0;") +
|
|
|
|
|
|
|
|
"vec2 coords = staticCoords;" +
|
2014-05-29 01:13:31 +02:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
(horizontalSync !== 0 ? "
|
2014-12-14 09:44:23 +01:00
|
|
|
float dst = sin((coords.y + time * 0.001) * distortionFreq);
|
2014-12-15 22:24:57 +01:00
|
|
|
coords.x += dst * distortionScale;" +
|
2014-12-23 18:13:34 +01:00
|
|
|
(staticNoise ? "
|
2014-12-26 19:47:11 +01:00
|
|
|
noise += distortionScale * 7.0;" : "")
|
2014-05-31 21:28:25 +02:00
|
|
|
: "") +
|
2013-12-28 14:37:43 +01:00
|
|
|
|
2018-10-28 23:54:56 +01:00
|
|
|
(jitter !== 0 || staticNoise !== 0 || rbgShift !== 0 ?
|
2014-12-13 16:53:45 +01:00
|
|
|
"vec4 noiseTexel = texture2D(noiseSource, scaleNoiseSize * coords + vec2(fract(time / 51.0), fract(time / 237.0)));"
|
|
|
|
: "") +
|
|
|
|
|
2014-06-20 12:30:42 +02:00
|
|
|
(jitter !== 0 ? "
|
2014-12-13 16:53:45 +01:00
|
|
|
vec2 offset = vec2(noiseTexel.b, noiseTexel.a) - vec2(0.5);
|
2014-08-08 22:57:51 +02:00
|
|
|
vec2 txt_coords = coords + offset * jitter;"
|
2014-06-20 12:30:42 +02:00
|
|
|
: "vec2 txt_coords = coords;") +
|
|
|
|
|
2014-07-31 22:41:54 +02:00
|
|
|
"float color = 0.0;" +
|
2014-04-03 15:06:16 +02:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
(staticNoise !== 0 ? "
|
2014-12-13 16:53:45 +01:00
|
|
|
float noiseVal = noiseTexel.a;
|
2014-06-20 01:54:14 +02:00
|
|
|
color += noiseVal * noise * (1.0 - distance * 1.3);" : "") +
|
2014-04-03 15:06:16 +02:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
(glowingLine !== 0 ? "
|
2015-01-22 01:44:30 +01:00
|
|
|
color += randomPass(coords * virtual_resolution) * glowingLine;" : "") +
|
2014-07-31 22:41:54 +02:00
|
|
|
|
2014-12-15 02:35:13 +01:00
|
|
|
"vec3 txt_color = texture2D(source, txt_coords).rgb;" +
|
2018-10-27 22:16:11 +02:00
|
|
|
"txt_color *= min2(step(vec2(0.0), staticCoords) - step(vec2(1.0), staticCoords));" +
|
2014-12-15 02:35:13 +01:00
|
|
|
|
2018-10-22 23:30:17 +02:00
|
|
|
(rbgShift !== 0 ? "
|
2018-10-28 23:54:56 +01:00
|
|
|
vec2 displacement = vec2(32.0, 0.0) * rbgShift * noiseTexel.r;
|
|
|
|
vec3 rightColor = texture2D(source, txt_coords + displacement).rgb;
|
|
|
|
vec3 leftColor = texture2D(source, txt_coords - displacement).rgb;
|
|
|
|
vec3 rgbShiftColor = vec3(0.0);
|
|
|
|
rgbShiftColor.r = leftColor.r * 0.15 + rightColor.r * 0.7 + txt_color.r * 0.15;
|
|
|
|
rgbShiftColor.g = leftColor.g * 0.15 + rightColor.g * 0.15 + txt_color.g * 0.7;
|
|
|
|
rgbShiftColor.b = leftColor.b * 0.7 + rightColor.b * 0.15 + txt_color.b * 0.15;
|
|
|
|
txt_color = max(txt_color, (rgbShiftColor - txt_color));" : "") +
|
2018-10-22 23:30:17 +02:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
(burnIn !== 0 ? "
|
2015-01-19 17:31:37 +01:00
|
|
|
vec4 txt_blur = texture2D(blurredSource, txt_coords);
|
2018-10-27 22:29:38 +02:00
|
|
|
txt_color = max(txt_color, txt_blur.rgb * txt_blur.a);"
|
2014-12-15 02:35:13 +01:00
|
|
|
: "") +
|
|
|
|
|
|
|
|
"float greyscale_color = rgb2grey(txt_color) + color;" +
|
2014-09-13 22:18:11 +02:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
(chromaColor !== 0 ?
|
2014-09-13 22:18:11 +02:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
"vec3 mixedColor = mix(fontColor.rgb, txt_color * fontColor.rgb, chromaColor);
|
|
|
|
vec3 finalBackColor = mix(backgroundColor.rgb, mixedColor, greyscale_color);
|
|
|
|
vec3 finalColor = mix(finalBackColor, fontColor.rgb, color).rgb;"
|
2014-08-03 14:43:36 +02:00
|
|
|
:
|
2014-12-23 18:13:34 +01:00
|
|
|
"vec3 finalColor = mix(backgroundColor.rgb, fontColor.rgb, greyscale_color);") +
|
2014-08-01 00:04:59 +02:00
|
|
|
|
2018-11-05 00:16:52 +01:00
|
|
|
(appSettings.rasterization != appSettings.no_rasterization ? "
|
|
|
|
finalColor *= texture2D(rasterizationSource, staticCoords * (virtual_resolution)).rgb;
|
|
|
|
" : "") +
|
2014-06-06 23:55:33 +02:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
(bloom !== 0 ?
|
2014-09-14 01:00:38 +02:00
|
|
|
"vec4 bloomFullColor = texture2D(bloomSource, coords);
|
|
|
|
vec3 bloomColor = bloomFullColor.rgb;
|
2014-12-15 22:18:22 +01:00
|
|
|
float bloomAlpha = bloomFullColor.a;" +
|
2014-12-23 18:13:34 +01:00
|
|
|
(chromaColor !== 0 ?
|
|
|
|
"bloomColor = fontColor.rgb * mix(vec3(rgb2grey(bloomColor)), bloomColor, chromaColor);"
|
2014-08-03 14:43:36 +02:00
|
|
|
:
|
2014-12-23 18:13:34 +01:00
|
|
|
"bloomColor = fontColor.rgb * rgb2grey(bloomColor);") +
|
2018-11-01 23:35:55 +01:00
|
|
|
"finalColor += clamp(bloomColor * bloom * bloomAlpha, 0.0, 0.5);"
|
2014-08-03 14:43:36 +02:00
|
|
|
: "") +
|
2014-07-11 01:20:14 +02:00
|
|
|
|
2014-12-23 13:58:22 +01:00
|
|
|
"finalColor *= smoothstep(-dispX, 0.0, staticCoords.x) - smoothstep(1.0, 1.0 + dispX, staticCoords.x);
|
|
|
|
finalColor *= smoothstep(-dispY, 0.0, staticCoords.y) - smoothstep(1.0, 1.0 + dispY, staticCoords.y);" +
|
2014-12-15 22:18:22 +01:00
|
|
|
|
2014-12-23 18:13:34 +01:00
|
|
|
(flickering !== 0 ? "
|
2014-05-31 21:28:25 +02:00
|
|
|
finalColor *= brightness;" : "") +
|
2014-03-31 16:57:51 +02:00
|
|
|
|
2014-08-08 22:57:51 +02:00
|
|
|
"gl_FragColor = vec4(finalColor * screen_brightness, qt_Opacity);" +
|
2014-07-31 22:41:54 +02:00
|
|
|
"}"
|
2014-04-04 02:32:52 +02:00
|
|
|
|
2014-10-04 14:09:49 +02:00
|
|
|
onStatusChanged: {
|
|
|
|
// Print warning messages
|
|
|
|
if (log)
|
|
|
|
console.log(log);
|
|
|
|
|
|
|
|
// Activate fallback mode
|
|
|
|
if (status == ShaderEffect.Error) {
|
|
|
|
fallBack = true;
|
|
|
|
}
|
|
|
|
}
|
2013-12-28 14:37:43 +01:00
|
|
|
}
|