Working Python Raytracer

I found this code here, which is a pretty neat little Raytracer in just about 380 Lines of Code! So i tried it in Blender, fixed wrong print, added save to image, made rgb 0-1 instead of 1-255, and it works… :smiley:


the geometry itself is created within the script, so not a render of Blender objects. don’t know how hard it is to implement :wink:

try it yourself, render only takes about 1 minute. just copy the code here bellow into a Text Editor Text and hit Run Script, the look for a Image named PythonRender

That is interesting. Because it is written in python it will forever be stuck using a single core, however.

yeah, i don’t really see much use for it, i just found it interesting :wink:

Have you seen Minilight?

http://www.hxa.name/minilight/

Unfortunately the Python version is a translation and not very well commented. But the Ruby version is an original with plenty of comments by the author. Interesting stuff, even though I don’t understand it in detail. Good for a new coder to learn from though.