Archived

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

Best/Fastest graphical file types

This topic is 5669 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 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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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 ]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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 ::...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
BTW. why would you make a sandwich in the bathroom?
silvermace ..:: SiLv3RMaC3 ::..

Share this post


Link to post
Share on other sites
lol

-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack

Share this post


Link to post
Share on other sites
umm, it aint the video card. its clearly his code, unless the voodoo cards i have access to have a special make "things run fast patch" applied.

i draw a entire screen at over 80 frames per second using over 64 different tiles (naturally stored in a single texture, not mulitple textures).

i think you should either post some drawing code, or give some numbers on how much you are drawing.

try understanding what is happening instead of cut and pasting from a "tutorial". texture switches are slow.

EDIT: let me reprhase that. texture switches may be slow depending on things like whether all the textures fit in vram.

[edited by - a person on June 5, 2002 4:40:41 AM]

Share this post


Link to post
Share on other sites
I as a matter of fact have been loading multiple textures instead of just one. BTW, I didn''t copy/paste anything from a tutorial, it was all stuff I figured out or learned from gametutorials.com (I have like their SetUpPixelFormat function and stuff, but I actually took the time to go on MSDN and learn, or try to learn anyways, all the data members of the pixelformatdescriptor strucs and stuff, so none of it was simple copy paste). My code is probably bad. Ill post it later when I get home. Thanks.

Share this post


Link to post
Share on other sites