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.
The Fashion Institute of Technology has apologized for a “clearly racist” show where a black model was asked to wear giant red lips and black plastic ears. The model refused, but white colleages were photographed on the catwalk wearing the bizarre prostheses. The college’s president is not sure if there was an explicitly racial comment […]
Burger King’s switching to preservative-free ingredients, and chose to market this fact by showing what will now happen to its sandwiches if they are left out uneaten. Welcome to the intersection of advertising and earned media, puke bags are under the seats.
Michael Avenatti, the pugnacious lawyer who rose to fame representing porn star and Trump mistress Stormy Daniels, is now a convicted criminal. A jury found him guilty today of trying to extort millions of dollars from fashion brand Nike by threatening to publicly accuse them of making illegal payments to amateur athletes. He’ll be sentenced […]
It may not rank up there with climate change or personal debt, but confess…isn’t it the worst when you’re trying to put a food container in the fridge, but can’t find the right lid to fit? Hey, not everything has to be a global crisis to be irritating to the core. But still…it’s even more […]
Assembling a truly autonomous smart home is getting closer and closer to reality every day. But for every new smart bulb, thermostat, home security system and appliance we set loose within our walls, there are still probably a half dozen “dumb” items we’d still love to replace. But whether they’re too costly or too big […]
With so many manufacturers out there these days, it’s tough to know who to trust in the ultra-competitive wireless earbuds market. If you’ve never heard of LinearFlux, you may soon. That’s because it’s a company with a stellar pedigree whose co-founders were two of the engineers behind the original success of two audio houses you […]