Unverified Commit 0086a38f authored by Gargaj's avatar Gargaj Committed by GitHub
Browse files

Update README.md

parent 68be0132
# Bonzomatic # Bonzomatic
[![Build status](https://ci.appveyor.com/api/projects/status/ix6fwi6nym1tu4e7?svg=true)](https://ci.appveyor.com/project/Gargaj/bonzomatic) [![Build status](https://ci.appveyor.com/api/projects/status/ix6fwi6nym1tu4e7?svg=true)](https://ci.appveyor.com/project/Gargaj/bonzomatic)
[![Build Status](https://travis-ci.org/Gargaj/Bonzomatic.svg)](https://travis-ci.org/Gargaj/Bonzomatic) [![Build Status](https://travis-ci.org/Gargaj/Bonzomatic.svg)](https://travis-ci.org/Gargaj/Bonzomatic)
## What's this? ## What's this?
This is a live-coding tool, where you can write a 2D fragment/pixel shader while it is running in the background. This is a live-coding tool, where you can write a 2D fragment/pixel shader while it is running in the background.
![Screenshot](http://i.imgur.com/8K8IztLl.jpg) ![Screenshot](http://i.imgur.com/8K8IztLl.jpg)
The 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 The 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
## Keys ## Keys
- F2: toggle texture preview - F2: toggle texture preview
- F5 or Ctrl-R: recompile shader - F5 or Ctrl-R: recompile shader
- F11 or Ctrl/Cmd-f: hide shader overlay - F11 or Ctrl/Cmd-f: hide shader overlay
- Alt-F4 or Shift+Escape: exbobolate your planet - Alt-F4 or Shift+Escape: exbobolate your planet
## Requirements ## Requirements
On Windows, both DirectX 9 and 11 are supported. On Windows, both DirectX 9 and 11 are supported.
For the OpenGL version (for any platform), at least OpenGL 4.1 is required. For the OpenGL version (for any platform), at least OpenGL 4.1 is required.
On 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 & Privacy, click on the Privacy tab then click on the Microphone menu item. Make sure Bonzomatic.app is in the list and ticked. On 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 & Privacy, click on the Privacy tab then click on the Microphone menu item. Make sure Bonzomatic.app is in the list and ticked.
## Configuration ## Configuration
Create a `config.json` with e.g. the following contents: (all fields are optional) Create a `config.json` with e.g. the following contents: (all fields are optional)
``` javascript ``` javascript
{ {
"window":{ // default window size / state, if there's a setup dialog, it will override it "window":{ // default window size / state, if there's a setup dialog, it will override it
"width":1920, "width":1920,
"height":1080, "height":1080,
"fullscreen":true, "fullscreen":true,
}, },
"font":{ "font":{
"file":"Input-Regular_(InputMono-Medium).ttf", "file":"Input-Regular_(InputMono-Medium).ttf",
"size":16, "size":16,
}, },
"rendering":{ "rendering":{
"fftSmoothFactor": 0.9, // 0.0 means there's no smoothing at all, 1.0 means the FFT is completely smoothed flat "fftSmoothFactor": 0.9, // 0.0 means there's no smoothing at all, 1.0 means the FFT is completely smoothed flat
"fftAmplification": 1.0, // 1.0 means no change, larger values will result in brighter/stronger bands, smaller values in darker/weaker ones "fftAmplification": 1.0, // 1.0 means no change, larger values will result in brighter/stronger bands, smaller values in darker/weaker ones
}, },
"textures":{ // the keys below will become the shader variable names "textures":{ // the keys below will become the shader variable names
"texChecker":"textures/checker.png", "texChecker":"textures/checker.png",
"texNoise":"textures/noise.png", "texNoise":"textures/noise.png",
"texTex1":"textures/tex1.jpg", "texTex1":"textures/tex1.jpg",
}, },
"gui":{ "gui":{
"outputHeight": 200, "outputHeight": 200,
"opacity": 192, // 255 means the editor occludes the effect completely, 0 means the editor is fully transparent "opacity": 192, // 255 means the editor occludes the effect completely, 0 means the editor is fully transparent
"texturePreviewWidth": 64, "texturePreviewWidth": 64,
"spacesForTabs": false, "spacesForTabs": false,
"tabSize": 8, "tabSize": 8,
"visibleWhitespace": true, "visibleWhitespace": true,
"autoIndent": "smart", // can be "none", "preserve" or "smart" "autoIndent": "smart", // can be "none", "preserve" or "smart"
}, },
"midi":{ // the keys below will become the shader variable names, the values are the CC numbers "midi":{ // the keys below will become the shader variable names, the values are the CC numbers
"fMidiKnob": 16, // e.g. this would be CC#16, i.e. by default the leftmost knob on a nanoKONTROL 2 "fMidiKnob": 16, // e.g. this would be CC#16, i.e. by default the leftmost knob on a nanoKONTROL 2
}, },
// this section is if you want to enable NDI streaming; otherwise just ignore it // this section is if you want to enable NDI streaming; otherwise just ignore it
"ndi":{ "ndi":{
"enabled": true, "enabled": true,
"connectionString": "<ndi_product something=\"123\"/>", // metadata sent to the receiver; completely optional "connectionString": "<ndi_product something=\"123\"/>", // metadata sent to the receiver; completely optional
"identifier": "hello!", // additional string to the device name; helps source discovery/identification in the receiver if there are multiple sources on the network "identifier": "hello!", // additional string to the device name; helps source discovery/identification in the receiver if there are multiple sources on the network
"frameRate": 60.0, // frames per second "frameRate": 60.0, // frames per second
"progressive": true, // progressive or interleaved? "progressive": true, // progressive or interleaved?
}, },
"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. "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.
} }
``` ```
### Automatic shader backup
## Building If 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:
As 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. ```
@echo off
### Windows REM ### cf. https://stackoverflow.com/a/23476347
Use at least Visual C++ 2010. For the DX9/DX11 builds, obviously you'll be needing a DirectX SDK, though a lot of it is already in the Windows 8.1 SDK as well. for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
### OSX/macOS set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
```cmake``` should take care of everything: copy shader.glsl X:\MyShaderBackups\%YYYY%%MM%%DD%-%HH%%Min%%Sec%.glsl
``` ```
cmake . This will copy the shader timestamped into a specified folder.
make
make install ## Building
``` As 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.
### Linux ### Windows
You'll need ```xorg-dev``` and ```libglu1-mesa-dev```; after that ```cmake``` should take care of the rest: Use at least Visual C++ 2010. For the DX9/DX11 builds, obviously you'll be needing a DirectX SDK, though a lot of it is already in the Windows 8.1 SDK as well.
```
apt install xorg-dev libglu1-mesa-dev cmake ### OSX/macOS
cd Bonzomatic ```cmake``` should take care of everything:
cmake . ```
make cmake .
make install make
``` make install
```
### Linux
You'll need ```xorg-dev``` and ```libglu1-mesa-dev```; after that ```cmake``` should take care of the rest:
```
apt install xorg-dev libglu1-mesa-dev cmake
cd Bonzomatic
cmake .
make
make install
```
### OpenBSD ### OpenBSD
[Xenocara](https://xenocara.org) contains all required components. Hack away with [Xenocara](https://xenocara.org) contains all required components. Hack away with
``` ```
...@@ -106,28 +117,28 @@ make install ...@@ -106,28 +117,28 @@ make install
``` ```
## Organizing a competition ## Organizing a competition
If you want to organize a competition using Bonzomatic at your party, here's a handy-dandy guide on how to get started: If you want to organize a competition using Bonzomatic at your party, here's a handy-dandy guide on how to get started:
https://github.com/Gargaj/Bonzomatic/wiki/How-to-set-up-a-Live-Coding-compo https://github.com/Gargaj/Bonzomatic/wiki/How-to-set-up-a-Live-Coding-compo
## Credits and acknowledgements ## Credits and acknowledgements
### Original / parent project authors ### Original / parent project authors
- "ScintillaGL" project by Mykhailo Parfeniuk (https://github.com/sopyer/ScintillaGL) - "ScintillaGL" project by Mykhailo Parfeniuk (https://github.com/sopyer/ScintillaGL)
- Riverwash LiveCoding Tool by Michał Staniszewski and Michal Szymczyk (http://www.plastic-demo.org/) - Riverwash LiveCoding Tool by Michał Staniszewski and Michal Szymczyk (http://www.plastic-demo.org/)
### Libraries and other included software ### Libraries and other included software
- Scintilla editing component by the Scintilla Dev Team (http://www.scintilla.org/) - Scintilla editing component by the Scintilla Dev Team (http://www.scintilla.org/)
- OpenGL Extension Wrangler Library by Nigel Stewart (http://glew.sourceforge.net/) - OpenGL Extension Wrangler Library by Nigel Stewart (http://glew.sourceforge.net/)
- mini_al by David Reid (https://github.com/dr-soft/mini_al) - mini_al by David Reid (https://github.com/dr-soft/mini_al)
- KISSFFT by Mark Borgerding (https://github.com/mborgerding/kissfft/) - KISSFFT by Mark Borgerding (https://github.com/mborgerding/kissfft/)
- STB Image and Truetype libraries by Sean Barrett (http://nothings.org/) - STB Image and Truetype libraries by Sean Barrett (http://nothings.org/)
- GLFW by whoever made GLFW (http://www.glfw.org/faq.html) - GLFW by whoever made GLFW (http://www.glfw.org/faq.html)
- JSON++ by Hong Jiang (https://github.com/hjiang/jsonxx) - JSON++ by Hong Jiang (https://github.com/hjiang/jsonxx)
- NDI(tm) SDK by NewTek(tm) (http://www.newtek.com/ndi.html) - NDI(tm) SDK by NewTek(tm) (http://www.newtek.com/ndi.html)
These software are available under their respective licenses. These software are available under their respective licenses.
The remainder of this project code was (mostly, I guess) written by Gargaj / Conspiracy and is public domain.OSX / macOS maintenance and ports by Alkama / Tpolm + Calodox; Linux maintenance by PoroCYon / K2. The remainder of this project code was (mostly, I guess) written by Gargaj / Conspiracy and is public domain.OSX / macOS maintenance and ports by Alkama / Tpolm + Calodox; Linux maintenance by PoroCYon / K2.
## Contact / discussion forum ## Contact / discussion forum
If you have anything to say, do it at http://www.pouet.net/topic.php?which=9881 or [![Join the chat at https://gitter.im/Gargaj/Bonzomatic](https://badges.gitter.im/Gargaj/Bonzomatic.svg)](https://gitter.im/Gargaj/Bonzomatic?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) If you have anything to say, do it at http://www.pouet.net/topic.php?which=9881 or [![Join the chat at https://gitter.im/Gargaj/Bonzomatic](https://badges.gitter.im/Gargaj/Bonzomatic.svg)](https://gitter.im/Gargaj/Bonzomatic?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment