thebookofshaders/appendix/01/README.md

19 lines
1.8 KiB
Markdown
Raw Normal View History

2016-10-27 19:10:27 +00:00
## How to run the examples on a Raspberry Pi?
2016-05-09 10:28:02 +00:00
2017-08-19 10:11:58 +00:00
A few years ago, assuming that everybody has a computer with a graphical processing unit was a long shot. Now, most computers have a GPU, but it's still a high bar for a requirement in a workshop or class, for example.
2016-05-09 10:28:02 +00:00
2016-10-27 19:35:12 +00:00
Thanks to the [Raspberry Pi Foundation](http://www.raspberrypi.org/) a new type of small and cheap generation of computers (around $35 each) has found its way into classrooms. More importantly for the purposes of this book, the [Raspberry Pi](http://www.raspberrypi.org/) comes with a decent Broadcom GPU that can be accessed directly from the console. I made a [flexible GLSL live coding tool call **glslViewer**](https://github.com/patriciogonzalezvivo/glslViewer) that runs all the examples in this book. This program also has the ability to update automatically when the user saves a change to their code. What does this mean? You can edit the shader and every time you save it, the shader will be re-compile and render for you.
2016-05-09 10:28:02 +00:00
By making a local copy of the repository of this book (see the above section) and having [`glslViewer` installed](https://github.com/patriciogonzalezvivo/glslViewer), users can run the examples with `glslviewer`. Also by using the `-l` flag they can render the example in a corner of the screen while they modify it with any text editor (like `nano`, `pico`, `vi`, `vim` or `emacs`). This also works if the user is connected through ssh/sftp.
2016-05-09 10:28:02 +00:00
To install and set this all up on the Raspberry Pi after installing [Raspbian](https://www.raspberrypi.org/downloads/raspbian/), a Debian-based Linux distribution made for Raspberry Pi, and logging in, type the following commands:
2016-05-09 10:28:02 +00:00
```bash
sudo apt-get update
sudo apt-get upgrade
2016-12-13 21:20:19 +00:00
sudo apt-get install git-core glslviewer
2016-05-09 10:28:02 +00:00
cd ~
git clone https://github.com/patriciogonzalezvivo/thebookofshaders.git
cd thebookofshaders
```