Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Special image loader

Author
Message
Mr Tank
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 30th Apr 2007 06:45
The reasoning behind this function is that large textures take a long time to load from .jpg, and fast loading formats (the quickest being .dds if i remember right) take up a lot of space, which is problematic if you want people to download and play your game.
The idea is that .jpg versions of textures are included in the game folder with the .exe.
The function checks to see if a dds texture of the filename requested is available- if the program is running for the first time there won't be so it loads the .jpg instead. The program then saves out a .dds version so it can load more quickly next time.
I find this useful because i have 1024x1024 textures that take about 3s to load in jpeg format. The .dds ones load in a fraction of this time.


SUPER BADASS SPACESHIP X: WEBSITE
FORUM TOPIC
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 30th Apr 2007 07:01
I believe png is the fastest, but this is a really good idea.
Mr Tank
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: United Kingdom
Posted: 3rd May 2007 05:45
Thanks dude. I'll have to check out png.

SUPER BADASS SPACESHIP X: WEBSITE
FORUM TOPIC
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 3rd May 2007 22:18
Quote: "I believe png is the fastest"

I'm pretty sure dds is the fastest format because it lets you make your own mipmaps. Thus, dbpro don't have to create them (with large images, there is a big difference on the loading time).
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 4th May 2007 17:55
But if u use the load image "palpal.png",num,1 then it doesnt create mip maps..


[B] - LINKIN PARK - [/B]
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 4th May 2007 20:07
Using textures without mipmaps is a really bad idea : rendering far objects will be as slow as rendering near objects (you'll easily see the difference using shaders), plus, your texture will flicker when moving the camera.

Login to post a reply

Server time is: 2024-11-22 18:50:34
Your offset time is: 2024-11-22 18:50:34