Found it interesting. Quite slow and useless the way it is now, but maybe someone could adapt it some way and make it useful… =D
It’s a javascript raytracer.
http://labs.flog.co.nz/raytracer/
Cheers
Found it interesting. Quite slow and useless the way it is now, but maybe someone could adapt it some way and make it useful… =D
It’s a javascript raytracer.
http://labs.flog.co.nz/raytracer/
Cheers
Quite nice, I think.
Quick googling found a python based one at http://www.boxel.info/morcy/static.php?page=yopyra .
It might be fun to dissect one of these just to see how it works.
The best way to do this online and client side is to use a Java Applet because it’s compiled code. Python and Javascript are both interpreted.
A common mistake. The only interpretation done in Python is the parsing of the .py files, the actual runtime execution is done in a VM-like engine (called CPython). In that it is not very far from Java.
Martin
so for the non-programmers/developers here, what does this mean…(Im planning to take comp sci at uni…)
For non-programmers/developers, the nuance doesn’t matter.
Writing a raytracer in any of these languages, while a fun and possibly enlightening exercise will end up with something going at approximately the speed of a legless donkey.
Martin
PostScript ray tracer. From 1988…
Sarah
Sunflow is a great java based renderer!
Writing a raytracer in any of these languages, while a fun and possibly enlightening exercise will end up with something going at approximately the speed of a legless donkey.
Well, that isn’t true. Java raytracers are pretty fast, almost on par with c/c++. Sunflow tends to render from 1.5-2 times the speed of Blenders raytracer, and in some cases as fast or faster.
And it looks gorgeous.
Usually if donkey’s are eaten, they are transported with motorised vehicles, so that would actually raise the speed of the ass quite significantly.
I can only agree… I am writing a python raytracer for my programming class and it is painfully slow But as you said it is a fun experience, and I can hopefully learn from it
shedskin is a python to c++ compiler and yopyra runs 60 times faster after running through it.
A common mistake. The only interpretation done in Python is the parsing of the .py files, the actual runtime execution is done in a VM-like engine (called CPython). In that it is not very far from Java.
java uses a jit though and is a lot less dynamic than python. that causes the performance difference i guess?
pypy is interesting. i am very curious about what speedups their jit will be able to achieve once it is more mature.
I think that says more about Blender’s raytracer’s less-than-stellar optimization than it does about C vs Java.
But yes, the difference isn’t quite as bad as Theeth has made it out (although I must admit that I adore his analogy). But still, renderers implemented in a compiled language will always be noticeably faster than their interpreted/VMed counterparts, assuming an equally good implementation. The just-in-time compiling stuff helps out quite a bit, but it can’t completely close the gap.
However, that being said, that doesn’t mean that renderers written in non-compiled languages aren’t viable.
However, that being said, that doesn’t mean that renderers written in non-compiled languages aren’t viable.
And due to the tiny development time of working with such languages (like python, java is excluded from this comment :p), they can be great sandboxes.
I use python to prototype some ideas, and if they need to be faster, I use c or similar. Most of the time, the performance is fine, particularly when you can run things like psyco and code just sections in c.
Note that Java can also be compiled to native through GCJ: it runs without a JVM nor JRE. No jit, no HotSpot…:yes:
I’ve tried it on small projects and works pretty well as long as you don’t try to use dynamic libs (or I haven’t found how to do those, I’m still newbie in GCJ). I don’t know how Sunflow would run if compiled though GCJ (I wonder if would even compile!).
It would be interesting to test how two similar implementations of a raytracer, one in Java and one in C, would compete if both were compiled. (imagine the ease of use of Java (subjective of course) and the speed of C! That’d be nice!)
Dani
/me goes back to code::blocks
Java gnu is crap. It is still in java 1.4 is with problems.
Hum nope!
They’re up to java 1.5, http://gcc.gnu.org/java/, look at the 8/01/2007 news! I think it’s a good option. The only thing that remains broken is “exception handling beyond boundaries” I think. That means you cannot do a main binary calling other libs at runtime. All has to be linked at compile time. At least for the moment!
Dani
A simple raytracer is not that hard to write in any languages. But writing a complate raytracer (with GI, photons, texture support) in javascript is just dumb if not impossible. I can see this site only as a good CS student project, nothing worth wowing at.
I’m programing my first raytracer right now in java! i have vowed however not to coppy any code from other rendering engines(in fact, i’m not even looking at any). its probably going to fail horribly, but whatever! right now the most issues i am having is with matrix transformations which my school failed to teach well.