aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2025-03-05 17:27:54 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-05 17:35:57 +0000
commit27e3f04b1b3b189957808b8b5e62fc28d214deaa (patch)
tree6375f3e1414a7f6d0a7e4d74d42c4087884a4359
parentallow disabling texture/ffmpeg support at build time (diff)
downloadglsl-view-27e3f04b1b3b189957808b8b5e62fc28d214deaa.tar.gz
glsl-view-27e3f04b1b3b189957808b8b5e62fc28d214deaa.zip
Update README.md
-rw-r--r--README.md54
1 files changed, 53 insertions, 1 deletions
diff --git a/README.md b/README.md
index ea6ed8d..104f0d9 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,56 @@
+glsl-view
+=========
+
+a minimal GLSL shader host with an OSC interface for setting uniforms in realtime.
+
+OSC interface
+-------------
+
+GLSL uniforms are accessible as `/$UNIFORM_NAME`. The OSC type must match the GLSL type:
+
+ uniform float time = 0;
+ uniform dvec3 color;
+
+ +
+
+ /time f 123.56
+ /color ddd 0.5 0.1 0.1
+
+Vectors and matrices can be indexed using integers or the GLSL swizzling keys (x/y/z/w, r/g/b/a, s/t/p/q):
+
+ uniform vec3 color;
+ uniform mat3 mat;
+
+ +
+
+ /color/r f 0.5
+ /mat/0/y f 123
+
+### samplers
+
+When built with ffmpeg, images and videos can be loaded as 2D or 3D textures:
+
+ uniform sampler2D image;
+ uniform sampler3D videoA;
+ uniform sampler2DArray videoB;
+
+ +
+
+ /image s "image.jpg"
+ /videoA s "subdir/video_a.mp4"
+ /videoB s "subdir/video_b.mov"
+
+The filepaths are interpreted relative to the config file.
+
+### commands
+
+A message to `/-/reload` forces a reload of the shader source code.
+
configuration
-------------
+Configuration is read from `config.yaml` or the only command line argument.
+
- `fragment` (`str`): path to GLSL fragment shader.
- `width` (`int`): horizontal rendering resolution. defaults to `1920`.
- `height` (`int`): vertical rendering resolution. defaults to `1080`.
@@ -9,11 +59,13 @@ configuration
- `type` (`str`): currently always `window`.
- `width` (`int`): window width. defaults to `800`.
- `height` (`int`): window height. defaults to `600`.
+ - `filter` (`str`): one of `nearest` or `linear`.
- `osc`: either a 'liblo URL' or dictionary with the following keys:
- `protocol` (`str`): `udp`, `tcp` or `unix`. defaults to `udp`.
- `port` (`int`): port to bind to. defaults to `9000`.
-### libio URLs
+### liblo URLs
+
Unfortunately undocumented by libio. The following formats are valid:
- `osc.udp://localhost:1234`