Fanning Software Consulting

Slow Rendering in Object Graphics

QUESTION: I've turned hardware rendering on for my object graphics program, but the rendering is still very, very slow. In fact, I've tested it against the software rendering with the Mesa Library, and it is just about as slow as that. It really seems as though hardware rendering is turned off for some reason. What am I doing wrong?

ANSWER: It is possible to have all the RENDERER keywords set properly for hardware acceleration and still get only software acceleration. The reason for this is that if you have asked IDL to maintain window backing store for your draw widget (RETAIN=2), then the backing store functionality is always implemented with the software OpenGL library. In object graphics programs, you should always set RETAIN=0 and repair your own window damage by re-drawing your scene when you receive an EXPOSE event for the draw widget.

Karl Shultz explains what happens when RETAIN=2 in a Janurary 28, 2005 article on the IDL newsgroup:

What actually happens here on a Windows platform is that IDL passes a Windows bitmap (DIB) to OpenGL and tells OpenGL to render into it (once) instead of a window. OpenGL reverts to its software renderer to accomplish this. Then the DIB is blitted to the window when it needs to be drawn or when repairing window damage. Effectively, you end up with software rendering.

In a way, the RENDERER property isn't described all that accurately. Rather than the 0/1 values meaning hardware/software, it is a tiny bit more accurate to say OpenGL/Mesa. The hardware/software meaning is a bit easier for most people to understand and works most of the time, this situation being one of the exceptions. Another exception can occur if you have a really basic video card and the supplied OpenGL implementation ends up doing everything in software.

I suppose another way to think of it is that RENDERER=0 means use hardware acceleration whenever possible, and RENDERER=1 means always use the standard, stable, and consistent software renderer.

If you have a nice graphics card, you're really shortchanging yourself if you use only software rendering. The later nVidia and ATI cards run IDL very well and the drivers are updated frequently. The frequent driver updates can be a problem. For example, I updated my ATI drivers about a month ago and that caused some IDL object graphics text to stop displaying. I reverted back to the previous driver to recover. I then installed an updated driver that came out soon after that , and everything looked good. So, you do have to be a bit careful with drivers.

Web Coyote's Guide to IDL Programming