mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2026-02-08 00:32:27 +00:00
Improve noise scale and frameskip for effects.
This commit is contained in:
@@ -31,8 +31,8 @@ QtObject {
|
||||
readonly property real minimumFontScaling: 0.25
|
||||
readonly property real maximumFontScaling: 2.50
|
||||
|
||||
readonly property real minBurnInFadeTime: 160
|
||||
readonly property real maxBurnInFadeTime: 1600
|
||||
readonly property real minBurnInFadeTime: 0.16
|
||||
readonly property real maxBurnInFadeTime: 1.6
|
||||
|
||||
property bool isMacOS: Qt.platform.os === "osx"
|
||||
|
||||
@@ -50,7 +50,7 @@ QtObject {
|
||||
property bool showTerminalSize: true
|
||||
property real windowScaling: 1.0
|
||||
|
||||
property real fps: 20
|
||||
property int effectsFrameSkip: 2
|
||||
property bool verbose: false
|
||||
|
||||
property real bloomQuality: 0.5
|
||||
@@ -229,7 +229,7 @@ QtObject {
|
||||
|
||||
function composeSettingsString() {
|
||||
var settings = {
|
||||
"fps": fps,
|
||||
"effectsFrameSkip": effectsFrameSkip,
|
||||
"x": x,
|
||||
"y": y,
|
||||
"width": width,
|
||||
@@ -315,7 +315,7 @@ QtObject {
|
||||
showTerminalSize = settings.showTerminalSize
|
||||
!== undefined ? settings.showTerminalSize : showTerminalSize
|
||||
|
||||
fps = settings.fps !== undefined ? settings.fps : fps
|
||||
effectsFrameSkip = settings.effectsFrameSkip !== undefined ? settings.effectsFrameSkip : effectsFrameSkip
|
||||
windowScaling = settings.windowScaling
|
||||
!== undefined ? settings.windowScaling : windowScaling
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ Item{
|
||||
ShaderEffectSource{
|
||||
id: kterminalSource
|
||||
sourceItem: kterminal
|
||||
hideSource: false
|
||||
hideSource: true
|
||||
wrapMode: ShaderEffectSource.Repeat
|
||||
visible: false
|
||||
textureSize: Qt.size(kterminal.totalWidth * scaleTexture, kterminal.totalHeight * scaleTexture)
|
||||
|
||||
@@ -73,24 +73,17 @@ ColumnLayout {
|
||||
Slider {
|
||||
Layout.fillWidth: true
|
||||
Layout.columnSpan: 2
|
||||
id: fpsSlider
|
||||
onValueChanged: {
|
||||
if (enabled) {
|
||||
appSettings.fps = value !== 60 ? value + 1 : 0
|
||||
}
|
||||
}
|
||||
id: effectsFpsSlider
|
||||
onValueChanged: appSettings.effectsFrameSkip = Math.round(value)
|
||||
stepSize: 1
|
||||
enabled: false
|
||||
Component.onCompleted: {
|
||||
from = 0
|
||||
to = 60
|
||||
value = appSettings.fps !== 0 ? appSettings.fps - 1 : 60
|
||||
enabled = true
|
||||
}
|
||||
enabled: true
|
||||
from: 5
|
||||
to: 1
|
||||
value: appSettings.effectsFrameSkip
|
||||
}
|
||||
|
||||
SizedLabel {
|
||||
text: appSettings.fps !== 0 ? appSettings.fps : qsTr("Max")
|
||||
text: Math.round(100 / Math.max(1, Math.round(effectsFpsSlider.value))) + "%"
|
||||
}
|
||||
Label {
|
||||
text: qsTr("Texture Quality")
|
||||
@@ -99,15 +92,11 @@ ColumnLayout {
|
||||
id: txtslider
|
||||
Layout.fillWidth: true
|
||||
Layout.columnSpan: 2
|
||||
onValueChanged: if (enabled)
|
||||
appSettings.windowScaling = value
|
||||
onValueChanged: appSettings.windowScaling = value
|
||||
stepSize: 0.05
|
||||
enabled: false
|
||||
Component.onCompleted: {
|
||||
from = 0.25 //Without this value gets set to 0.5
|
||||
value = appSettings.windowScaling
|
||||
enabled = true
|
||||
}
|
||||
enabled: true
|
||||
from: 0.25
|
||||
value: appSettings.windowScaling
|
||||
}
|
||||
SizedLabel {
|
||||
text: Math.round(txtslider.value * 100) + "%"
|
||||
@@ -120,15 +109,11 @@ ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.columnSpan: 2
|
||||
id: bloomSlider
|
||||
onValueChanged: if (enabled)
|
||||
appSettings.bloomQuality = value
|
||||
onValueChanged: appSettings.bloomQuality = value
|
||||
stepSize: 0.05
|
||||
enabled: false
|
||||
Component.onCompleted: {
|
||||
from = 0.25
|
||||
value = appSettings.bloomQuality
|
||||
enabled = true
|
||||
}
|
||||
enabled: true
|
||||
from: 0.25
|
||||
value: appSettings.bloomQuality
|
||||
}
|
||||
SizedLabel {
|
||||
text: Math.round(bloomSlider.value * 100) + "%"
|
||||
@@ -141,15 +126,11 @@ ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
id: burnInSlider
|
||||
Layout.columnSpan: 2
|
||||
onValueChanged: if (enabled)
|
||||
appSettings.burnInQuality = value
|
||||
onValueChanged: appSettings.burnInQuality = value
|
||||
stepSize: 0.05
|
||||
enabled: false
|
||||
Component.onCompleted: {
|
||||
from = 0.25
|
||||
value = appSettings.burnInQuality
|
||||
enabled = true
|
||||
}
|
||||
enabled: true
|
||||
from: 0.25
|
||||
value: appSettings.burnInQuality
|
||||
}
|
||||
SizedLabel {
|
||||
text: Math.round(burnInSlider.value * 100) + "%"
|
||||
|
||||
@@ -17,22 +17,29 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*******************************************************************************/
|
||||
import QtQuick 2.2
|
||||
import QtQuick
|
||||
|
||||
Timer {
|
||||
default property bool enableTimer: false
|
||||
property real time
|
||||
QtObject {
|
||||
id: timeManager
|
||||
|
||||
NumberAnimation on time {
|
||||
from: 0
|
||||
to: 100000
|
||||
running: appSettings.fps === 0 && enableTimer
|
||||
duration: 100000
|
||||
loops: Animation.Infinite
|
||||
property bool enableTimer: false
|
||||
property real time: 0
|
||||
|
||||
property int framesPerUpdate: Math.max(1, appSettings.effectsFrameSkip)
|
||||
property int _frameCounter: 0
|
||||
|
||||
property var frameDriver: FrameAnimation {
|
||||
running: enableTimer
|
||||
onTriggered: {
|
||||
timeManager._frameCounter += 1
|
||||
|
||||
if (timeManager._frameCounter >= timeManager.framesPerUpdate) {
|
||||
time = elapsedTime
|
||||
timeManager._frameCounter = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onTriggered: time += interval
|
||||
running: appSettings.fps !== 0 && enableTimer
|
||||
interval: Math.round(1000 / appSettings.fps)
|
||||
repeat: true
|
||||
onEnableTimerChanged: if (!enableTimer) _frameCounter = 0
|
||||
onFramesPerUpdateChanged: _frameCounter = 0
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ vec3 applyRasterization(vec2 screenCoords, vec3 texel, vec2 virtualRes, float in
|
||||
}
|
||||
|
||||
float randomPass(vec2 coords){
|
||||
return fract(smoothstep(-120.0, 0.0, coords.y - (virtualResolution.y + 120.0) * fract(time * 0.00015)));
|
||||
return fract(smoothstep(-120.0, 0.0, coords.y - (virtualResolution.y + 120.0) * fract(time * 0.15)));
|
||||
}
|
||||
|
||||
vec2 barrel(vec2 v, vec2 cc) {
|
||||
@@ -125,10 +125,10 @@ void main() {
|
||||
vec2 staticCoords = barrel(qt_TexCoord0, cc);
|
||||
vec2 coords = qt_TexCoord0;
|
||||
|
||||
float dst = sin((coords.y + time * 0.001) * vDistortionFreq);
|
||||
float dst = sin((coords.y + time) * vDistortionFreq);
|
||||
coords.x += dst * vDistortionScale;
|
||||
|
||||
vec4 noiseTexel = texture(noiseSource, scaleNoiseSize * coords + vec2(fract(time / 51.0), fract(time / 237.0)));
|
||||
vec4 noiseTexel = texture(noiseSource, scaleNoiseSize * coords + vec2(fract(time / 0.051), fract(time / 0.237)));
|
||||
|
||||
vec2 txt_coords = coords + (noiseTexel.ba - vec2(0.5)) * jitterDisplacement * jitter;
|
||||
|
||||
|
||||
Binary file not shown.
@@ -48,7 +48,7 @@ layout(location = 3) out float vDistortionFreq;
|
||||
void main() {
|
||||
qt_TexCoord0 = qt_MultiTexCoord0;
|
||||
|
||||
vec2 coords = vec2(fract(time / 2048.0), fract(time / 1048576.0));
|
||||
vec2 coords = vec2(fract(time / 2.048), fract(time / 1048.576));
|
||||
vec4 initialNoiseTexel = texture(noiseSource, coords);
|
||||
|
||||
vBrightness = 1.0 + (initialNoiseTexel.g - 0.5) * flickering;
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user