A Little Path Tracer and a Little Dinosaur

A picture is worth a thousand words.
ironwallaby
Posts: 8
Joined: Sun Dec 30, 2012 9:48 pm

A Little Path Tracer and a Little Dinosaur

Postby ironwallaby » Thu Jan 24, 2013 2:25 am

Image

Nothing especially fancy, just a simple little path tracer and a cute little dinosaur, hacked together in a couple evenings and about 400 lines of JavaScript.

The path tracer itself is pretty crude (I really need to read up more on the right way to do this stuff); probably the only neat feature of the code (besides using HTML5 web workers to run in parallel and not make your browser crash) is how Nessie herself is defined: she's a 4D Catmull-Rom spline (x, y, z, radius) that's sampled a few hundred times and built hierarchically into a (sphere-only) BVH. It's a great little technique for making fun shapes without needing complex intersection maths (which are quite beyond me)! Since such a spline can be a complete binary tree, with a little cleverness, it could be built in a single-pass, too.

Live demo: http://ironwallaby.github.com/jellyjelly/
Source code: http://github.com/ironwallaby/jellyjelly/

lion
Posts: 36
Joined: Wed Sep 12, 2012 2:35 pm

Re: A Little Path Tracer and a Little Dinosaur

Postby lion » Thu Jan 24, 2013 6:35 am

Oh, not seen javascript realization by now, thanks!

Dade
Posts: 206
Joined: Fri Dec 02, 2011 8:00 am

Re: A Little Path Tracer and a Little Dinosaur

Postby Dade » Thu Jan 24, 2013 8:57 am

Ahah, funny :D

ironwallaby wrote:(besides using HTML5 web workers to run in parallel and not make your browser crash)


It seems to run with only 2 threads on my Linux+Firefox+i7 3930K, is that expected ?

ironwallaby
Posts: 8
Joined: Sun Dec 30, 2012 9:48 pm

Re: A Little Path Tracer and a Little Dinosaur

Postby ironwallaby » Thu Jan 24, 2013 1:06 pm

Dade wrote:It seems to run with only 2 threads on my Linux+Firefox+i7 3930K, is that expected ?


It's supposed to use up to four threads, but I honestly don't know how browsers go about scheduling them!

Ciebiada
Posts: 9
Joined: Thu Dec 27, 2012 9:38 am
Contact:

Re: A Little Path Tracer and a Little Dinosaur

Postby Ciebiada » Fri Jan 25, 2013 8:04 am

Neat and pretty!


Return to “Visuals”

Who is online

Users browsing this forum: No registered users and 3 guests