{"id":16981369,"url":"https://github.com/gnd/glslr","last_synced_at":"2025-06-19T18:42:58.686Z","repository":{"id":96456877,"uuid":"60869181","full_name":"gnd/glslr","owner":"gnd","description":"Ultra-lightweight GLSL livecoding framework.","archived":false,"fork":false,"pushed_at":"2023-12-28T11:15:39.000Z","size":509,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-25T21:51:22.620Z","etag":null,"topics":["glsl","glsl-livecoding-framework","glsl-shaders","linux","macosx","shader"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gnd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-06-10T18:34:28.000Z","updated_at":"2023-12-28T11:15:43.000Z","dependencies_parsed_at":"2023-04-11T01:00:07.788Z","dependency_job_id":null,"html_url":"https://github.com/gnd/glslr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnd%2Fglslr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnd%2Fglslr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnd%2Fglslr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnd%2Fglslr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnd","download_url":"https://codeload.github.com/gnd/glslr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505921,"owners_count":21115354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["glsl","glsl-livecoding-framework","glsl-shaders","linux","macosx","shader"],"created_at":"2024-10-14T02:05:18.346Z","updated_at":"2025-04-12T02:20:34.746Z","avatar_url":"https://github.com/gnd.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glslr\n\n![Ultra-lightweight GLSL interpreter](glslr.png)\n\n## Features\n- Ultra-lightweight GLSL livecoding framework for Linux and Mac OS X.\n- Enables quick fragment shader development in your favorite editor.\n- Changes in the fragment shader are compiled in realtime.\n- Uniform variables can be filled with data received from a socket.\n- Enables GLSL code-reuse across projects with support of #include.\n- Has experimental Video4Linux support.\n- Has support for livestreaming from a Sony AS30 ActionCam.\n- Can save frames to .jpg or .tga.\n\n## Installation:\n\nOn Ubuntu:\n```\napt-get install git libgles2-mesa-dev libglfw3-dev libcurl4-openssl-dev libjpeg8-dev\ngit clone https://github.com/gnd/glslr\ncd glslr\nmake\nsudo make install\n```\nOn Mac OSX:\n```\n(get CodeX, homebrew)\nbrew install glfw3 glew libjpeg\ngit clone https://github.com/gnd/glslr\ncd glslr \nmake\nsudo make install\n```\nPlease note that you can edit the src/makefile to enable/disable v4l2 support, simply by changing VIDEO=yes or VIDEO=no before compilation. V4l2 support is disabled when compiing on Mac OSX.\n\n## Usage:\n\nThis will read the fragment shader from shaders/tunnel.glsl and render it in a 800x600 window on the primary monitor. Any changes you make to the file while **glslr** is running, will be automatically recompiled and sent to the GPU on save:\n```\nglslr shaders/tunnel.glsl\n```\n\nThis will read the fragment shader from shaders/template.glsl and render it into a 1024x768 window on the primary monitor:\n```\nglslr --primary-res 1024x768 shaders/template.glsl\n```\n\nThis will read the fragment shader and render it fullscreen on the secondary monitor (if any):\n```\nglslr --secondary-fs shaders/glass_sphere.glsl\n```\n\nFor other options see bellow:\n```\nusage: glslr [options] \u003clayer0.glsl\u003e [layer1.glsl] [layer2.glsl] ...\noptions:\n  window properties:\n    --primary-fs                            create a fullscreen window on primary monitor\n    --primary-res [WidthxHeight]            create a width x height window on primary monitor (default: 800x600)\n    --secondary-fs                          create a fullscreen window on secondary monitor\n    --secondary-res [WidthxHeight]          create a width x height window on secondary monitor\n  offscreen format:\n    --RGB888\n    --RGBA8888 (default)\n    --RGB565\n    --RGBA4444\n  interpolation mode:\n    --nearestneighbor (default)\n    --bilinear\n  wrap mode:\n    --wrap-clamp_to_edge\n    --wrap-repeat (default)\n    --wrap-mirror_repeat\n  backbuffer:\n    --backbuffer                            enable backbuffer (default:OFF)\n  network:\n    --net                                   enable network (default:OFF)\n    --tcp                                   enable TCP (default:UDP)\n    --port [port]                           listen on port (default:6666)\n    --params [n]                            number of net input params (default:0)\n  sony:\n     --sony                                 enable Sony ActionCAM AS30 support\n  video:\n    --vdev [device number]                  v4l2 device number (default: 0 eg. /dev/video0)\n  saving:\n    --save-tga                              use TGA format instead of the default JPEG\n    --save-dir [dir]                        directory where to save frames\n    --save-file [filename]                  filename to save frames in the form: name_%0nd\n                                            %0nd stands for number of digits, eg. my_%06d\n                                            will be saved as my_000001.jpg, my_000002.jpg, etc.. (or .tga)\n```\n## Usage with network:\n```\nglslr --net --port [port] --params N example.glsl\n```\n\nThe parameters must be sent via UDP to the [port] in the form: *\"param0 param1 param2 ... paramN;\"*.  \nA reference is to use PureData's object [netsend]. Currently only integer and float variables are supported.\n\n**glslr** makes the received data available in the shader as uniform float. The data can be accessed if you declare pamaters like this in the shader:\n```\nuniform float m0;\n..\nuniform float mN;\n```\nYou can use the parameters to carry input from a MIDI controller, sound-analysis or anything you like. The maximum count of parameters is 99 for now.\n\n## Usage with video:\n\n**glslr** makes it possible to use experimental live video input from a V4L device. Currently only YUV422 devices are supported. The image is raw YUV422 - conversion into RGBA is up to you in the shader.\n```\nglslr --vdev [video device number] example.glsl\n```\nProvide the video device number to be able to use it in the shader. Default is 0 which expands to /dev/video0.  \nEg. if you want to use /dev/video1 do:\n\n```\nglslr --vdev 1 shaders/test_video.glsl\n````\nIn the shader you can access the video data by using uniform sampler2D variable called video. To start camera press 'v'.\n```\n#version 130\n\nout vec4 PixelColor;\nuniform vec2 resolution;\nuniform sampler2D video;\n\n// press 'v' to start video\n\nvoid main(void) {\n\tvec2 p = vec2( gl_FragCoord.x / resolution.x, 1.0 - gl_FragCoord.y / resolution.y);\n\tPixelColor = texture(video, p);\n}\n```\n\n## Using Sony ActionCam input:\n\n**glslr** makes it possible to use live video input from a Sony AS30 ActionCam. \n```\nglslr --sony shaders/test_sony.glsl\n```\n\nIn the shader you can access the video data by using uniform sampler2D variable called sony:\n```\n#version 130\n\nout vec4 PixelColor;\nuniform vec2 resolution;\nuniform sampler2D sony;\n\nvoid main(void) {\n\tvec2 p = vec2( gl_FragCoord.x / resolution.x, 1.0 - gl_FragCoord.y / resolution.y);\n\tPixelColor = texture(sony, p);\n}\n```\n\n## Using include:\n\n**glslr** provides support to include GLSL files from within the shader. Lines containing the string //#include file will be replaced with the contents of the file:\n\n\nfunction.glsl:\n```\ncolor = vec3(1.,0.,0.);\n```\n\nproject.glsl:\n```\nvoid main(void) {\n\tvec3 color = vec3(0.,1.,0.);\n\n\t//#include function.glsl  \n    // ^^^ this line will be replaced with contents of the function.glsl file\n\n\tgl_FragColor = vec4(color, 1.0);\n}\n```\n## \n\n**glslr** is a fork of pijockey-sound (https://github.com/gnd/pijockey-sound), a GLSL livecoding framework for RaspberryPi, an extension of the original sourcecode of **PiJockey by sharrow**.  \n**glslr** was ported to x86, using GLFW. The Video4Linux capability was scrambled from **glutcam** by George Koharchik.  \n**glslr** is being occasionally developed (when preparing for a new performance) by gnd ♥ gnd.sk.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnd%2Fglslr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnd%2Fglslr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnd%2Fglslr/lists"}