aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2025-09-14 13:55:26 +0000
committers-ol <s+removethis@s-ol.nu>2025-09-14 15:39:20 +0000
commit4e1bab057ffb010076ae3948b93028ca5e22c3b2 (patch)
tree62355972fcb70b6f03a3badce7cda41ed32438aa /examples
parentlib/glsl-view: use tag for texture, uniform names (diff)
downloadalive-4e1bab057ffb010076ae3948b93028ca5e22c3b2.tar.gz
alive-4e1bab057ffb010076ae3948b93028ca5e22c3b2.zip
lib/glsl-view: assemble uniform preamble in send
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;
+}")