This repo is an attempt to create most efficient raytracer with most features and source size under 1024 bytes but without WebGL and any external resources. It was made specially for js1k contest.
- Language: javascript (es6)
- Compressed source size: 1024 bytes
- No any external data, no any external libraries
- No WebGL, only software rendering
- multiple spheres with own positions, color and sizes
- spheres final color are combined from diffuse, reflection and specular colors
- textured floor - tiled carpet (procedure generated)
- floor has glossy reflections of the world
- sky is textured with gradient and 'stars'
- soft shadows on floor and spheres
- depth of field is also present
It works with shim from js1k, incudes presetted canvas, so my raytracer for contest is not self-contained html page. It contains only js code, without any html. Size of self-contained html with all presetted data is 1121 bytes. This repo contains pure js and self-contained versions, both full size and minimized.
At this moment (January 2017) it works much faster in firefox, than on chrome.
For this contest I've used RegPack (It also available online), it's the best choice for js1k since it's self-extractzble and easy to use, but because of it's limitations RegPack is unacceptable for large files.