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.
Twitter reports that email address and phone numbers added for security reasons such as two-factor authorization “may have inadvertently been used for advertising purposes.” When an advertiser uploaded their marketing list, we may have matched people on Twitter to their list based on the email or phone number the Twitter account holder provided for safety […]
After killing a man in a road accident, Anne Sacoolas, the wife of an American diplomat, was interviewed by police and promised not to leave the country while the incident was investigated. She quickly fled to the U.S., and now Britain is asking its ally to waive diplomatic immunity and send her back. Anne Sacoolas […]
All Medina Hall wanted was to be told if the brownie had nuts in it. But staff at a Burger King in Folkestone, England, refused to read the ingredients list to her off the menu — she is blind — claiming that there were rules that forbade them from doing so. Burger King apologized to […]
Whoever said you’d never need math to succeed in life clearly never sat down at a high-stakes poker table. When it comes right down to it, poker is a winnable game no matter where you play it – as long as you play the odds. There are time-honored strategies for playing those odds, tested by […]
Clearly there’s a booming market for CBD out there, as more people discover the relief from pain and stress that it can bring. But not everyone uses it the same way, and that’s why cannabidiol products from Common Ground are gaining ground with consumers – not just because they’re one of the most trusted sources […]
Good designers know that a picture can be worth more than 1,000 words. It can also be worth a fair paycheck if you find the right image. That’s why you might want to take advantage of these premium stock photo services, both offering access to thousands of original pics and both on deep discount this […]