Skip to content

Commit

Permalink
Fix flow; only call Tile.insertAfter(node) if the node was successful…
Browse files Browse the repository at this point in the history
…ly created
  • Loading branch information
zbanks committed Oct 20, 2017
1 parent 361d999 commit 6715d6b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion BTrack
4 changes: 2 additions & 2 deletions resources/effects/flow.glsl
Expand Up @@ -11,10 +11,10 @@ void main(void) {
void main(void) {

gl_FragColor = texture2D(iChannel[1], (uv - 0.5) * 0.98 + 0.5);
gl_FragColor.a *= exp((iIntensity - 2.) / 50.) * smoothstep(0, 0.01, length((uv - 0.5) * aspectCorrection));
gl_FragColor *= exp((iIntensity - 2.) / 50.) * smoothstep(0, 0.01, length((uv - 0.5) * aspectCorrection));

vec4 c = texture2D(iInput, uv);
float s = smoothstep(0.90, 1., 1. - mod(iTime, 1.)) * iAudioLevel;
float s = smoothstep(0.90, 1., 1. - mod(iTime, 1.)) * mix(0.01, 1.0, iAudioLevel);
c *= min(3. * s, 1.);
gl_FragColor = composite(gl_FragColor, c);
}
4 changes: 2 additions & 2 deletions resources/effects/rolling.glsl
Expand Up @@ -2,10 +2,10 @@

void main(void) {
float rate = 4.;
float yv = 1.0 - mod(iTime, 4.) / 4.;
float yv = 1.0 - mod(iTime, rate) / rate;
vec4 old = texture2D(iChannel[0], uv);
vec4 new = texture2D(iInput, uv);
float dist = abs(uv.y - yv); // TODO: make this wrap around
gl_FragColor = mix(old, new, max(0., 1.0 - iFPS * 0.5 * dist));
gl_FragColor = mix(old, new, max(0., 1.0 - iFPS * 0.2 * dist));
gl_FragColor = mix(new, gl_FragColor, pow(iIntensity, 0.1));
}
2 changes: 1 addition & 1 deletion resources/qml/application.qml
Expand Up @@ -144,7 +144,7 @@ ApplicationWindow {
id: nodeAddAction
onTriggered: {
var node = model.createVideoNode(nodeSelector.currentText);
if (graph.lastClickedTile) {
if (node && graph.lastClickedTile) {
graph.lastClickedTile.insertAfter(node);
}
model.flush();
Expand Down

0 comments on commit 6715d6b

Please sign in to comment.