Ray Tracer in SQL
36 points by kbumsik 5 hours ago | 9 comments
laszlokorte 3 hours ago
Very cool! I did a similar (but much simpler!) experiment by implementing perspective projection via SQL, storing meshes (vertices, edges, faces), the camera position and the screen size in tables and building a single query that generates the SVG paths (including backface culling). Running via WASM SQlite inside the web browser. [1]
reply SELECT project(...) as x, project(...) as y
FROM model, vertex, camera, transform
WHERE clockwise AND clipped IN BETWEEN -1 AND 1
[1]: https://static.laszlokorte.de/sql3d/cma256 3 hours ago
Very cool project. Next they should create a database with SQL. Querying my database's database with my database's SQL's SQL would be trippy.
reply
A good reference for exactly what I mean would be the demoscene (both back then and now). You can watch a thousand of those and be totally underwhelmed, but every now and then you get one that totally blows your mind.
There's nothing wrong with seeking novelty, but there is something wrong being jaded about it.