This is 1k js framework supporting one fragment shader and byte beat/float beat. Included is tähtituho's lovebyte 2023 entry sikistys
- install node (tested on v18.13.0, but pretty sure that newer versions work)
run npm install -g http-server
npm install node-zopfli
npm install terser
Custom build of Leviathan 2.0 is included for your convenience. Leviathan is great test shaders, because it is really simple and aims to be productive. Custom build differs from orignal in following ways:
- You don't need to divide t variable at all. It is compatible with time variable from js.
- It does not support post processing
Use you favorite editor to write shader. Visual Studio Code with GLSL lint is recommended.
- Edit shader.frag
- Run
tools/leviatha-custom-build.exe
- Leviathan will reload shader when you save shader in your editor
GLSL Sandbox and Shadertoy are also great for wrinting shaders.
Find onclick-function in main.js and there you will se comment saying "write tune here". Paste your byte beat or float beat into that. NOTICE your tune might need some tweaking if you wrote in it https://greggman.com/downloads/examples/html5bytebeat/html5bytebeat.html. Tweaking should be done on a.createBuffer(1, q = 8000 * 45, 8000);
When you feel like shader is ready to be executed in browser, do following steps:
- Run
.\startBrowser.ps1
- This should open new browser tab to address http://localhost:8080/index.html
- Click somewhere in upper left segment of browser to start
When you feel that shader and byte beat are good as they get, you should do release.
- Run
.\makeRelease.ps1
(you can number of compeko passes as argument like.\makeRelease.ps1 100
(100 is default) try 300, might save you 1 byte). - Run
http-server
and try results at http://localhost:8080/release/index.html - Click somewhere on browser to start demo (location might be different than in testing stage). It might take couple of tries to find correct place to click.
- Submit entry to you favorite party with instruction how to run and start demo.
As compeko is using compression algorithm, results can vary greatly depending on your tune and shader code. It is encouraged to experiment with included boilerplate code.
Leviathan 2.0 For awesome shader runtime
Shader_Minifier For minifying shader
Terser For minifying js
compeko For PNG compression
Current size for this is 1012k.