Performance under OpenGL

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
eudemon
Posts: 14
Joined: Mon Jul 04, 2005 2:48 am

Performance under OpenGL

Post by eudemon »

Hello everyone, I recently downloaded the engine and started playing around with it a bit. In the second tutorial though, I get horrible performance when using the openGL rendering option. As slow as 2-4 fps at times. (Software rendering is much faster, but it looks like it only makes a polygon visible if the entire thing is in the field of vision. Direct X is not an option, since I'm running ubuntu linux)

I get decent framerates in games that I've tried and 3d test programs using openGL. Is it just the size of the map that's loaded, or what? It seems my computer should be powerful enough to be able to handle a Quake 3 map fairly well, so I'm at a bit of a loss.

Does irrlicht use only openGL 1.2? Because my openGL version string says that I'm using 1.3.5140. Could this be it?

Thanks for any help!
hybrid

Post by hybrid »

It seems that you are running OpenGL without hardware acceleration. 2 FPS is the average I get using a non-optimized software OpenGL support. If you get better frame rates with other tutorials I don't know what's wrong, but other wise it's a problem with libraries installed twice on your system, and linking to the slow one. Check the found library with "ldd ./example" It should print out all used libraries. Then, check the same with applications with hardware acceleration. If the OpenGL libraries (libGL*) are different you should set your LD_LIBRARY_PATH to that of the fast application.
Guest

Post by Guest »

Well the output from ldd doesn't seem to show any OpenGL libraries:

Code: Select all

        libXxf86vm.so.1 => /usr/X11R6/lib/libXxf86vm.so.1 (0xb7fd8000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0xb7fcb000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0xb7f06000)
        libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7ef5000)
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0xb7e3b000)
        libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7e1a000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e0f000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7ce2000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7cdf000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7feb000)
The funny thing is my bash profile looks like it should already be modifying LD_LIBRARY_PATH so that is points to the correct libGL. Is there some way to check the current value?

Also, just as an experiment I tried something that I knew would cause an undefined reference error in libGL.a. It was using the libGL.a from the location of the fast version.
eudemon
Posts: 14
Joined: Mon Jul 04, 2005 2:48 am

Post by eudemon »

That last one was me :oops:

EDIT: I think you're close hybrid. Looking again at the other tutorials, the performance isn't that much better.
hybrid

Post by hybrid »

Since you did not find any OpenGL libraries they will be compiled in as static library. This is a strong indication that you're linking against the wrong libraries. You have to set the library search path upon linking, i.e. the last stage of compilation. Use the -L/path/to/library and write this option directly before the -lGLU -lGL library options. In order to find the correct path try 'find / -name "libGL*"' to search for all OpenGL libraries. Usually they are located at /usr/local/lib, but it might be different based upon hardware vendor libraries.
eudemon
Posts: 14
Joined: Mon Jul 04, 2005 2:48 am

Post by eudemon »

Got it fixed. Thanks a lot hybrid! :D The makefile didn't have the -lGLU option anywhere. Now that it is in there, I'm getting almost 200 fps.
Post Reply