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.
I don’t know why I made this.
KFC closed its restaurants to all but drive-through customers and deliveries days ago. According to this video, however, the company is quietly ordering managers to keep lobbies open to serve walk-in takeout customers. I’ve come up with this plan to protect my employees because they’re trying to force us to open the lobby again. Looks […]
Britain’s ancient, fatberg-infested sewers are already choked to the grates thanks to irresponsible flushings during the coronavirus crisis. People running out of (or hoarding) toilet paper are instead using paper towels, kitchen napkins, wet wipes, newsprint and other materials that won’t break down. Northumbrian Water posted this handsome image of the random trash locals are […]
Paralysis by analysis. It’s the phenomenon that happens when you’re so stuck on thinking through all the ramifications of your actions that you don’t actually take action in the first place. That can happen with all this free time you’re spending stuck inside your house. With literally every home-bound option available to you, it’s easy […]
At this point, it’s every single person’s responsibility to reduce their own carbon footprint and transition to a more sustainable lifestyle. But if you consider the grim fact that the biggest culprit of greenhouse gas emissions from human activities in the U.S. is burning fossil fuels for electricity, things, like pivoting to metal straws and […]
Companies that don’t have their own in-house design teams (which means 99 percent of all companies these days) face lots of serious questions. Among those questions is how you keep up with all the design requirements of a 21st-century company without the personnel. It isn’t just a website or an annual product catalog anymore. It’s […]