The Hub is a place where trains meet and cross each other, day and night, non-stop.
This demo features five tracks. The lower the track is, the faster the trains go.
The colors change over time, switching from daylight with bright tones to a night style with darker tones.
Technically, this demo features of raymarched scene, with a cell shading effect and camera rotation.
Be aware that it requires a rather good graphics card. Plus, it seems to be running better on Firefox (tested on my Linux).
Check this other version of demo (resolution divided by 2, runs more smoothly) if you have problems running the original:
http://www.jtp.io/js1k-2015/
A big thanks to the following tools and resources that helped me a lot for the compression:
- Shader minifier: http://www.pouet.net/prod.php?which=55176
- JS Crush: http://www.iteral.com/jscrush/
- JS1K Boilerplate: https://gist.github.com/gre/9364718
- THE gold mine: http://www.iquilezles.org/
The original source code before compression is not that nice to read as it contains a lot of duplicated code to make the compression tool work better.
Just for the information, the original source with the duplicated code and the manual optimizations is 2248 Bytes big, just before piping it to the minifier and jscrush.
EDIT: I wrote a postmortem on my blog, take a look at it if you want more details!
http://www.jtp.io/2015/03/24/js1k-2015-postmortem.html
Enjoy.