glsl-view module reference
glsl-view module reference
glsl-view integration via OSC.
index
- load a stream as a 3d texture source.
- draw a GLSL shader via OSC.
- freeze a texture source.
- get the playback offset of a buffered-stream-source.
- compile a GLSL shader with uniforms.
- step a frozen texture source.
- load a stream texture source.
- load a texture-share-vk texture source.
- override uniform binding type.
- load a video texture source.
details
- load a stream as a 3d texture source.
(stream-source [socket] type depth uri [format] [args])Creates a circular buffer 3d texture from a capture source.
-
typemust be3Dor2D_ARRAY. -
depthis the number of frames to keep in the buffer. -
uriis the ffmpeg URI to load. If it starts with./it will be resolved relative to the current alv module. -
formatoptionally specifies the ffmpeg/avformat input format to use. -
argsis a struct of optional arguments for the ffmpeg/avformat input format.(stream-source 'webcam' '3D' 64 '/dev/video0')
-
- draw a GLSL shader via OSC.
(draw [socket] shader)Syncs code and parameters with glsl-view via OSC.
socketmust be anosc/out~or read from*oscout*shaderis a struct~ withshader(str): GLSL sourceuniforms: struct mapping uniform names to values
- freeze a texture source.
(freeze [socket] source freeze?) - get the playback offset of a buffered-stream-source.
(offset [glsl-type] source)GLSL type: float/double/int/uint
- compile a GLSL shader with uniforms.
$shader"code…"A template string formatter for
glsl-view/drawthat returns a shader struct~.code…is a template string that can contain~-streamtemplate substitutions that are used as follows:str: substituted directly as GLSL- another shader struct~: substituted as GLSL, with uniforms lifted
{type: str val: …}: reference to uniform of GLSL-typetype- other values are implicitly converted as by
glsl-view/uniform
- step a frozen texture source.
(step! [socket] source [trig!]) - load a stream texture source.
(stream-source [socket] type uri [format] [args])Creates a realtime stream from a capture source.
-
typemust be2D. -
uriis the ffmpeg URI to load. If it starts with./it will be resolved relative to the current alv module. -
formatoptionally specifies the ffmpeg/avformat input format to use. -
argsis a struct of optional arguments for the ffmpeg/avformat input format.(stream-source 'webcam' '2D' '/dev/video0') (stream-source 'testpt' '2D' 'testsrc=size=1280x720:rate=30' 'lavfi')
-
- load a texture-share-vk texture source.
(tsv-source [socket] name [type])Creates a texture source from a texture-share-vk texture.
nameis the tsv name of this texture source.typedefaults to2D.
- override uniform binding type.
(uniform [glsl-type] value)Label an alive value with a GLSL type:
(uniform 'sampler2D' 'sampler-name')is equivalent to{'type' 'sampler2D' 'val' 'sampler-name'}.When absent,
glsl-typeis inferred based on the type ofvalue:num,bool:uniform float/boolnum[I],bool[I]:uniform vecI/bvecInum[I][J]:uniform matIxJ
- load a video texture source.
(video-source [socket] type filename [format] [args])Creates a texture source from a video or image file.
typecan be one of:2D:sampler2D(loads first frame only)3Dor2D_ARRAY:sampler3D/sampler2DArray(loads whole video)
filenameis the video file to load. If it starts with./it will be resolved relative to the current alv module.formatoptionally specifies the ffmpeg/avformat input format to use.argsis a struct of optional arguments for the ffmpeg/avformat input format.