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.
Ed Lawson describes the scene of an accident in no uncertain words. “I don’t know where the fuck that came from!
Jambajim writes: In 1992, the El Paso police department fancied themselves rappers in this cautionary tale about gangbangers. The song’s called “Think Twice” (words & music by Greg Brickey) and it’s pretty awesome. I bet a lot of gang members saw this and were like “Woah, I should stop being a gang member!” Even now, […]
A doctor in Britain leveled a complaint against food company Müller over its latest product, yoghurt flavored to taste like gin cocktails and containing a small amount of alcohol. The yoghurts, which were launched last year, contain 0.5% gin. A spokesperson for the yoghurt maker said the product was fat-free, high in protein and contained […]
Bamboo fiber is a relatively new thing in luxury fabrics, but it’s no surprise it’s this snuggly. After all, pandas eat bamboo, and they constantly look comfortable. But seriously: To understand the benefits of real bamboo sheets, you have to spend a night on them. This 4-Piece Luxury 100% Rayon Bamboo Sheet Set is a […]
No chef’s arsenal is complete without a good set of knives. In fact, it’s the first big sign that you’re ready to start cooking meals as opposed to just warming them up. Here are 20 knife sets that any chef would be proud to own, from visually stunning old-world metallurgy to sleek modern cutlery. Mini […]
The latest iPhone cameras are undeniably impressive, but they’re still no match for a professional camera when it comes to taking clear, wide-angle shots. These six accessories will transform your iPhone into a pro-level camera in seconds, thanks to powerful and easy-to-attach lenses. 1. Lemuro 18MM iPhone Wide Lens MSRP: $100 | Sale Price: $80 […]