[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 relatively easy. The library does not have a great 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 hundreds 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 accidentally 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 animation 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 simultaneous views of the current scene is also possible 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 OpenGL to get what you want.

Ray Tracing 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 hundreds of options. Everything from true spheres, toruses, mathematical surfaces, and 'blobs', to fogs, haloes, sky spheres, then to each object you can easily add, and even warp and modify surface patterns, finishes, and even the normals of the surface to produce either realistic or far out weird effects. All of which can be done incrementally, so as to slowly improve the results without having to re-write you previous code.

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 beginners 'getting started' manual and 'quick reference sheets' for POVRay would be good area of improvement.

POVRay also uses 'scene files' (.pov) and 'option files' (.ini) in which you define your 3D scene and how you want it rendered, respectively. On top of this lots of pre-generated patterns, objects, and examples are provided, usually 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 (definitely 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 POVRay's 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.

Ray Tracing can produce very realistic images when compared to OpenGL. It is very easy to add say a background 'sky sphere' with an appropriate 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 similar 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 appropriate (read trial and error) thickness, so that it has thickness and is thus visible in your render. 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 Ray Tracing 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. But you can easily 'walk though' a generate world 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 portable, and can be expected to work as is on almost any computer with POVRay installed.


Created: 24 February 2001
Updated: 17 October 2001
Author: Anthony Thyssen, <Anthony.Thyssen@gmail.com>
URL: https://antofthy.gitlab.io/graphics/opengl_vs_povray.htmlt