Enlight starts to emerge

Posted: December 13, 2012 in Uncategorized
Tags: , , ,

Spent a bit of time this weekend hacking on Enlight, my little Clojure raytracing project. Here’s one of the first outputs:

Image

 

 

So far I have working:

  • The core raytracing code – enough to cast rays from the camera and render a simple scene. No reflections / lighting yet.
  • A basic primitive Sphere. Just to test that things work! I’ll add more primitives once the API is a bit more settled as I don’t want to be stuck with too much refactoring quite yet.
  • Object colouring provided via Clisk. This is one of my killer features, since clisk is already a pretty good compiler for procedural image generation, and can create good 3D textures pretty easily. The scene above is just colouring the sphere with the Clisk function “vsnoise”.
  • The start of a scene graph compiler. This takes the scene description (a Clojure data structure) and compiles it into an optimised tree of Java objects for rendering. I’m still playing with the scene description language design: it’s one of the most important things to get right.

Oh yeah – it’s pretty fast. The image above rendered in about 30 milliseconds.

Advertisements
Comments
  1. David says:

    Do you think that you will include support for stl/mesh generation? That would allow for generating 3d printed objects from clojure. I’m not sure whether that’s integrable with the raytracing core.

    • mikera7 says:

      I’m not too familiar with STL, but having ha d a quick look it doesn’t seem to complex so it should be doable. I suspect it would be possible to generate a STL mesh file by just casting rays at an object and builing the mesh up from the intersection points.

  2. smk says:

    If I want to use enlight from a lein project how to do?
    Thx in advance

    • mikera7 says:

      Hi smk,I pushed a test version out to clojars (enlight 0.0.1) that you should be able to include as a lein dependency. Be aware that it’s still all at a pretty early stage though! If you just want to use enlight to render some images then I’d give it a few more weeks before testing it out. You can’t do very much with it as of now, and the scene description language is still very much a work in progress.

      If you want to hack on it of course then it is all open source on github, so feel free to fork / hack / send in patches!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s