Raytracing is a method for drawing scenes by modeling beams of light, illuminating and richocheting off objects. It's realistic but very slow, and only the newest and most expensive video cards [Amazon] introduce it to realtime games. MySQL is the most commonplace relational database, the sewer containing all the web's fatbergs, the last thing on earth you'd use for number-crunching graphics. Or ... is it? Behold the MySQL Raytracer, by Holtsetio.
This is a raytracing engine contained in a single Mysql SELECT statement. In the beginning of the code there are a few parameters that can be modified. The scene can be specified using the @triangles and @squares parameters, but everything is explained in the comments. The whole query returns a bitmap file which can be written to the filesystem using the "INTO DUMPFILE" syntax at the end of the query, if mysql has filesystem write permissions.
The raytracer supports shadows and reflections, which makes it, to my knowledge, the most advanced MySQL raytracer on the market right now. However, it is not really polished and kinda slow. Since I didn't really know how to present this work in a demoparty friendly way, I just included two finished renderings.
Merriam-Webster defines “bull in a china shop” as “a person who breaks things or who often makes mistakes or causes damage in situations that require careful thinking or behavior.” But Mythbusters actually let a bull loose in a china shop and learned that bulls are . . . “very careful” of the china. When the […]
Three Indiana judges got in a fight. Two were injured, all were suspended. NPR’s Laurel Wamsley reports “an incident brimming with colorful details.” The altercation apparently started sometime after 3 a.m., when one of the judges, Sabrina Bell, raised a middle finger at two men yelling from a passing SUV, and ended after one of […]
The moment when the collective decision is made; you’re about to see one of those, but for people.
Need a boost on that resume? Get a valuable tech education on your own time with these eBook bundles. They contain guides from Packt Publishing that cover everything from game development to machine learning. The Complete Mobile App Developer eBook Bundle It’s a veritable gold rush in the App Store these days. Get in on […]
Vinyl is officially back. People are hearing the proof behind the initial “retro” excitement: that records really do have a richer sound. And if you haven’t switched to old-school records for serious listening, it’s a new golden age. Why? Because quality turntables like the Altec Lansing ALT-500 are finally available to a market other than […]
Between all of our apps, streaming devices, Bluetooth speakers, and energy-sucking decorations, paying for utilities each month can be…brutal. In fact, the average household spends roughly $70 a month on the water bill alone. That number might not seem terribly significant, but when you add it up, that’s $840 a year — a pretty significant […]