mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-01-18 12:15:27 +00:00
Resore frames functionalities.
This commit is contained in:
parent
bc87df170b
commit
b4bf29dc9e
@ -167,6 +167,7 @@ Item{
|
||||
sourceItem: kterminal
|
||||
hideSource: true
|
||||
smooth: mScanlines == shadersettings.no_rasterization
|
||||
wrapMode: ShaderEffectSource.ClampToEdge
|
||||
}
|
||||
Loader{
|
||||
id: blurredSourceLoader
|
||||
@ -178,6 +179,7 @@ Item{
|
||||
recursive: true
|
||||
live: false
|
||||
hideSource: true
|
||||
wrapMode: kterminalSource.wrapMode
|
||||
|
||||
smooth: mScanlines == shadersettings.no_rasterization
|
||||
|
||||
@ -275,6 +277,7 @@ Item{
|
||||
sourceItem: bloomEffectLoader.item
|
||||
hideSource: true
|
||||
smooth: false
|
||||
wrapMode: ShaderEffectSource.ClampToEdge
|
||||
}
|
||||
}
|
||||
|
||||
@ -445,5 +448,6 @@ Item{
|
||||
sourceItem: rasterizationEffect
|
||||
hideSource: true
|
||||
smooth: true
|
||||
wrapMode: ShaderEffectSource.Repeat
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ ShaderEffect {
|
||||
property variant bloomSource: terminal.bloomSource
|
||||
property variant rasterizationSource: terminal.rasterizationSource
|
||||
property variant noiseSource: terminal.staticNoiseSource
|
||||
property size txt_Size: Qt.size(frame.sourceRect.width, frame.sourceRect.height)
|
||||
property real bloom_strength: shadersettings.bloom_strength * 2.5
|
||||
|
||||
property real jitter: shadersettings.jitter * 0.007
|
||||
@ -47,10 +46,10 @@ ShaderEffect {
|
||||
|
||||
property bool frameReflections: shadersettings.frameReflections
|
||||
|
||||
property real disp_top: frame.item.displacementTop * shadersettings.window_scaling
|
||||
property real disp_bottom: frame.item.displacementBottom * shadersettings.window_scaling
|
||||
property real disp_left: frame.item.displacementLeft * shadersettings.window_scaling
|
||||
property real disp_right: frame.item.displacementRight * shadersettings.window_scaling
|
||||
property real disp_top: frame.item.displacementTop / height
|
||||
property real disp_bottom: frame.item.displacementBottom / height
|
||||
property real disp_left: frame.item.displacementLeft / width
|
||||
property real disp_right: frame.item.displacementRight / width
|
||||
|
||||
property real screen_brightness: shadersettings.brightness * 1.5 + 0.5
|
||||
|
||||
@ -86,7 +85,11 @@ ShaderEffect {
|
||||
uniform highp mat4 qt_Matrix;
|
||||
uniform highp float time;
|
||||
uniform sampler2D randomFunctionSource;
|
||||
uniform highp vec2 txt_Size;
|
||||
|
||||
uniform highp float disp_left;
|
||||
uniform highp float disp_right;
|
||||
uniform highp float disp_top;
|
||||
uniform highp float disp_bottom;
|
||||
|
||||
attribute highp vec4 qt_Vertex;
|
||||
attribute highp vec2 qt_MultiTexCoord0;
|
||||
@ -101,7 +104,8 @@ ShaderEffect {
|
||||
uniform lowp float horizontal_sincronization;" : "") +
|
||||
"
|
||||
void main() {
|
||||
qt_TexCoord0 = qt_MultiTexCoord0;
|
||||
qt_TexCoord0.x = -disp_left + qt_MultiTexCoord0.x * (1.0 + disp_left + disp_right);
|
||||
qt_TexCoord0.y = -disp_top + qt_MultiTexCoord0.y * (1.0 + disp_top + disp_bottom);
|
||||
vec2 coords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0)));" +
|
||||
(brightness_flickering !== 0.0 ? "
|
||||
brightness = 1.0 + (texture2D(randomFunctionSource, coords).g - 0.5) * brightness_flickering;"
|
||||
@ -120,7 +124,6 @@ ShaderEffect {
|
||||
uniform sampler2D source;
|
||||
uniform highp float qt_Opacity;
|
||||
uniform highp float time;
|
||||
uniform highp vec2 txt_Size;
|
||||
varying highp vec2 qt_TexCoord0;
|
||||
|
||||
uniform highp vec4 font_color;
|
||||
@ -172,9 +175,9 @@ ShaderEffect {
|
||||
:"
|
||||
vec2 coords = qt_TexCoord0;") +
|
||||
|
||||
(frameReflections ? "
|
||||
vec2 inside = step(0.0, coords) - step(1.0, coords);
|
||||
coords = abs(mod(floor(coords), 2.0) - fract(coords)) * clamp(inside.x + inside.y, 0.0, 1.0);" : "") +
|
||||
// (frameReflections ? "
|
||||
// vec2 inside = step(0.0, coords) - step(1.0, coords);
|
||||
// coords = abs(mod(floor(coords), 2.0) - fract(coords)) * clamp(inside.x + inside.y, 0.0, 1.0);" : "") +
|
||||
|
||||
(horizontal_sincronization !== 0 ? "
|
||||
float h_distortion = 0.5 * sin(time*0.001 + coords.y*10.0*fract(time/10.0));
|
||||
|
@ -7,22 +7,19 @@ TerminalFrame{
|
||||
anchors.fill: parent
|
||||
addedWidth: 200
|
||||
addedHeight: 370
|
||||
borderLeft: 148
|
||||
borderRight: 148
|
||||
borderTop: 232
|
||||
borderBottom: 232
|
||||
borderLeft: 170
|
||||
borderRight: 170
|
||||
borderTop: 250
|
||||
borderBottom: 250
|
||||
imageSource: "../images/black-frame.png"
|
||||
normalsSource: "../images/black-frame-normals.png"
|
||||
|
||||
rectX: 20
|
||||
rectY: 20
|
||||
|
||||
distortionCoefficient: 1.9
|
||||
|
||||
displacementLeft: 70.0
|
||||
displacementTop: 55.0
|
||||
displacementRight: 50.0
|
||||
displacementBottom: 38.0
|
||||
displacementLeft: 80.0
|
||||
displacementTop: 65.0
|
||||
displacementRight: 80.0
|
||||
displacementBottom: 65.0
|
||||
|
||||
shaderString: "FrameShader.qml"
|
||||
}
|
||||
|
@ -12,9 +12,6 @@ TerminalFrame{
|
||||
borderTop: 0
|
||||
borderBottom: 0
|
||||
|
||||
rectX: 15
|
||||
rectY: 15
|
||||
|
||||
displacementLeft: 0
|
||||
displacementTop: 0
|
||||
displacementRight: 0
|
||||
|
@ -14,15 +14,12 @@ TerminalFrame{
|
||||
imageSource: "../images/screen-frame.png"
|
||||
normalsSource: "../images/screen-frame-normals.png"
|
||||
|
||||
rectX: 15
|
||||
rectY: 15
|
||||
|
||||
distortionCoefficient: 1.5
|
||||
|
||||
displacementLeft: 45
|
||||
displacementTop: 40
|
||||
displacementRight: 38.0
|
||||
displacementBottom: 28.0
|
||||
displacementLeft: 55
|
||||
displacementTop: 50
|
||||
displacementRight: 55
|
||||
displacementBottom: 50
|
||||
|
||||
shaderString: "FrameShader.qml"
|
||||
}
|
||||
|
@ -15,10 +15,6 @@ Item{
|
||||
property string normalsSource
|
||||
property string shaderString
|
||||
|
||||
//Value used to create the rect used to add the border to the texture
|
||||
property real rectX
|
||||
property real rectY
|
||||
|
||||
//Values used to displace the texture in the screen. Used to make reflections correct.
|
||||
property real displacementLeft
|
||||
property real displacementTop
|
||||
@ -27,11 +23,6 @@ Item{
|
||||
|
||||
property real distortionCoefficient
|
||||
|
||||
property rect sourceRect: Qt.rect(-rectX * shadersettings.window_scaling,
|
||||
-rectY * shadersettings.window_scaling,
|
||||
terminal.width + 2*rectX * shadersettings.window_scaling,
|
||||
terminal.height + 2*rectY * shadersettings.window_scaling)
|
||||
|
||||
BorderImage{
|
||||
id: frameimage
|
||||
anchors.centerIn: parent
|
||||
|
@ -153,9 +153,6 @@ ApplicationWindow{
|
||||
Loader{
|
||||
id: frame
|
||||
anchors.fill: parent
|
||||
|
||||
property rect sourceRect: item.sourceRect
|
||||
|
||||
z: 2.1
|
||||
source: shadersettings.frame_source
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user