[anim_image] [anim_image]

OpenGL vs Povray


Look around the Graphics Lab
OpenGL UFO Kite Animation
PovRay UFO Kite Animation

OpenGL Pros and Cons

For a programmer, creating a OpenGl version of the UFO was relativally easy. The library does not have a greate deal of options of choices in the generation of 3D objects. On the other hand it is highly optimised and designed speed, with real-time animation.

This means of course that only meshes of polygons can be used. A torus or sphere for example can only be approximated. But the polygon smoothing, and ``glut'' program libraries makes it very very easy to create such objects. The programmed interface however means that it is very difficult to create different objects and scenes without either heavy re-programming, or the use of commercial libraries of objects (which in turn can bloat your program). That is I can't just suddenly or easily change objects being displayed, without a lot of heavy programming. The hundereds of different object formats used for 3D objects also makes this a difficult prospect.

This means that unless you can find an appropriate library, some simple things like saving an image (say for use on the web), is very difficult. If I didn't happen to accidently run across a `save to tiff' subroutine, I'd probably would have been forced to doing manual screen grabs of the images wanted. For the UFO amination that involved 18 separate frames! A lot of work.

Also because of the techniques involved, it is very difficult without a lot of work to generate shadows.

On the other hand drawing lines and frame works is dead simple. Line drawing and text is just draw directly on the display. Also multiple windows and simultanious views of the current scene is also posible to generate. The same is true for real time interaction, such as rotation of view point, or zooming in and out from the scene. This makes it easy to quickly adjust parameters in Open GL to get what you want.

Raytracing Pros and Cons

The first thing that struck me with PovRay, as compared to OpenGl was the size of the manuals. Where OpenGl had only a minimal number of library functions, options and indeed objects, Povray has hundereds of options. Everything from true spheres, toruses, mathematical surfaces, and `blobs', to fogs, haloes, sky spheres. then to each object you can easlly add, and even warp and modify surface patterns, finishes, and even the normals of the surface to produce either realistic or far out wierd effects.

The manual is 500 pages! and took me 2 months to go though in my free time. Compare this to a week for OpenGl. The options however are all easy to use and do not require great programming skills to do 3d scene generation. A small begineers `getting started' manual and `quick reference sheets' for povray would be good area of improvment.

Povray also uses `scene files' (.pov) and `option files' (.ini) in which you define your 3D scene and how you want it rendered, respectivally. On top of this lots of pre-generated patterns, objects, and examples are provided, usally in included library files (.inc). All this means is that you can take your scene file from one machine to another, and you can be very sure that the povray program on each machine will work exactly the same.

The big disadvantage of PovRay over OpenGL however is the lack of interactivity. Each scene can take a long time to generate (definately not real time). As such simple things such as positing objects, camera, and view field, can take a long time and be frustrating. On the other hand, most of PovRays extensive command line options are designed to reduce trace time of test images, but even doing the final adjustment of options for the final image can take multiple runs unless you know what you are doing. Then again, I have NOT yet tried the various interactive 3D design programs which are available, for use with povray.

Raytracing produces very realistic images when compared to OpenGL. It is very easy to add say a background `sky sphere' with an appropraite cloud pattern from the povray library. Shadows are automatically produced and, transparency or reflections are dead easy. This is in contrast with OpenGL where to add anything special, generally requires you to render portions of your scene multiple times to produce simular but not the same effects. And all with a great deal of extra programming.

On the other hand, lines can NOT be generated! You have to add cylinders of an appropraite (read trial and error) thickness, so that it has thickness and is this visible. Of course this also means that the thickness of the lines needs to be adjusted as the distance between camera and the line changes, to keep them thin and visible. On the other hand such lines fade into the distance realistically and automatically, if that is what is wanted.

OpenGL vs Raytracing Summary

OpenGL is fast to learn, designed for interactive speed, but requires a lot of programming generate the scenes and even more for special effects like shadows. You can easily "walk though" generated worlds in real time.

Povray takes a long time to learn the huge number of options available, is slow to generate the images, and slow to debug the scene, but the scene is very easy to generate, complete with shadows, surface textures, and object interaction, and can made to look "realistic". The scene files also highly portible, and can be expected to work as is on almost any computer with povray installed.


Created: 24 Feburary 2001
Updated: 17 October 2001
Author: Anthony Thyssen, <anthony@cit.gu.edu.au>
URL: http://www.cit.gu.edu.au/~anthony/graphics/opengl_vs_povray.html