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.

DarkBASIC Professional Discussion / All about textures

Author
Message
Disrupter52
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 7th Sep 2011 23:16
I know the answers are out there, but all my searches have failed me.

So!

What is the best format for textures for dbpro?(.bmp i wanna say...)

How many textures can dbpro handle for a game?

Is there a size limit on textures and what is it? (256x256, 512x512 etc)

This is solely regarding 3d objects and models and the textures they require.

Thanks
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 7th Sep 2011 23:33 Edited at: 7th Sep 2011 23:35
jpg, and PNG also make good textures, and use less memory than bmp.

The number of textures is all down to how much memory your computer has.

Don't know if there's a size limit, but best to make them match the pixels of your resolution. Then they look better with no scaling. If you have a GUI on a 1024,768 screen, make the GUI with Photoshop set to 1024,768. The GUI will then pixel match the screen. Then just copy paste the GUI to a 1024, GUI height screen.

david w
20
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 7th Sep 2011 23:35
DBP can load .png and .dds (dds is directx native, however there are many versions of dds now.) is the fastest. Obviously with these formats you can have an additional alpha channel, also .tga supports alpha. Alpha is generally used for fades/transitions, blending, Cut-outs, and to store any other additional info you may desire, such as specular information.

There is not really a best format to use, in the end its really up to what you want and how you want to handle your media. BMP is probably the largest but has great compatability with many programs, JPG is good but can have image loss due to compression. If you want to go with loading speed .png or .dds, if you want to pay attention to your total package's file sizes you may want to look into other formats.

Once an image is loaded and in memory there is not any speed advantage associated with any format because they are all coverted to a directx native format interally anyways. However there are flags you can use that can change the way directx handles those textures. Obviously a smaller texture will load faster, and take up less graphics memory. I think you can load up practically any size image you wish, again this is going to be dependant upon your graphics hardware and to a certian extent your system. Higher quality means more memory and load time, simply because the file is larger.

It doesn't really matter if you take is infomation in regards to 2d or 3d the underlying code is the same.
WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 8th Sep 2011 02:17
.jpg if your're just using a large image (compression too)
.png if you have you're own transparency

(Well that's my opinion for 3d images and DBPro, when it comes to 2D, sowwy)

Warning! May contain Nuts!
Disrupter52
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 8th Sep 2011 03:22
Ok thanks everyone.

I would have to guess that if i made everything at a higher resolution, then it would be no big deal to have my games run at smaller ones. Just because you can scale down and lose info, but you cant scale up and gain it from no where.

That being said, i like to work at my monitor's resolution, which is 1920x1080, which i know not a lot of people have, but its still fairly high quality. The other side to that is that fairly high quality is also more intensive.

Thanks for the other info about formats and such too, quite helpful. Time to mess around with different texture sizes!
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 8th Sep 2011 04:00 Edited at: 8th Sep 2011 04:02
Oh by the way, textures are square, so put as much on them as you can. Fill the gaps up with another model or something like that. They don't have to be square, but most of the time a program will complain if they aren't.

david w
20
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 8th Sep 2011 06:20
I believe they get squared by directx anyways.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 8th Sep 2011 15:39
Is that wasteful of memory?

david w
20
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 11th Sep 2011 04:56
I don't think it really is. It all depends upon how the pointers to the textures are handled internally. I think it takes up slightly more memory but also the trade off is you are dealing with powers of 2 instead some-other-ratio. Directx is probably optimized around this, so the speed gain is probably worth the small memory footprint increase. You have to take into consideration the generation and use of mipmaps internally when you discuss this. ratios: 1x1 - 2x2 - 3x3 - 4x4 .... until you hit the root size. So when an image is loaded there is really a stack of images that get created, which is another advantage of the .dds format, you can pre-pack all the mip map levels.

Login to post a reply

Server time is: 2026-07-11 14:36:54
Your offset time is: 2026-07-11 14:36:54