android-shaders/README.md

26 lines
1.4 KiB
Markdown
Raw Normal View History

2024-05-28 19:12:14 +02:00
# android-shaders
2024-05-28 19:27:15 +02:00
GLSL shaders made in/for the [Shader Editor app](https://f-droid.org/en/packages/de.markusfisch.android.shadereditor/) on F-Droid ([source](https://github.com/markusfisch/ShaderEditor)).
2024-05-28 19:12:14 +02:00
2024-05-28 19:27:15 +02:00
### binary_clock.glsl
2024-05-28 19:29:46 +02:00
Displays hours, minutes and seconds in binary as rows of filled circles. The example below is showing the time `19:15:57`
2024-05-28 19:27:15 +02:00
![](demo/binary_clock.png)
2024-05-28 21:06:48 +02:00
### binary_clock_square.glsl
Divides the day into 65536 beats, roughly 1.3 seconds each, and displays the time in a 4x4 grid as binary. The least significant bit is to the bottom right, increasing left first then up.
The example below is showing the time `1101 1110 0011 1001` or `DE39`in hexadecimal (one digit per row of dots), which is equivalent to about `20:50:00`.
![](demo/binary_clock_square.png)
Formula for converting a time to beats: `(hours * 3600 + minutes * 60 + seconds) / 86400 * 65536`
And to convert back to hours, minutes and seconds:
- `seconds = int((beats * 86400 / 65536) % 60)`
- `minutes = int((beats * 86400 / 65536) / 60 % 60)`
- `hours = int((beats * 86400 / 65536) / 3600)`
### interactive_game_of_life.glsl
2024-05-28 19:27:15 +02:00
A rainbow-coloured simulation of [Conway's Game of Life](https://conwaylife.com/wiki/Conway%27s_Game_of_Life). The edges of the screen are randomised so that the pattern never stabilises. Pressing on the screen will turn on cells in a small radius.
![](demo/game_of_life.png)