Archived

This topic is now archived and is closed to further replies.

Why is this so slow?

This topic is 5583 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was working on getting some image handling code working when I realized that the framerates I was getting, doing almost nothing, were terrible. All I do each frame is draw 2 256x256 bitmaps at 2 spots on the screen, here is the code: glRasterPos2f(-.5,-.5); glDrawPixels(m_Image.Width(), m_Image.Height(), m_Image.Format (), GL_UNSIGNED_BYTE, m_Image.Data()); glRasterPos2f(0, 0); glDrawPixels(m_Image2.Width(), m_Image2.Height(), m_Image2.Format(), GL_UNSIGNED_BYTE, m_Image2.Data()); I''m only getting 7-8 FPS. Awful! My profiling (done with a code profiler from Game Gems) shows that 70% of the time is spent on that code. My computer isn''t to0 great (500 mhz, ATI Rage Pro 2mb) but it can do A HECK OF A LOT MORE than draw to images in 120 ms. What could I be doing to make this so slow?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
The problem is your card. That model has terrible support
for opengl. I would advice you to upgrade to a better card.
You can find gf2mx cards for very cheap prices.

Share this post


Link to post
Share on other sites
I know my card is bad, but its not THIS bad. Putting 2 bitmaps on screen should take almost no time. Something I am doing is causing it to take more time than rendering 150 tris. What the heck is going on here?

Share this post


Link to post
Share on other sites
It does seem weird, it could just be that the drivers are not very optimized (or it hurts the hardware) when changing the raster pos directly, maybe you''d be better rendering the two bitmaps as quads and seeing if that gives a speed up.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Don''t do it with glDrawPixels use texture maps instead.

Share this post


Link to post
Share on other sites
quote:
Original post by DanG
(500 mhz, ATI Rage Pro 2mb


What resolution and color depth are you running at? With the 2 256x256 bitmaps it may simply be too large to fit in video memory, resulting in slow tranfer (I''m assuming its a PCI card since its only 2MB). The point about OpenGL is true too, early ATI cards where not the best for OpenGL (I get similar slowdowns on an ATI Expert@Play 98 Rage Pro 8MB)

Share this post


Link to post
Share on other sites
AP is right. Load images as textures and draw 2 quads and it should be much faster.
Michalson : He''s not even using textures. He''s pulling data from system RAM every frame.

You should never let your fears become the boundaries of your dreams.

Share this post


Link to post
Share on other sites
I changed to 2 texture mapped quads, now the FPS is 10. Not much better. The image uses the Alpha channel and I have blending enabled, could that be a big slow down? I checked size, and it should fit in texture memory (512 kb). Any other ideas?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Trust me on this one. I have been coding gl on that very card model. It truly is slow and there is no GL support. Only software, that is the source of your troubles.
You really do need a better card.

Share this post


Link to post
Share on other sites
The (other?) AP is right - glDrawPixels is very slow. You need to use textured quads (or preferably triangles). Since you've done this the only other thing I can suggest is to either use a better card or disable as many 3D pipeline features as possible.


Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions


[edited by - siaspete on August 30, 2002 7:00:36 PM]

Share this post


Link to post
Share on other sites
A bit more explaination of previous posts...

The card is capable of pushing a lot more polygons than you are seeing, but if the card doesn''t support OpenGL, the OpenGL implementation probably reverts to a software renderer. (I am not 100% sure if OpenGL does this... I know DirectX reverts to the Hardware Emulation Layer when a feature is not supported in the card.)

And a software renderer is sloooooowww.... I have a 1.2Ghz Athlon and Geforce2 and I usually see a frame rate drop anywhere from 5 to 200 times when I''m running using a software renderer, depending what I''m doing. Software renderers also depend on your CPU speed and your CPU is slow. Thats my guess about what is happening.

Btw, if your card has crappy support for OpenGL, it probably has reasonably good DX support. A lot of the old old cards supported either DX or OpenGL, and a few supported both. The new cards all support both APIs.

Share this post


Link to post
Share on other sites
Oh, btw, you might want to try switching off alpha... your card is so old, it might not support alpha blending in hardware.

Good luck

Share this post


Link to post
Share on other sites