diff options
| author | s-ol <s+removethis@s-ol.nu> | 2025-09-14 13:55:26 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-09-14 15:39:20 +0000 |
| commit | 4e1bab057ffb010076ae3948b93028ca5e22c3b2 (patch) | |
| tree | 62355972fcb70b6f03a3badce7cda41ed32438aa /examples | |
| parent | lib/glsl-view: use tag for texture, uniform names (diff) | |
| download | alive-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.alv | 24 |
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; +}") |
