[OpenGL] Awfully slow !!!

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.
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

[OpenGL] Awfully slow !!!

Post by Lideln »

Hi all !

Back with Irrlicht after some computer issues (windows crashed all the time, so I'm now on Linux : Ubuntu Dapper) with the goal/dream to create a HOMM5 remake.

I used the Irrlicht 1.1 with OpenGL but it crashed, telling me "doublebuffering" was not available... After some research here, I decided to use the SVN version.

After downloading (checkout) the svn version, I tried to compile it but got errors (either when compiling Irrlicht or when compiling a project).
I found that some files (CGUIColorSelectDialog and SColor) were not built by the Makefile.
After changing that and correcting some mistakes in the code ("IGUIScrollBar.h" was included with "IGUIScrollbar.h", and some other things, like : L"°" which did not compile, a typing mistake in a function call, and so on), I finally got it compiling the examples ! :D

BUT ! (arf, there is a "but !") : the FPS are soooooooooooo loooooooooow !!!
For example, the "Demo" project runs at 5 FPS...
My computer is a P4 2.4GHz, 1Go DDR RAM, GeForce 6600, so it should run at 100 FPS !

I did not get those issues when I was on Windows, using DirectX :(

Another issue : the Q3 map does not load correctly : it complains it cannot find some textures, although on Windows as far as I remember it worked correctly.

If someone can help me correct these issues, I would be VERY grateful ! :)

Thanks a lot,

Lideln
--
Lideln, France
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The errors are due to recent changes in SVN. Depending on which developer added something only a subset of all project/ make files are updated. Also upper/lower case problems are likely to be missed by people developing under Windows :cry: I'll update the Makefile and other files in the next days.

For the OpenGL problem: Please post the console output after starting any of the Irrlicht examples, maybe 'glxinfo -l' output and the FPS you get with glxgears. I guess you have no hardware 3d support enabled.
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post by Lideln »

Hi Hybrid !

I see you are very active on the forum, pretty good thing :)

Ok for the errors, I just thought that a SVN version was commited only if no compile bugs were found, so if you need the changes I made, I'll post them, if it is of any help for you, of course.

I'm quite new to Linux (even if my studies forced me to use NetBSD for a long time...), so forgive me if I did not post this "glxinfo -l" earlier, I do know only some very very basics commands... :oops:

Here is the result of glxinfo -l :

Code: Select all

name of display: :1.0
display: :1  screen: 0
direct rendering: No
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating,
    GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_OML_swap_method,
    GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_hyperpipe,
    GLX_SGIX_swap_barrier, GLX_SGIX_fbconfig
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_visual_info,
    GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_SGI_video_sync,
    GLX_NV_swap_group, GLX_NV_video_out, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGI_swap_control, GLX_NV_float_buffer, GLX_ARB_fbconfig_float
GLX version: 1.2
GLX extensions:
    GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating,
    GLX_EXT_import_context, GLX_SGIX_fbconfig, GLX_ARB_get_proc_address
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 6600/AGP/SSE2
OpenGL version string: 1.2 (2.0.2 NVIDIA 87.62)
OpenGL extensions:
    GL_ARB_depth_texture, GL_ARB_imaging, GL_ARB_multitexture,
    GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_shadow,
    GL_ARB_texture_border_clamp, GL_ARB_texture_cube_map,
    GL_ARB_texture_env_add, GL_ARB_texture_env_combine,
    GL_ARB_texture_env_dot3, GL_ARB_texture_mirrored_repeat,
    GL_ARB_window_pos, GL_ARB_texture_non_power_of_two, GL_ARB_vertex_program,
    GL_ARB_fragment_program, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color,
    GL_EXT_blend_func_separate, GL_EXT_blend_minmax, GL_EXT_blend_subtract,
    GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_EXT_multi_draw_arrays,
    GL_EXT_packed_pixels, GL_EXT_rescale_normal, GL_EXT_secondary_color,
    GL_EXT_separate_specular_color, GL_EXT_shadow_funcs, GL_EXT_stencil_wrap,
    GL_EXT_texture3D, GL_EXT_texture_edge_clamp, GL_EXT_texture_env_add,
    GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, GL_EXT_texture_lod,
    GL_EXT_texture_lod_bias, GL_EXT_texture_object, GL_EXT_vertex_array,
    GL_ATI_texture_mirror_once, GL_HP_occlusion_test,
    GL_IBM_texture_mirrored_repeat, GL_NV_blend_square,
    GL_NV_texgen_reflection, GL_NV_texture_rectangle,
    GL_NV_texture_env_combine4, GL_SGIS_generate_mipmap, GL_SGIS_texture_lod,
    GL_SGIX_depth_texture, GL_SGIX_shadow
OpenGL limits:
    GL_MAX_ATTRIB_STACK_DEPTH = 16
    GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = 16
    GL_MAX_CLIP_PLANES = 6
    GL_MAX_COLOR_MATRIX_STACK_DEPTH = 2
    GL_MAX_ELEMENTS_VERTICES = 2147483647
    GL_MAX_ELEMENTS_INDICES = 2147483647
    GL_MAX_EVAL_ORDER = 8
    GL_MAX_LIGHTS = 8
    GL_MAX_LIST_NESTING = 64
    GL_MAX_MODELVIEW_STACK_DEPTH = 32
    GL_MAX_NAME_STACK_DEPTH = 128
    GL_MAX_PIXEL_MAP_TABLE = 65536
    GL_MAX_PROJECTION_STACK_DEPTH = 4
    GL_MAX_TEXTURE_STACK_DEPTH = 10
    GL_MAX_TEXTURE_SIZE = 4096
    GL_MAX_3D_TEXTURE_SIZE = 4096
    GL_MAX_VIEWPORT_DIMS = 4096, 4096
    GL_ALIASED_LINE_WIDTH_RANGE = 1, 10
    GL_SMOOTH_LINE_WIDTH_RANGE = 1, 10
    GL_ALIASED_POINT_SIZE_RANGE = 1, 63
    GL_SMOOTH_POINT_SIZE_RANGE = 1, 63
    GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 4096
    GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 3
    GL_MAX_TEXTURE_UNITS_ARB = 4
    GL_MAX_TEXTURE_LOD_BIAS_EXT = 15
    GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 15
    GL_MAX_DRAW_BUFFERS_ARB = 4
    GL_MAX_CONVOLUTION_WIDTH/HEIGHT = 11, 11
    GL_VERTEX_PROGRAM_ARB:
        GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 512
        GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 512
        GL_MAX_PROGRAM_TEMPORARIES_ARB = 48
        GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 48
        GL_MAX_PROGRAM_PARAMETERS_ARB = 256
        GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 256
        GL_MAX_PROGRAM_ATTRIBS_ARB = 16
        GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 16
        GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 2
        GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 2
        GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 256
        GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 256
        GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 512
        GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 512
        GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 512
        GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 512
        GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 512
        GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 512
    GL_FRAGMENT_PROGRAM_ARB:
        GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 4096
        GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 4096
        GL_MAX_PROGRAM_TEMPORARIES_ARB = 32
        GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 32
        GL_MAX_PROGRAM_PARAMETERS_ARB = 1024
        GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 1024
        GL_MAX_PROGRAM_ATTRIBS_ARB = 16
        GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 16
        GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 1
        GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 1
        GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 512
        GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 256
        GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 4096
        GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 4096
        GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 4096
        GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 4096
        GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 4096
        GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 4096

   visual  x  bf lv rg d st colorbuffer ax dp st accumbuffer  ms  cav
 id dep cl sp sz l  ci b ro  r  g  b  a bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------
0x2c 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x2d 24 tc  0 32  0 r  .  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0x2e 32 tc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 Ncon
0x2f 32 tc  0 32  0 r  .  .  8  8  8  8  0  0  0  0  0  0  0  0 0 Ncon
Here is the result for glxgears :

Code: Select all

root@renaud-desktop:~/Irrlicht/irrlicht_svn/examples/Demo# glxgears
11563 frames in 5.0 seconds = 2308.833 FPS
11792 frames in 5.0 seconds = 2356.040 FPS
11316 frames in 5.0 seconds = 2245.308 FPS
10732 frames in 5.1 seconds = 2110.156 FPS
X connection to :1.0 broken (explicit kill or server shutdown).
I guess I actually have 3D support enabled ? (I played some days ago to Planet Penguin Racer which is a 3D game. I did not get an explosive FPS, but it worked fine.

Is there any useful information in the "glxinfo -l" I posted ?

Thanks for your help,

Lideln
--
Lideln, France
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, 3d support seems to be hardware accelerated. The driver version output is strange, but probably typical NVidia style (Open GL 1.2 (2.0.2...))
The glxgears performance is really not mind blowing (I got about 15k on a NVidia 7800 Gsomething) but should be enough to get higher FPS. There had been several changes in the demo code recently, maybe something went wrong. All the other examples should also bring FPS of at least 50 with your card (e.g. terrain or specialFX).
And for the Q3 level: There are always warnings about missing textures, but it should display quite ok.
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post by Lideln »

Ok, but 6600 and 7800GT are not the same :lol:

With the example 07 (collision), I got between 8 and 15 FPS.
I guess there is a problem somewhere, in my global computer configuration (which is not very likely to be, since I got a quite good FPS with Pengui Racer), or with my Irrlicht configuration.

Do I have to do something more than just a "make" with the sources ?

I'll try to create a terrain map, display it and check the FPS, and I'll keep you informed.

If you have any idea meanwhile, I would be glad to "read" it and apply it :)

Thanks again, good night (3am)

Lideln
--
Lideln, France
kornerr
Posts: 245
Joined: Thu Jul 06, 2006 9:57 am
Location: Russia, Siberia, Kemerovo
Contact:

Post by kornerr »

Well, revision 194 works ok for me under linux, try that one :)
Open Source all the way, baby ;)
OSRPG
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

the Q3 map does not load correctly : it complains it cannot find some textures, although on Windows as far as I remember it worked correctly.
Also take into account that linux is very case sensitive. So if your apps crash because of missing textures check their names and extensions. Remember that "brick.jpg" and "brick.JPG" although being the same file are different in linux when you call them in your Irrlicht app. Either fix the filenames/extensions to match your program, or modify your code to match the name of the file. :wink:

Note: this doesn't occur in Windows, don't ask me why, but it just reads the files however they're typed.
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

Post by mandrav »

Post the output of "ldd executable_that_is_slow", without the quotes (e.g. ldd example).
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post by Lideln »

Hi !

Thanks all for your time and your replies.

I made a checkout yesterday at 10PM (I'm in Paris, France, so... 12 hours ago).
A "svn info" tells me it is the revison 247. Actually, I use the SVN version of Irrlicht because it is said to correct the NVidia issue that does not enable double buffering with OpenGL.

For the case sensitive "issue" of Linux, I am aware of that (and that's why I could correct the mistake of an Irrlicht developer who mistyped a file name to include).
Also, the textures names are in the .pk3, so I guess I cannot modify them.
Although, the map does display quite correctly but the display seems different from in Windows as far as I remember (it was far more "lighted" on Windows)

Mandrav, here is the output you asked (though after reading it I dunno what it is used for :shock: )

Code: Select all

root@renaud-desktop:~/Irrlicht/irrlicht_svn/examples/07.Collision# ldd ./example
        linux-gate.so.1 =>  (0xffffe000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0xb7f29000)
        libGLU.so.1 => /usr/lib/libGLU.so.1 (0xb7eb3000)
        libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0xb7ead000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0xb7ea0000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0xb7dba000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7ce5000)
        libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7cc3000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7cb9000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7b89000)
        libGLcore.so.1 => /usr/lib/libGLcore.so.1 (0xb73c7000)
        libnvidia-tls.so.1 => /usr/lib/tls/libnvidia-tls.so.1 (0xb73c5000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb73c2000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0xb73bf000)
        /lib/ld-linux.so.2 (0xb7fc1000)
Today I'll try to find a tutorial to display a terrain map and I'll tell you about the FPS, if it can help !

Thanks again,

Lideln
--
Lideln, France
mandrav
Posts: 117
Joined: Sat Aug 27, 2005 8:29 pm
Contact:

Post by mandrav »

Lideln wrote:Hi !
Mandrav, here is the output you asked (though after reading it I dunno what it is used for :shock: )
I just wanted to verify that you 're actually linking to the nvidia drivers and not mesa (software opengl library).
Everything seems correct though.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

This could be similar to the problem i had, albeit on windows. I found that on my PC my project worked very well, nice high framerate, then when i tried it on the Uni PCs... or my dad's PC it would run at 1fps... And even on my gfs laptop it had to take about a minute to warm up to 30fps but would dip below quite a lot.

I never found any reason for this or any solution. But not long ago someone on the Jirr forum (Java version of Irrlicht) posted a solution for their problems using it on Linux.

https://sourceforge.net/forum/forum.php ... _id=383520

Basically they think that when you select OpenGL, it doesn't load the drivers properly, apparently only on some PCs, and so you end up using bad drivers or software rendering or something which doesn't work very well!

This is how the guy preloaded the OpenGL drivers:
"LD_PRELOAD=/usr/lib/libGL.so.1:/usr/lib/libGLU.so.1 java -jar Game.jar"

You may be able to try something similar for your project in order to see if that's the problem.

I didn't know how to do anything like that on Windows but switching to DirectX9 worked for me!
Image Image Image
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post by Lideln »

Ok Mandrav, actually, I hope Irrlicht is NOT using the correct drivers because if this is the case... I will get desperate :(

JP, yes I was on Windows before, and it worked very nicely, but here...
Oh ! And I tried the tutorial on terrain rendering, I run at 8 FPS all the time, and there is a strange thing... When I start the app, the textures are awful ! Very "blured" (I hope this is the good word... I mean : not precise, not clear), and when I press "d" to toggle detail map, I get a single color map : everything is totally GRAY !

I guess I'll commit suicide (I'll try to run into your spiked head, it could do the trick lol). Your explanation about the issue gives me a hope, so I'll try to see if I can port it to non-java Irrlicht.
(I guess DirectX is not available in Linux, mmmmh ?)

Thanks for your answers, maybe an Irrlicht developer will understand the issue JP is talking about, and add more details on the way to fix it ?

Thanks again :)

Lideln
--
Lideln, France
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post by Lideln »

Here is a screenshot of what I get with the tutorial 12 (my first image upload, I hope it'll work fine)

[img=http://img176.imageshack.us/img176/2562/irrlichtopenglissuesw1.th.jpg]

The textures are ugly, and the framerate as well.

JP, I used the tip from the forum you told me about :

Code: Select all

root@renaud-desktop:~/Irrlicht/irrlicht_svn/Projects/TestIrrlichtTerrain# LD_PRELOAD=/usr/lib/libGL.so.1:/usr/lib/libGLU.so.1 ./example
But as you can see it is unfortunately the same result :(
--
Lideln, France
CuteAlien
Admin
Posts: 9696
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Lideln wrote: direct rendering: No
That's not hardware accelerated.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Argh, I just wondered about the low number of screens, but was too tired to really read the whole story. Ok, so you either use OpenGL via the network (remote X session) or you lack the kernel drivers necessary. Maybe your last kernel update messed up the kernel module for 3d rendering.
Post Reply