1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2025-02-07 05:31:24 +00:00

Use already available shaderEffectSource and improve bloom look at low quality by limiting minimum radius.

This commit is contained in:
Filippo Scognamiglio 2015-01-05 21:47:42 +01:00
parent 6979abe96a
commit cf404f980d
3 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,8 @@
import QtQuick 2.2 import QtQuick 2.2
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import "utils.js" as Utils
ShaderTerminal{ ShaderTerminal{
property alias title: terminal.title property alias title: terminal.title
property alias terminalSize: terminal.terminalSize property alias terminalSize: terminal.terminalSize
@ -45,9 +47,10 @@ ShaderTerminal{
asynchronous: true asynchronous: true
width: parent.width * appSettings.bloomQuality width: parent.width * appSettings.bloomQuality
height: parent.height * appSettings.bloomQuality height: parent.height * appSettings.bloomQuality
sourceComponent: FastBlur{ sourceComponent: FastBlur{
radius: 48 * appSettings.bloomQuality * appSettings.windowScaling radius: Utils.lint(16, 48, appSettings.bloomQuality * appSettings.windowScaling);
source: terminal.mainTerminal source: terminal.mainSource
transparentBorder: true transparentBorder: true
} }
} }

View File

@ -83,7 +83,7 @@ Item{
sourceComponent: FastBlur{ sourceComponent: FastBlur{
id: frameReflectionEffect id: frameReflectionEffect
radius: 128 radius: 128
source: terminal.kterminal source: terminal.mainSource
smooth: false smooth: false
} }
} }

View File

@ -1,5 +1,8 @@
.pragma library .pragma library
function lint(a, b, t) {
return (1 - t) * a + (t) * b;
}
function mix(c1, c2, alpha){ function mix(c1, c2, alpha){
return Qt.rgba(c1.r * alpha + c2.r * (1-alpha), return Qt.rgba(c1.r * alpha + c2.r * (1-alpha),
c1.g * alpha + c2.g * (1-alpha), c1.g * alpha + c2.g * (1-alpha),