aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/glsl-view/nesting.alv24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/glsl-view/nesting.alv b/examples/glsl-view/nesting.alv
new file mode 100644
index 0000000..8c76695
--- /dev/null
+++ b/examples/glsl-view/nesting.alv
@@ -0,0 +1,24 @@
+([1]import* glsl-view time string)
+([2]import osc)
+
+([4]def *oscout* ([3]osc/connect 'localhost' 9000))
+
+([10]defn testpat [w h uv]
+ ([9]do
+ ([7]def source ([6]stream-source '2D' ([5]str 'testsrc=size=' w 'x' h ':rate=30') 'lavfi'))
+
+ $[8]shader"texture($source , round($uv * vec2($w , $h)) / vec2($w , $h)).rgb"))
+
+([14]draw
+ $[13]shader"
+in vec2 uv;
+out vec4 color;
+
+void main() {
+ vec3 hi = $([11]testpat 1280 720 "uv");
+ vec3 lo = $([17]testpat 16 9 "uv");
+
+ color.rgb = mix(hi, lo, $([12]lfo 1));
+
+ color.a = 1.0;
+}")