top | item 21218144

The most advanced MySQL raytracer on the market

276 points| polemic | 6 years ago |pouet.net | reply

47 comments

order
[+] skrebbel|6 years ago|reply
If you're unfamiliar with navigating the fabulous Pouet.net, the relevant background is in the so-called "infofile": https://www.pouet.net/prod_nfo.php?which=83222

(or click [nfo] in the right top)

[+] Reisen|6 years ago|reply
I really appreciate comments like this for the quick time save they offer. Thank you for this comment, it was the most useful in this post for me.
[+] deckar01|6 years ago|reply
> 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.

https://demozoo.org/productions/268459/info/2923/

[+] benibela|6 years ago|reply
Fun fact:

The official XPath/XQuery test suite of the W3C contains an raytracer written in XQuery.

So most xml databases should support raytracing

[+] tpmx|6 years ago|reply
Now this is art! I think us geeks have finally hit upon the formula the high brow art people are used to. Now we just need to start a physical market so that:

a) demoscene creators can get rich

b) "art investors" can launder their money

[+] brokensegue|6 years ago|reply
the problem with "demoscene art" is that the final product is often only impressive if you know how it was done. really you want to display it in a way that shows off the mechanism. i guess quines don't have this problem.
[+] aasasd|6 years ago|reply
For better or worse, there's no scarcity in software. And thus, “we hackers do for love what others wouldn't do for money.”
[+] kebman|6 years ago|reply
Pushwagner printouts are sold for a ludicrous amount of money here in Oslo. No reason demo scene guys shouldn't be able to do that also.
[+] bane|6 years ago|reply
Anybody in North America who's interested in this kind of technical magic should consider attending one of the few demoscene parties (meetings/competitions) in the U.S. such as Demosplash [1]

1 - https://www.youtube.com/watch?v=A-GTf7b9PKk

If you are in Europe, especially Northern Europe, there's a ton of very well attended parties. There's even a few in Japan!

It's really for people who are extremely passionate about technology for technology's sake and like to show off a little.

[+] xemdetia|6 years ago|reply
This is actually a pretty neat mechanism that builds a string (including BMP magic number and header) and shoves it into a dump file, doing a ray trace per byte. I wish there was a commented/not collapsed version of it to better enjoy reading. Right now it's just a blob.
[+] bherrmann7|6 years ago|reply
"Released under the do whatever the fuck you want license. If you use it for commercial purposes, like rendering your Hollywood studio's new big animated A-Movie, please let me know at [email protected]. " -- https://demozoo.org/productions/268459/info/2923/
[+] QuercusMax|6 years ago|reply
Is there a "this is probably a bad idea; if you use this code I'm not responsible" license?
[+] james_s_tayler|6 years ago|reply
Is there a TL;DR legal entry for that? LMAO.
[+] yellowapple|6 years ago|reply
Wherefore the fuck?

Though I'm suddenly curious if this can be done in other SQL engines, too.

[+] hultner|6 years ago|reply
Well, yes of course, there's probably an ripe untapped market there. Lot's of potential!
[+] Flockster|6 years ago|reply
This is nice. So this is one SELECT statement in which the triangles and/or spheres are defined, and the raytracing-engine is written. Then it calculates the Pixels and dumps them into a .bmp-file.
[+] mwexler|6 years ago|reply
It is surprising to discover that there is actually a market for multiple MySQL Raytracers, much less that this is the best of them. Clever stuff.
[+] jolmg|6 years ago|reply
Calling it "the most advanced [...] on the market" is probably tongue in cheek. Notice that this is being given away free and there is no mention of price anywhere.
[+] ivalm|6 years ago|reply
Did we break it? (site doesn't load for me)
[+] pankajdoharey|6 years ago|reply
Ok so now I am curious if it could be done in other engines Cassandra,SPARQL ...
[+] jandrese|6 years ago|reply
Unrelated question: Is there an Ignobel for Computer Science?
[+] etaioinshrdlu|6 years ago|reply
I wonder if something like this might even be slightly practical using BigQuery or similar..
[+] nerpderp82|6 years ago|reply
UDFs are throttled, so to get max perf out of BQ one would need to make sure it was pure sql.
[+] m463|6 years ago|reply
So to accelerate this, do I need an SSD or a GPU or a DBA?
[+] erik_seaberg|6 years ago|reply
If you tesselate models down to triangles, you're going to want to persist them in a triplestore.