2

I installed linux (Debian) on an old laptop and have been writing an OpenGL application with it. The framerate cruises at about 80fps when drawing a texture on a small portion of the screen. When I draw the texture on a bigger and bigger portion of the screen, the framerate drastically drops. A full-screen texture drops the fps to 12.

I know the hardware is capable of rendering at a faster rate. Even if openGL was running in software mode.. that still seems pretty slow.

Any ideas on how to diagnose this?

Things I've tried:

  • glxinfo has let me know the laptop is capable of hardware acceleration opengl rendering. While I'm not positive it isn't running in software, I'm fairly sure the laptop is setup to run in hardware opengl.

  • I ditched the depth buffer and am only requesting a 24bit screen buffer in a resolution the laptop supports. (With a backbuffer still).

  • Switching from GL_TEXTURE_MIN_FILTER, GL_LINEAR to GL_TEXTURE_MIN_FILTER, GL_NEAREST bought me back some frames, but it's hovering at slightly over 20fps, which is still too slow.

  • I've switched from glShadeModel( GL_SMOOTH ) to glShadeModel( GL_FLAT ). I've gotten no speed up.

  • I've tried rendering the texture as a vertexpointer and as a glBegin( GL_QUADS ) call.

genpfault
  • 51,148
  • 11
  • 85
  • 139
William S
  • 54
  • 4
  • How big is the texture? Are you drawing 1:1 between texels and pixels? You're not re-uploading the texture data on every frame, right? Is your texture color format compatible with the context's pixel format? How many FPS does full-screen `glxgears` deliver on your hardware? Have you tried a 32-bit screen buffer, on some hardware that actually faster? – Ben Voigt Jun 04 '11 at 05:29
  • The textures is 512x512 (I've tried 256x256 too) and it's blitting to the screen resolution of 800x600. glxgears runs at about 203 fps on the laptop. Let me get you more info on the other questions, but I am fairly certain I'm not uploading the texture data every frame (I only call the bind function every frame), and the texture and context are both GL_RGBA with unsigned byte. – William S Jun 04 '11 at 05:43

1 Answers1

0

If switching from BILINEAR (GL_LINEAR) to NEAREST makes the framerate better, you are definitely running software renderer.

Please do this, from the command line (this is from my OSX, but should be similar on linux):

# glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce 8600M GT OpenGL Engine
OpenGL version string: 2.1 NVIDIA-1.6.26
OpenGL shading language version string: 1.20
OpenGL extensions:
malkia
  • 1,389
  • 13
  • 12
  • # glxinfo | grep OpenGL

    OpenGL vendor string: Mesa Project[br] OpenGL renderer string: Software Rasterizer[br] OpenGL version string: 2.1 Mesa 7.7.1[br] OpenGL shading language version string: 1.20[br] OpenGL extensions:[br] Wow, ok, it looks like it is using software. I saw the "direct rendering: Yes" and assumed that was the code for hardware. I will investigate getting OpenGL hardware running further.

    – William S Jun 04 '11 at 05:44
  • Sorry about the random tags there, I'm trying to figure out how to newline to make that more readable. – William S Jun 04 '11 at 05:49
  • As it turns out, the laptop has an intel vid card whose latest driver has a "shadow" option on by default, which forces software rendering. Turning that off gets hardware rendering and framerate back, but does not allow me to have offscreen buffers. That is a separate issue though, thanks everyone for their help. – William S Jun 04 '11 at 07:51