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.
Does cooking a Impossible Burger on the same surface used to cook normal burgers “contaminate” them with meat by-products? Is Burger King doing this? A vegan diner makes these claims in a lawsuit filed Monday against the fast-food chain. Reuters: The lawsuit filed in Miami federal court seeks damages for all U.S. purchasers of the […]
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 […]
Paying for things is all too easy online these days, and that’s why managing your money has gotten so hard. We’ve all done it: You sign up for a streaming subscription or gym membership, blow past the free trial date, and it becomes a part of your monthly expenses. Some of us juggle so many […]
We all know those gifts we get “for the kids,” the ones that parents are secretly more excited to open. Drones are a perfect example, but there’s a model out there that really doubles down on that appeal. Introducing the Space Fighter Building Block Drones, a series of space fighter drones that are a blast […]
The hardest part of web design can be nailing down the look. These days, even non-designers can easily spot a stale stock photo or lazily-made icon. What’s the solution? No matter what kind of artist you are, it’s always a good idea to widen your palette. And with more than a million vector images to […]