JSRay - Javascript Raytracer

00000000000000000000000000000000
0
Anonymous Apr 15, 2010 at 14:00

10-04-14.jpg

Description
I’ve been working on this little Javascript Raytracer for quite some time. My goal was real-time, knowing that I would likely not succeed, but you have to aim high sometimes. The raytracer now supports spheres, boxes(not rotated…) one plane, a sunlight, point-lights, reflection, anti-aliasing and not much more :). I use very weird techniques to achieve speed-ups, have not implemented any well known methods at all I believe. I tried adding a sort of tree structure but this really hammered the performance, so it was removed again. Possibly the tree only makes sense when scene complexity increases.

Real-time remains fictional, but I have managed to create a preview thats kind of fun. Using the mouse buttons and wheel you can navigate around the scene fairly easily with a low resolution preview to find the spot you would like to render. give it a shot :)

Don’t use Internet Explorer, it really won’t work… Chrome works best.

http://jsray.user2dev.com

6 Replies

Please log in or register to post a reply.

6837d514b487de395be51432d9cdd078
0
TheNut 179 Apr 15, 2010 at 16:03

Nice work. I believe you have the finest ray tracer demo written for the web. You should give this demo to the browser giants and tell them that JavaScript will not be considered fast unless you can render my demo with speeds equivalent to native code ;)

So what are your plans with this? Or simply the web and graphics in general. Any thoughts about building 3d games using similar tech (web 3d or whatnot)?

E4ba6ba756a1a5bf1505ca85e0a7495f
0
_rant_ 101 Apr 16, 2010 at 11:21

This is quite impressive, raytracers are like a hobby for me :D It even works on my new HTC, although it would drain power quickly. And something’s wrong with the canvas… but it works :D

A638aa42130293f319eda7fa4ba121f4
0
fireside 141 Apr 16, 2010 at 12:11

Very cool. Moving around in low res was a good idea, but I think it should have possibly diverted to just low everything also because when I tried some of the higher things, it slowed down when moving around.

417da4ebe698388116f7220a0ee9fbc2
0
marcgfx 101 Apr 16, 2010 at 15:57

thanks for the comments :) . yeah, I’ll have microsoft get IE up to date, wouldn’t that be fine! my

plans were to maybe once make a small game with rendered graphics online, but… currently that doesnt seem to be an option :) it would be possible with some kind of faked raytracing though, might look into that :) . have some more javascript fun in the pipeline, no raytracing involved there though, stay tuned!

B1ebc32b2ab75924065ab8508b62e224
0
legloups 101 Apr 16, 2010 at 19:57

Impressive as to raytracer, very good work :)

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 Apr 18, 2010 at 07:15

Beautiful shot you picked off it, looks like a really pretty story book.