PDA

View Full Version : Sending .bmps to card directly



07-20-2003, 05:58 AM
Windows 2000/Delphi. I have a need to send many 100,000s of .BMP already stored on disk to the video card as fast as possible. Each .bmp is the same size (64k). With various techniques I have achieved 2400/s but am just using a simple Windows .bmp and displaying it. I am looking at OpenGL to try and improve the speed. I have downloaded all the relevant files but cannot see an API to simply send BMPs to the card. Can anyone help?

Richard Teller
rteller@doctors.org.uk

Rog
07-20-2003, 09:45 AM
OpenGL has no inbuilt support for bmps. With the requirement you describe, I'd be surprised if OpenGL can give you any better performance (I'll wait to be corrected on that one http://www.opengl.org/discussion_boards/ubb/smile.gif)

Have you considered pre-procesing your bmp's into a streaming format - maybe AVI if you're using Windows? Also look at the DrawDib library functions documented in MSDN. This is usually the fastest way to throw bits at the screen.


2400fps for 64K frames also means you're reading about 150 Meg per second from disk (if you're not caching somewhere). Maybe there are other bottlenecks? Are you using PCI or AGP graphics card? What spec is your machine?



[This message has been edited by Rog (edited 07-20-2003).]

nexusone
07-20-2003, 01:40 PM
I don't think any video card has support for direct copying of BMP to the video card not under openGL or under direct X.

The only way to store them in video memory would be as textures.
And maybe to reduce some overhead would be to convert the BMP files to a raw RGB format.
This way there would be no time used in converting the BMP to the internal format.

I know some cards support some type of texture compression, but I do not know the format.

07-20-2003, 07:50 PM
Many thanks for the help. Pre-processing sounds possible but it would have to be lossless compression and I think avi is lossy? I'll have a look at DrawDIB.

I have a high spec machine (2x3G processors, 3G RAM, GEF5 VidCard (AGP)) and the disk system is an 8x120GB array with a sort of RAID PCI card that can sustain 200MB/s (which I use for about 1 hour). Be grateful for any other thoughts.


Originally posted by Rog:
OpenGL has no inbuilt support for bmps. With the requirement you describe, I'd be surprised if OpenGL can give you any better performance (I'll wait to be corrected on that one http://www.opengl.org/discussion_boards/ubb/smile.gif)

Have you considered pre-procesing your bmp's into a streaming format - maybe AVI if you're using Windows? Also look at the DrawDib library functions documented in MSDN. This is usually the fastest way to throw bits at the screen.


2400fps for 64K frames also means you're reading about 150 Meg per second from disk (if you're not caching somewhere). Maybe there are other bottlenecks? Are you using PCI or AGP graphics card? What spec is your machine?



[This message has been edited by Rog (edited 07-20-2003).]

Rog
07-20-2003, 10:24 PM
Originally posted by richardteller:
2x3G processors, 3G RAM

Not short of ooomph then http://www.opengl.org/discussion_boards/ubb/wink.gif

You can choose to create an uncompressed AVI stream, which will be lossless. It would be interesting to see exactly where the bottlenecks are in this situation.

May not be my business, but what's the application for? Why the need for such a high frame rate http://www.opengl.org/discussion_boards/ubb/confused.gif

07-20-2003, 11:36 PM
Originally posted by Rog:
May not be my business, but what's the application for? Why the need for such a high frame rate http://www.opengl.org/discussion_boards/ubb/confused.gif
[/B]

Very strange client!! http://www.opengl.org/discussion_boards/ubb/cool.gif and http://www.opengl.org/discussion_boards/ubb/eek.gif

Rog
07-21-2003, 12:02 AM
Originally posted by richardteller:
Very strange client!! http://www.opengl.org/discussion_boards/ubb/cool.gif and http://www.opengl.org/discussion_boards/ubb/eek.gif

Cool. How do get into interesting stuff like that? If you're in the UK and need a hand, just let me know! I have plenty of years Delphi experience too.... http://www.opengl.org/discussion_boards/ubb/biggrin.gif

BTW, I guess you don't actually get to see all these images (unless you have a pretty fast refresh rate!) - don't blink eh http://www.opengl.org/discussion_boards/ubb/wink.gif

Jan
07-21-2003, 10:16 AM
That compressed texture-format is DXTC ("Direct X Texture Compression). It is possible to give a card data in that compressed format directly. There is a (new) file-format, *.dds files, which can store data compressed in that format.
However i think DXTC is not a lossless compression, but then there are different DXTC compression methods.
Search nVidias homepage, they have examples for this (and a Photoshop plugin for DDS files).

Jan.