{"id":15039089,"url":"https://github.com/gargaj/bonzomatic","last_synced_at":"2025-05-15T14:06:17.755Z","repository":{"id":26308792,"uuid":"29756774","full_name":"Gargaj/Bonzomatic","owner":"Gargaj","description":"Live shader coding tool and Shader Showdown workhorse","archived":false,"fork":false,"pushed_at":"2025-02-18T15:22:03.000Z","size":17087,"stargazers_count":1414,"open_issues_count":25,"forks_count":114,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-05-15T14:06:08.337Z","etag":null,"topics":["c-plus-plus","demoscene","directx","glsl","graphics","hlsl","live-coding","livecoding","opengl","shader","shadertoy"],"latest_commit_sha":null,"homepage":"http://www.pouet.net/topic.php?which=9881","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gargaj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-01-23T22:44:03.000Z","updated_at":"2025-05-14T01:43:51.000Z","dependencies_parsed_at":"2022-07-15T21:17:20.518Z","dependency_job_id":"fbf4d0bb-077c-4abd-90ba-b44d8c9d5ed1","html_url":"https://github.com/Gargaj/Bonzomatic","commit_stats":{"total_commits":374,"total_committers":41,"mean_commits":9.121951219512194,"dds":"0.30213903743315507","last_synced_commit":"46bc4e730609a69e0af6eadc6b92c125b5f4904a"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gargaj%2FBonzomatic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gargaj%2FBonzomatic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gargaj%2FBonzomatic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gargaj%2FBonzomatic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gargaj","download_url":"https://codeload.github.com/Gargaj/Bonzomatic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355335,"owners_count":22057354,"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":["c-plus-plus","demoscene","directx","glsl","graphics","hlsl","live-coding","livecoding","opengl","shader","shadertoy"],"created_at":"2024-09-24T20:41:32.176Z","updated_at":"2025-05-15T14:06:12.744Z","avatar_url":"https://github.com/Gargaj.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bonzomatic\r\n\r\n[![Github workflow status](https://github.com/Gargaj/Bonzomatic/actions/workflows/main.yml/badge.svg)](https://github.com/Gargaj/Bonzomatic/actions/workflows/main.yml)\r\n[![Appveyor build status](https://ci.appveyor.com/api/projects/status/ix6fwi6nym1tu4e7?svg=true)](https://ci.appveyor.com/project/Gargaj/bonzomatic)\r\n\r\n## What's this?\r\nThis is a live-coding tool, where you can write a 2D fragment/pixel shader while it is running in the background.\r\n\r\n![Screenshot](https://i.imgur.com/8K8IztLl.jpg)\r\n\r\nThe tool was originally conceived and implemented after the Revision 2014 demoscene party's live coding competition where two contestants improv-code an effect in 25 minutes head-to-head. Wanna see how it looks in action? Check https://www.youtube.com/watch?v=KG_2q4OEhKc\r\n\r\n## Where to get? / Binary builds\r\nFresh builds of Bonzomatic will always be available at https://github.com/Gargaj/Bonzomatic/releases\r\n\r\n## Keys\r\n- F2: toggle texture preview\r\n- F5 or Ctrl-R: recompile shader\r\n- Ctrl-[/]: adjust text background transparency\r\n- F11 or Ctrl/Cmd-f: hide shader overlay\r\n- Alt-F4 or Shift+Escape: exbobolate your planet\r\n\r\n## Requirements\r\nOn Windows, both DirectX 9 and 11 are supported.\r\n\r\nFor the OpenGL version (for any platform), at least OpenGL 4.1 is required.\r\n\r\nOn recent macOS, to allow sound input to be captured (for FFT textures to be generated), you need to: Open up System Preferences, click on Security \u0026 Privacy, click on the Privacy tab then click on the Microphone menu item. Make sure Bonzomatic.app is in the list and ticked.\r\n\r\n## Configuration\r\nYou can configure Bonzomatic by creating a `config.json` and placing it next to the binary executable you're planning to run in the working directory for the binary; Bonzomatic will helpfully print this directory out for you when you run it, and you can also pass a file (with absolute or relative path, whichever you want) as parameter to the executable to load any other file as `config.json`. This allows you to have multiple configurations for multiple situations.\r\n\r\nThe file can have the following contents: (all fields are optional)\r\n``` javascript\r\n{\r\n  \"skipSetupDialog\": true, // If true, setup dialog will be suppressed - all values you provide below will be used without validation (at your own risk!)\r\n  \"window\":{ // default window size / state; if there's a setup dialog, it will override it\r\n    \"width\":1920,\r\n    \"height\":1080,\r\n    \"fullscreen\":true,\r\n  },\r\n  \"audio\":{ // default audio device settings; if there's a setup dialog, it will override it\r\n    \"useInput\":false, // if true, use line-in/mic/...; if false, attempt to create a loopback device and use stereo out\r\n  },\r\n  \"font\":{ // all paths in the file are also relative to the binary, but again, can be absolute paths if that's more convenient\r\n    \"file\":\"Input-Regular_(InputMono-Medium).ttf\",\r\n    \"size\":16,\r\n  },\r\n  \"rendering\":{\r\n    \"fftSmoothFactor\": 0.9, // 0.0 means there's no smoothing at all, 1.0 means the FFT is completely smoothed flat\r\n    \"fftAmplification\": 1.0, // 1.0 means no change, larger values will result in brighter/stronger bands, smaller values in darker/weaker ones\r\n  },\r\n  \"textures\":{ // the keys below will become the shader variable names\r\n    \"texChecker\":\"textures/checker.png\",\r\n    \"texNoise\":\"textures/noise.png\",\r\n    \"texTex1\":\"textures/tex1.jpg\",\r\n  },\r\n  \"gui\":{\r\n    \"outputHeight\": 200,\r\n    \"opacity\": 192, // 255 means the editor occludes the effect completely, 0 means the editor is fully transparent\r\n    \"texturePreviewWidth\": 64,\r\n    \"spacesForTabs\": false,\r\n    \"tabSize\": 8,\r\n    \"visibleWhitespace\": true,\r\n    \"autoIndent\": \"smart\", // can be \"none\", \"preserve\" or \"smart\"\r\n    \"scrollXFactor\": 1.0, // if horizontal scrolling is too slow you can speed it up here (or change direction)\r\n    \"scrollYFactor\": 1.0, // if vertical scrolling is too slow you can speed it up here (or change direction)\r\n  },\r\n  \"midi\":{ // the keys below will become the shader variable names, the values are the CC numbers\r\n    \"fMidiKnob\": 16, // e.g. this would be CC#16, i.e. by default the leftmost knob on a nanoKONTROL 2\r\n  },\r\n  // this section is if you want to enable NDI streaming; otherwise just ignore it\r\n  \"ndi\":{\r\n    \"enabled\": true,\r\n    \"connectionString\": \"\u003cndi_product something=\\\"123\\\"/\u003e\", // metadata sent to the receiver; completely optional\r\n    \"identifier\": \"hello!\", // device identifier; must be unique, also helps source discovery/identification in the receiver if there are multiple sources on the network\r\n    \"frameRate\": 60.0, // frames per second\r\n    \"progressive\": true, // progressive or interleaved?\r\n  },\r\n  // this section is if you want to customise colors to your liking\r\n  \"theme\":{\r\n    \"text\": \"FFFFFF\", // color format is \"RRGGBB\" or \"AARRGGBB\" in hexadecimal\r\n    \"comment\": \"00FF00\",\r\n    \"number\": \"FF8000\",\r\n    \"op\": \"FFCC00\",\r\n    \"keyword\": \"FF6600\",\r\n    \"type\": \"00FFFF\",\r\n    \"builtin\": \"44FF88\",\r\n    \"preprocessor\": \"C0C0C0\",\r\n    \"selection\": \"C06699CC\", // background color when selecting text\r\n    \"charBackground\": \"C0000000\", // if set, this value will be used (instead of gui opacity) behind characters\r\n  },\r\n  \"postExitCmd\":\"copy_to_dropbox.bat\" // this command gets ran when you quit Bonzomatic, and the shader filename gets passed to it as first parameter. Use this to take regular backups.\r\n}\r\n```\r\n### Automatic shader backup\r\nIf you want the shader to be backed up once you quit Bonzomatic, you can use the above `postExitCmd` parameter in the config, and use a batch file like this:\r\n```\r\n@echo off\r\nREM ### cf. https://stackoverflow.com/a/23476347\r\nfor /f \"tokens=2 delims==\" %%a in ('wmic OS Get localdatetime /value') do set \"dt=%%a\"\r\nset \"YY=%dt:~2,2%\" \u0026 set \"YYYY=%dt:~0,4%\" \u0026 set \"MM=%dt:~4,2%\" \u0026 set \"DD=%dt:~6,2%\"\r\nset \"HH=%dt:~8,2%\" \u0026 set \"Min=%dt:~10,2%\" \u0026 set \"Sec=%dt:~12,2%\"\r\ncopy %1 X:\\MyShaderBackups\\%YYYY%%MM%%DD%-%HH%%Min%%Sec%.glsl\r\n```\r\nThis will copy the shader timestamped into a specified folder.\r\n\r\nA similar script for Linux and OSX would be:\r\n```\r\ncp \"$1\" \"~/MyShaderBackups/shader-$(date +%s).glsl\"\r\n```\r\n\r\nTo have this script run on exit, make sure your `postExitCmd` has a `./` before the script name.\r\n\r\n\r\n## Building\r\nAs you can see you're gonna need [CMAKE](https://cmake.org/) for this, but don't worry, a lot of it is automated at this point.\r\n\r\n### Windows\r\nUse at least [Visual C++ 2010](https://support.microsoft.com/ru-ru/help/2977003/the-latest-supported-visual-c-downloads). For the DX9/DX11 builds, obviously you'll be needing a [DirectX SDK](https://www.microsoft.com/en-us/download/details.aspx?id=6812), though a lot of it is already in the Windows 8.1 SDK as well.\r\n\r\n### OSX/macOS\r\n```cmake``` should take care of everything:\r\n```\r\nmkdir build \u0026\u0026 cd build\r\ncmake -DCMAKE_BUILD_TYPE=Release ../\r\ncmake --build .\r\n```\r\nThe Bonzomatic.app bundle, resulting from the compilation, should be found in `./build/Bonzomatic.app`. You can place it anywhere.\r\nWe do NOT recommend putting it in /Applications. Bonzomatic is looking for config.json files and resources living at the same level of the app.\r\n\r\n### Linux\r\nYou'll need ```xorg-dev```, `libasound2-dev` and ```libglu1-mesa-dev```; after that ```cmake``` should take care of the rest:\r\n```\r\napt install xorg-dev libglu1-mesa-dev libasound2-dev cmake\r\ncd Bonzomatic\r\ncmake .\r\nmake\r\nmake install\r\n```\r\n\r\n### OpenBSD\r\n[Xenocara](https://xenocara.org) contains all required components.  Hack away with\r\n```\r\ncmake .\r\nmake\r\n```\r\nor use the port\r\n```\r\ncd /usr/ports/graphics/bonzomatic\r\nmake install\r\n```\r\n\r\n\r\n## Organizing a competition\r\nIf you want to organize a competition using Bonzomatic at your party, here's a handy-dandy guide on how to get started:\r\nhttps://github.com/Gargaj/Bonzomatic/wiki/How-to-set-up-a-Live-Coding-compo\r\n\r\n## Credits and acknowledgements\r\n### Original / parent project authors\r\n- \"ScintillaGL\" project by Mykhailo Parfeniuk (https://github.com/sopyer/ScintillaGL)\r\n- Riverwash LiveCoding Tool by Michał Staniszewski and Michal Szymczyk (http://www.plastic-demo.org)\r\n\r\n### Libraries and other included software\r\n- Scintilla editing component by the Scintilla Dev Team (https://www.scintilla.org)\r\n- OpenGL Extension Wrangler Library by Nigel Stewart (http://glew.sourceforge.net)\r\n- mini_al by David Reid (https://github.com/dr-soft/mini_al)\r\n- KISSFFT by Mark Borgerding (https://github.com/mborgerding/kissfft)\r\n- STB Image and Truetype libraries by Sean Barrett (https://nothings.org)\r\n- GLFW by whoever made GLFW (https://www.glfw.org/faq.html)\r\n- JSON++ by Hong Jiang (https://github.com/hjiang/jsonxx)\r\n- NDI(tm) SDK by NewTek(tm) (https://www.newtek.com/ndi.html)\r\n- D3DX9 by Microsoft (https://learn.microsoft.com/en-us/windows/win32/direct3d9/d3dx)\r\n\r\nThese software are available under their respective licenses.\r\n\r\nThe remainder of this project code was (mostly, I guess) written by Gargaj / Conspiracy and is public domain.\r\nOSX / macOS maintenance and ports by Alkama / Tpolm + Calodox; Linux maintenance by PoroCYon / K2.\r\n\r\n## Contact / discussion forum\r\nIf you have anything to say, do it at https://www.pouet.net/topic.php?which=9881\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgargaj%2Fbonzomatic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgargaj%2Fbonzomatic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgargaj%2Fbonzomatic/lists"}