README.md 5.44 KB
Newer Older
Gargaj's avatar
Gargaj committed
1
2
# Bonzomatic

Gargaj's avatar
Gargaj committed
3
[![Build status](https://ci.appveyor.com/api/projects/status/ix6fwi6nym1tu4e7?svg=true)](https://ci.appveyor.com/project/Gargaj/bonzomatic)
Gargaj's avatar
Gargaj committed
4
[![Build Status](https://travis-ci.org/Gargaj/Bonzomatic.svg)](https://travis-ci.org/Gargaj/Bonzomatic)
Gargaj's avatar
Gargaj committed
5

Gargaj's avatar
Gargaj committed
6
7
8
## 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.

Gargaj's avatar
Gargaj committed
9
![Screenshot](http://i.imgur.com/8K8IztLl.jpg)
Gargaj's avatar
Gargaj committed
10

Gargaj's avatar
Gargaj committed
11
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
Gargaj's avatar
Gargaj committed
12
13

## Keys
Gargaj's avatar
Gargaj committed
14
- F2: toggle texture preview
Gargaj's avatar
Gargaj committed
15
- F5 or Ctrl-R: recompile shader
16
- F11 or Ctrl/Cmd-f: hide shader overlay
17
- Alt-F4 or Shift+Escape: exbobolate your planet
Gargaj's avatar
Gargaj committed
18

19
20
21
22
23
## Requirements
On Windows, both DirectX 9 and 11 are supported.

For the OpenGL version (for any platform), at least OpenGL 4.1 is required.

24
25
On MacBooks with a TouchBar that are running macOS Mojave: Open up System Preferences, click on Security & Privacy, click on the privacy tab then click on the Accessibility menu item. Make sure Bonzomatic.app is ticked, otherwise only the "Quit" TouchBar button will work.

Gargaj's avatar
Gargaj committed
26
## Configuration
27
Create a `config.json` with e.g. the following contents: (all fields are optional)
Gargaj's avatar
Gargaj committed
28
29
``` javascript
{
30
  "window":{ // default window size / state, if there's a setup dialog, it will override it
31
32
33
34
    "width":1920,
    "height":1080,
    "fullscreen":true,
  },
Gargaj's avatar
Gargaj committed
35
36
37
38
  "font":{
    "file":"Input-Regular_(InputMono-Medium).ttf",
    "size":16,
  },
Gargaj's avatar
Gargaj committed
39
40
  "rendering":{
    "fftSmoothFactor": 0.9, // 0.0 means there's no smoothing at all, 1.0 means the FFT is completely smoothed flat
41
    "fftAmplification": 1.0, // 1.0 means no change, larger values will result in brighter/stronger bands, smaller values in darker/weaker ones
Gargaj's avatar
Gargaj committed
42
  },
43
  "textures":{ // the keys below will become the shader variable names
Gargaj's avatar
Gargaj committed
44
45
46
    "texChecker":"textures/checker.png",
    "texNoise":"textures/noise.png",
    "texTex1":"textures/tex1.jpg",
Gargaj's avatar
opos    
Gargaj committed
47
  },
Gargaj's avatar
Gargaj committed
48
49
  "gui":{
    "outputHeight": 200,
Gargaj's avatar
Gargaj committed
50
    "opacity": 192, // 255 means the editor occludes the effect completely, 0 means the editor is fully transparent
Gargaj's avatar
option    
Gargaj committed
51
    "texturePreviewWidth": 64,
52
53
54
    "spacesForTabs": false,
    "tabSize": 8,
    "visibleWhitespace": true,
Gargaj's avatar
Gargaj committed
55
  },
56
57
  "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
Gargaj's avatar
Gargaj committed
58
  },
59
  // this section is if you want to enable NDI streaming; otherwise just ignore it
Gargaj's avatar
Gargaj committed
60
61
  "ndi":{
    "enabled": true,
62
63
64
65
    "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
    "frameRate": 60.0, // frames per second
    "progressive": true, // progressive or interleaved?
66
  },
67
  "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.
Gargaj's avatar
Gargaj committed
68
69
70
}
```

Gargaj's avatar
Gargaj committed
71
## Building
Gargaj's avatar
Gargaj committed
72
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.
73
74
75
76
77

### Windows
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.

### OSX/macOS
Gargaj's avatar
Gargaj committed
78
79
80
81
82
83
```cmake``` should take care of everything:
```
cmake .
make
make install
```
84
85

### Linux
Gargaj's avatar
Gargaj committed
86
You'll need ```xorg-dev``` and ```libglu1-mesa-dev```; after that ```cmake``` should take care of the rest:
87
88
89
90
91
92
93
```
apt install xorg-dev libglu1-mesa-dev cmake
cd Bonzomatic
cmake .
make
make install
```
Gargaj's avatar
Gargaj committed
94

Gargaj's avatar
Gargaj committed
95
96
97
98
## 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:
https://github.com/Gargaj/Bonzomatic/wiki/How-to-set-up-a-Live-Coding-compo

Gargaj's avatar
Gargaj committed
99
100
101
## Credits and acknowledgements
### Original / parent project authors
- "ScintillaGL" project by Mykhailo Parfeniuk (https://github.com/sopyer/ScintillaGL)
Gargaj's avatar
Gargaj committed
102
- Riverwash LiveCoding Tool by Michał Staniszewski and Michal Szymczyk (http://www.plastic-demo.org/)
Gargaj's avatar
Gargaj committed
103
104
105

### Libraries and other included software
- Scintilla editing component by the Scintilla Dev Team (http://www.scintilla.org/)
Gargaj's avatar
Gargaj committed
106
- OpenGL Extension Wrangler Library by Nigel Stewart (http://glew.sourceforge.net/)
107
108
- mini_al by David Reid (https://github.com/dr-soft/mini_al)
- KISSFFT by Mark Borgerding (https://github.com/mborgerding/kissfft/)
Gargaj's avatar
Gargaj committed
109
- STB Image and Truetype libraries by Sean Barrett (http://nothings.org/)
Gargaj's avatar
Gargaj committed
110
- GLFW by whoever made GLFW (http://www.glfw.org/faq.html)
Gargaj's avatar
Gargaj committed
111
- JSON++ by Hong Jiang (https://github.com/hjiang/jsonxx)
112
113
- NDI(tm) SDK by NewTek(tm) (http://www.newtek.com/ndi.html)

Gargaj's avatar
Gargaj committed
114
These software are available under their respective licenses.
Gargaj's avatar
Gargaj committed
115

Gargaj's avatar
Gargaj committed
116
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 / Calodox; Linux maintenance by PoroCYon / K2.
Gargaj's avatar
Gargaj committed
117
118

## Contact / discussion forum
Gargaj's avatar
Gargaj committed
119
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)