Personal tools

Glome

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search
(One intermediate revision by one user not shown)
Line 2: Line 2:
 
Glome is a ray tracer written by Jim Snow. Originally it was written in Ocaml, but the more recent versions are written in Haskell.
 
Glome is a ray tracer written by Jim Snow. Originally it was written in Ocaml, but the more recent versions are written in Haskell.
   
Glome renders into an OpenGL window, and thus requires HOpenGL, though the libraries GlomeVec and GlomeTrace do not.
+
Glome consists of the vector library GlomeVec, the ray tracing library GlomeTrace and an application called GlomeView.
   
If everything works, you should see this image when you run Glome the first time:
+
GlomeView renders into an SDL window, and thus requires SDL. The ray tracing engine itself, though, has few dependencies.
  +
  +
(There is a deprecated package available on Hackage called glome-hs, which renders into an OpenGL window. It probably won't work with recent versions of GlomeTrace.)
  +
  +
If everything works, you should see an image something like this when you run Glome the first time:
   
 
[[Image:Glome-testscene-small.png]]
 
[[Image:Glome-testscene-small.png]]
   
(It renders in about 20 seconds on my AMD-64. It does not currently use multiple cores.)
+
(Use +RTS -N4 or whatever if you want to use more than one core.)
   
Glome does not have a scene description language of its own (save for a rather rudimentary NFF parser), so the most convenient way to describe a scene is directly in Haskell. One can edit the file TestScene.hs, then re-compile.
+
Glome does not have a scene description language of its own (save for a rather rudimentary NFF parser), so the most convenient way to describe a scene is directly in Haskell. One can edit the file TestScene.hs included in GlomeView, then re-compile.
   
 
==News==
 
==News==
Line 16: Line 16:
 
* Jan 20, 2010: GlomeTrace library released
 
* Jan 20, 2010: GlomeTrace library released
 
* Jan 22, 2010: New version of GlomeVec to (hopefully) fix GlomeTrace compile * failure
 
* Jan 22, 2010: New version of GlomeVec to (hopefully) fix GlomeTrace compile * failure
  +
* Jan 27, 2014: New version of GlomeVec, GlomeTrace, and GlomeView fixing several bugs that caused CSG to render incorrectly.
   
 
==GlomeVec==
 
==GlomeVec==
GlomeVec is the vector library used by Glome. Originally, it was part of Glome, but now it is a separate library.
+
GlomeVec is the vector library used by Glome. Originally, it was part of Glome, but now it is a separate library. It isn't implemented in any particularly clever way, but it has many useful routines for graphics built-in, like transformation matrices.
 
GlomeVec is yet another vector library. It isn't implemented in any particularly clever way, but it has many useful routines for graphics built-in, like transformation matrices.
 
   
 
GlomeVec is also used by a separate project, [[IcoGrid]]
 
GlomeVec is also used by a separate project, [[IcoGrid]]
Line 48: Line 49:
 
*PLY file parser
 
*PLY file parser
 
*Rendering to a file
 
*Rendering to a file
*Multithreading
 
 
*Support for portals
 
*Support for portals
  +
*Ability to tag objects and have ray intersection return the tag to tell you what you hit.
   
 
==Questions==
 
==Questions==
Line 66: Line 67:
 
==Links==
 
==Links==
   
* [http://hackage.haskell.org/package/glome-hs Glome on Hackage]
+
* [https://github.com/jimsnow/glome Glome repositories on github]
  +
* [http://hackage.haskell.org/package/GlomeView Glome Viewer on Hackage]
 
* [http://hackage.haskell.org/package/GlomeVec GlomeVec on Hackage]
 
* [http://hackage.haskell.org/package/GlomeVec GlomeVec on Hackage]
 
* [http://hackage.haskell.org/package/GlomeTrace GlomeTrace on Hackage]
 
* [http://hackage.haskell.org/package/GlomeTrace GlomeTrace on Hackage]
Line 73: Line 74:
 
* [http://tog.acm.org/resources/SPD/ The Standard Procedural Database]
 
* [http://tog.acm.org/resources/SPD/ The Standard Procedural Database]
 
* [http://www-graphics.stanford.edu/data/3Dscanrep/ Stanford Scanning Repository]
 
* [http://www-graphics.stanford.edu/data/3Dscanrep/ Stanford Scanning Repository]
* [http://ompf.org/forum/ OMPF forum]
+
* [http://ompf2.com resurrected OMPF forum]

Revision as of 21:10, 27 January 2014

Contents

1 About

Glome is a ray tracer written by Jim Snow. Originally it was written in Ocaml, but the more recent versions are written in Haskell.

Glome consists of the vector library GlomeVec, the ray tracing library GlomeTrace and an application called GlomeView.

GlomeView renders into an SDL window, and thus requires SDL. The ray tracing engine itself, though, has few dependencies.

(There is a deprecated package available on Hackage called glome-hs, which renders into an OpenGL window. It probably won't work with recent versions of GlomeTrace.)

If everything works, you should see an image something like this when you run Glome the first time:

Glome-testscene-small.png

(Use +RTS -N4 or whatever if you want to use more than one core.)

Glome does not have a scene description language of its own (save for a rather rudimentary NFF parser), so the most convenient way to describe a scene is directly in Haskell. One can edit the file TestScene.hs included in GlomeView, then re-compile.

2 News

  • Oct 25, 2009: GlomeVec library released
  • Jan 20, 2010: GlomeTrace library released
  • Jan 22, 2010: New version of GlomeVec to (hopefully) fix GlomeTrace compile * failure
  • Jan 27, 2014: New version of GlomeVec, GlomeTrace, and GlomeView fixing several bugs that caused CSG to render incorrectly.

3 GlomeVec

GlomeVec is the vector library used by Glome. Originally, it was part of Glome, but now it is a separate library. It isn't implemented in any particularly clever way, but it has many useful routines for graphics built-in, like transformation matrices.

GlomeVec is also used by a separate project, IcoGrid

GlomeVec also includes a basic solid texture library. Right now, it has an implementation of perlin noise and a couple of simple textures like stripes.

4 GlomeTrace

GlomeTrace is a library that provides ray-tracing algorithms and a variety of geometry primitives. Originally, it was part of Glome, but now it is a stand-alone library.

Supported base primitives include: sphere, triangle, cone, cylinder, disc, plane, and box.

Composite primitives (those which are containers for other primitives) include groups, csg differenc and intersection, transformed instances, textured objects, and bounding objects.

In addition, there is an implementation of the BIH acceleration structure, which automatically builds a bounding volume hierarchy around unsorted lists of primitives. This greatly improves the performance for large scenes.

GlomeTrace depends on GlomeVec, but it doesn't have any other unusual dependencies.

5 Documentation

6 Features Lacking in Glome

This is a sort of to-do list

  • Antialiasing
  • Refraction
  • Photon mapping
  • PLY file parser
  • Rendering to a file
  • Support for portals
  • Ability to tag objects and have ray intersection return the tag to tell you what you hit.

7 Questions

Send any questions to the author: jsnow@cs.pdx.edu In particular, I'd like to know if the test image is failing to render on you platform, or if it is failing to build.

8 Other Notable Renderers

These are some successful open-source ray tracers. They're worth looking at for anyone interested in writing their own.

  • POV-Ray - fairly slow, high-quality renderer with many features. This is the renderer that has had the most influence on the design of Glome.
  • Arauna - high performance renderer used for realtime games, faster than Glome by two or three orders of magnitude.
  • PBRT - topic of an excellent book on ray tracing.

9 Links