Deciphering the postcard-sized raytracer
fabiensanglard.net
fabiensanglard.net
Here's the gist of my modified code (clang-formatted with comments): https://gist.github.com/Flafla2/d2f44c9e5e5a0ff13e6071fb782d...
And here's what it renders: https://i.imgur.com/Yhqt0Le.png
I didn't end up moving forward with my offer at Pixar, but I had a ton of fun with this! Super awesome idea, Pixar sure knows how to get computer graphics programmers thinking.
If anyone is interested in diving deeper into distance field ray marching and using it in a production game engine, check out my article on the topic here: http://flafla2.github.io/2016/10/01/raymarching.html
Inigo Quilez has in-depth explanations and plenty of examples for these: https://iquilezles.org/www/articles/distfunctions/distfuncti...
I believe this technique was first popularised in the demoscene, because it makes for some extremely concise procedural descriptions of 3D scenes:
https://iquilezles.org/www/articles/distfunctions/distfuncti...
[0]: https://www.ioccc.org/years-spoiler.html [1hint]: https://www.ioccc.org/2015/mills1/hint.html [1code]: https://www.ioccc.org/2015/mills1/prog.c
https://www.ioccc.org/2018/bellard/hint.html
I am not surprised what he chose to do. It may actually be the only entry that uses patented technology.[1]
There’s a bug in the deobfuscated version — sizeof(letters) should be 60 or sizeof(letters)-1 (that version reads past the end of the buffer otherwise).
https://easiestprogramminglanguage.com/easiest_programming_l...
Who needs libc ;)
This program does, for multiple things, regardless of how the entry point works.
If you wrote a different program, that didn't use libc, then it would not need libc, that is correct. But would that program fit on a post card?