mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-02-20 20:09:14 +00:00
Added jitter effect.
This commit is contained in:
parent
21c7f2c23e
commit
431ec6d133
@ -270,6 +270,11 @@ Window {
|
||||
onValueChanged: shadersettings.noise_strength = value
|
||||
_value: shadersettings.noise_strength
|
||||
}
|
||||
SettingComponent{
|
||||
name: "Jitter"
|
||||
onValueChanged: shadersettings.jitter = value
|
||||
_value: shadersettings.jitter
|
||||
}
|
||||
SettingComponent{
|
||||
name: "Glow"
|
||||
onValueChanged: shadersettings.glowing_line_strength = value;
|
||||
|
@ -33,6 +33,8 @@ ShaderEffect {
|
||||
|
||||
property int rasterization: shadersettings.rasterization
|
||||
|
||||
property real jitter: shadersettings.jitter * 0.007
|
||||
|
||||
property real noise_strength: shadersettings.noise_strength
|
||||
property real screen_distorsion: shadersettings.screen_distortion
|
||||
property real glowing_line_strength: shadersettings.glowing_line_strength
|
||||
@ -105,7 +107,8 @@ ShaderEffect {
|
||||
(bloom !== 0 ? "
|
||||
uniform highp sampler2D bloomSource;" : "") +
|
||||
(noise_strength !== 0 ? "
|
||||
uniform highp float noise_strength;
|
||||
uniform highp float noise_strength;" : "") +
|
||||
(noise_strength !== 0 || jitter !== 0 ? "
|
||||
uniform lowp sampler2D noiseSource;" : "") +
|
||||
(screen_distorsion !== 0 ? "
|
||||
uniform highp float screen_distorsion;" : "")+
|
||||
@ -147,7 +150,13 @@ ShaderEffect {
|
||||
noise += horizontal_distortion;" : "")
|
||||
: "") +
|
||||
|
||||
"float color = texture2D(source, coords).a;" +
|
||||
(jitter !== 0 ? "
|
||||
vec2 offset = vec2(texture2D(noiseSource, coords + fract(time / 57.0)).a,
|
||||
texture2D(noiseSource, coords + fract(time / 251.0)).a) - 0.5;
|
||||
vec2 txt_coords = coords + offset * "+str(jitter)+";"
|
||||
: "vec2 txt_coords = coords;") +
|
||||
|
||||
"float color = texture2D(source, txt_coords).a;" +
|
||||
|
||||
(noise_strength !== 0 ? "
|
||||
float noiseVal = texture2D(noiseSource, qt_TexCoord0 + vec2(fract(time / 51.0), fract(time / 237.0))).a;
|
||||
|
@ -60,6 +60,8 @@ Item{
|
||||
property real motion_blur: 0.65
|
||||
property real bloom_strength: 0.6
|
||||
|
||||
property real jitter: 0.15
|
||||
|
||||
property real horizontal_sincronization: 0.1
|
||||
property real brightness_flickering: 0.12
|
||||
|
||||
@ -240,7 +242,8 @@ Item{
|
||||
font_index: font_index,
|
||||
motion_blur: motion_blur,
|
||||
bloom_strength: bloom_strength,
|
||||
rasterization: rasterization
|
||||
rasterization: rasterization,
|
||||
jitter: jitter
|
||||
}
|
||||
return JSON.stringify(settings);
|
||||
}
|
||||
@ -304,6 +307,8 @@ Item{
|
||||
font_index = settings.font_index !== undefined ? settings.font_index : font_index;
|
||||
|
||||
rasterization = settings.rasterization !== undefined ? settings.rasterization : rasterization;
|
||||
|
||||
jitter = settings.jitter !== undefined ? settings.jitter : jitter
|
||||
}
|
||||
|
||||
function storeCustomProfiles(){
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 3.0.1, 2014-06-11T00:00:49. -->
|
||||
<!-- Written by QtCreator 3.0.1, 2014-06-20T12:25:11. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
|
Loading…
x
Reference in New Issue
Block a user