Best/Fastest graphical file types

Started by
11 comments, last by xg0blin 21 years, 10 months ago
I made a little tile engine, where I read in a bunch of 1''s and 0''s and whatnot from a file, and according to what''s where in your array, it draws a 32x32 tiled block in that spot. My problem is, the program runs really, really fast when I don''t have the textures on it, but as soon as I texture my quads, it slows to a crawl. Between scrolling a half an inch, I can go to the bathroom, make a sandwich, and watch a couple of tv shows. It isn''t my computer, because I can run regular games, like dungeon siege and such. It''s just a bunch of damned squares, why would it be so slow? I''m using .BMP files. Is there a faster way to go about this? BTW, I''m also using glaux and auxRGBimagerec whatever. Any ideas?
Advertisement
You might have hardware incompatibilities. How big are your textures? What texture parameters are you using? What video card do you have? Is NeHe''s texturing code also slow?
---visit #directxdev on afternet <- not just for directx, despite the name
Are you loading the texture files each frame ????? Keep them in memory ! Once the data is decoded and in memory the file format you used is irrelevant.

BTW: glaux is deprecated.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]


[edited by - Fruny on June 3, 2002 6:04:15 PM]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
I have a voodoo 4 vid card, my textures are 32 x 32 bmp''s, I''m in 1024 x 768 resolution, although it''s not much help to go lower. I haven''t tried nehe''s code, I have been using the stuff off of gametutorials.com
No, I''m not loading them each frame, I have an init function that loads them when the program starts, before anything is ever displayed, and a deinit that destroys them at the end of the program
quote:Original post by xg0blin
No, I''m not loading them each frame, I have an init function that loads them when the program starts, before anything is ever displayed, and a deinit that destroys them at the end of the program


Therefore the file type is irrelevant.

Are you recreating the textures each frame ? (glTexImage)
Do you have one texture per tile, or one large texture, with individual tile textures defined by the coordinates used ?
In the former case, are you grouping the tiles by texture to minimize the number of texture switches ?

And glaux is still deprecated


Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
This isn''t exactly help for your problem, but if you want an easy way to load image files (so you can get rid of glaux and get Fruny of your back ) check out DevIL.
quote:Original post by Dactylos
..so you can get rid of glaux...

... which is de-pre-ca-ted

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
how many tiles are you using?
you might wanna try some clipping if you know what i mean
and you say quads ? use TriStrips (much faster).

check for any expensive gl calls as well, like glTexImage2d
or glReadPixels, a particularly tricky bitch is the glBindTexture
you might want to sort your tiles according to texture, eg.

1 = grass, 2 = dirt, map = 1121211122212122, try a bubble sort algo so it comes out to #11111111#22222222 where ''#'' is glBindTexture (this can speed things up sooooo much it aint funny).

also if your using multitextureing (standard) watch out for glDepthMask and glDepthTest, or look into the GL_ARB_multitexture extension which is heavly supported.

BTW, get a new Vid Card, V4500 sux0rs, GFx ///aLL^tHe^MuTH*R^F*CkN^WhEy^bIArTcH///*

hope this helps,
silvermace ..:: SiLV3rMaC3 ::...
BTW. why would you make a sandwich in the bathroom?
silvermace ..:: SiLv3RMaC3 ::..

This topic is closed to new replies.

Advertisement