videocontext
Advanced tools
Comparing version 0.19.1 to 0.20.0
{ | ||
"name": "videocontext", | ||
"version": "0.19.1", | ||
"version": "0.20.0", | ||
"description": "A WebGL & HTML5 graph based video composition library", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -930,2 +930,145 @@ //Matthew Shotton, R&D User Experience,© BBC 2015 | ||
var horizontalWipe = { | ||
title:"Horizontal Wipe", | ||
description: "A horizontal wipe effect. Typically used as a transistion.", | ||
vertexShader : "\ | ||
attribute vec2 a_position;\ | ||
attribute vec2 a_texCoord;\ | ||
varying vec2 v_texCoord;\ | ||
void main() {\ | ||
gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\ | ||
v_texCoord = a_texCoord;\ | ||
}", | ||
fragmentShader : "\ | ||
precision mediump float;\ | ||
uniform sampler2D u_image_a;\ | ||
uniform sampler2D u_image_b;\ | ||
uniform float mix;\ | ||
varying vec2 v_texCoord;\ | ||
varying float v_mix;\ | ||
void main(){\ | ||
vec4 color_a = texture2D(u_image_a, v_texCoord);\ | ||
vec4 color_b = texture2D(u_image_b, v_texCoord);\ | ||
if (v_texCoord[0] > mix){\ | ||
gl_FragColor = color_a;\ | ||
} else {\ | ||
gl_FragColor = color_b;\ | ||
}\ | ||
}", | ||
properties:{ | ||
"mix":{type:"uniform", value:0.0} | ||
}, | ||
inputs:["u_image_a","u_image_b"] | ||
}; | ||
var verticalWipe = { | ||
title:"vertical Wipe", | ||
description: "A vertical wipe effect. Typically used as a transistion.", | ||
vertexShader : "\ | ||
attribute vec2 a_position;\ | ||
attribute vec2 a_texCoord;\ | ||
varying vec2 v_texCoord;\ | ||
void main() {\ | ||
gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\ | ||
v_texCoord = a_texCoord;\ | ||
}", | ||
fragmentShader : "\ | ||
precision mediump float;\ | ||
uniform sampler2D u_image_a;\ | ||
uniform sampler2D u_image_b;\ | ||
uniform float mix;\ | ||
varying vec2 v_texCoord;\ | ||
varying float v_mix;\ | ||
void main(){\ | ||
vec4 color_a = texture2D(u_image_a, v_texCoord);\ | ||
vec4 color_b = texture2D(u_image_b, v_texCoord);\ | ||
if (v_texCoord[1] > mix){\ | ||
gl_FragColor = color_a;\ | ||
} else {\ | ||
gl_FragColor = color_b;\ | ||
}\ | ||
}", | ||
properties:{ | ||
"mix":{type:"uniform", value:0.0} | ||
}, | ||
inputs:["u_image_a","u_image_b"] | ||
}; | ||
var randomDissolve = { | ||
title:"Random Dissolve", | ||
description: "A random dissolve effect. Typically used as a transistion.", | ||
vertexShader : "\ | ||
attribute vec2 a_position;\ | ||
attribute vec2 a_texCoord;\ | ||
varying vec2 v_texCoord;\ | ||
void main() {\ | ||
gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\ | ||
v_texCoord = a_texCoord;\ | ||
}", | ||
fragmentShader : "\ | ||
precision mediump float;\ | ||
uniform sampler2D u_image_a;\ | ||
uniform sampler2D u_image_b;\ | ||
uniform float mix;\ | ||
varying vec2 v_texCoord;\ | ||
varying float v_mix;\ | ||
float rand(vec2 co){\ | ||
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\ | ||
}\ | ||
void main(){\ | ||
vec4 color_a = texture2D(u_image_a, v_texCoord);\ | ||
vec4 color_b = texture2D(u_image_b, v_texCoord);\ | ||
if (clamp(rand(v_texCoord), 0.01, 1.001) > mix){\ | ||
gl_FragColor = color_a;\ | ||
} else {\ | ||
gl_FragColor = color_b;\ | ||
}\ | ||
}", | ||
properties:{ | ||
"mix":{type:"uniform", value:0.0} | ||
}, | ||
inputs:["u_image_a","u_image_b"] | ||
}; | ||
var toColorAndBackFade = { | ||
title:"To Color And Back Fade", | ||
description: "A fade to black and back effect. Setting mix to 0.5 is a fully solid color frame. Typically used as a transistion.", | ||
vertexShader : "\ | ||
attribute vec2 a_position;\ | ||
attribute vec2 a_texCoord;\ | ||
varying vec2 v_texCoord;\ | ||
void main() {\ | ||
gl_Position = vec4(vec2(2.0,2.0)*a_position-vec2(1.0, 1.0), 0.0, 1.0);\ | ||
v_texCoord = a_texCoord;\ | ||
}", | ||
fragmentShader : "\ | ||
precision mediump float;\ | ||
uniform sampler2D u_image_a;\ | ||
uniform sampler2D u_image_b;\ | ||
uniform float mix;\ | ||
uniform vec4 color;\ | ||
varying vec2 v_texCoord;\ | ||
varying float v_mix;\ | ||
float rand(vec2 co){\ | ||
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\ | ||
}\ | ||
void main(){\ | ||
vec4 color_a = texture2D(u_image_a, v_texCoord);\ | ||
vec4 color_b = texture2D(u_image_b, v_texCoord);\ | ||
float mix_amount = (mix *2.0) - 1.0;\ | ||
if(mix_amount < 0.0){\ | ||
gl_FragColor = abs(mix_amount) * color_a + (1.0 - abs(mix_amount)) * color;\ | ||
} else {\ | ||
gl_FragColor = mix_amount * color_b + (1.0 - mix_amount) * color;\ | ||
}\ | ||
}", | ||
properties:{ | ||
"mix":{type:"uniform", value:0.0}, | ||
"color":{type:"uniform", value:[0.0,0.0,0.0,0.0]} | ||
}, | ||
inputs:["u_image_a","u_image_b"] | ||
}; | ||
var combine ={ | ||
@@ -1137,2 +1280,6 @@ title:"Combine", | ||
CROSSFADE: crossfade, | ||
HORIZONTAL_WIPE:horizontalWipe, | ||
VERTICAL_WIPE:verticalWipe, | ||
RANDOM_DISSOLVE:randomDissolve, | ||
TO_COLOR_AND_BACK: toColorAndBackFade, | ||
COMBINE: combine, | ||
@@ -1139,0 +1286,0 @@ COLORTHRESHOLD: colorThreshold, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2502693
12232