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 / Image size 512x256 vs 512x512

Author
Message
Juso
22
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 10th Oct 2008 09:30
Does image size 512 x 256 take texture memory as much as 512 x 512 or only half of it? I have nearly 100 textures in my 'game' so this is quit significant. Now fps varies between 20..60 when removing/adding only one or two large textures.
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Oct 2008 10:15 Edited at: 10th Oct 2008 10:15
It should take only half on modern cards. Some older, or less-featured cards can only deal with square textures, so the memory requirements would be the same and you might get some odd effects.

So it's up to you whether you need to support older hardware.

Juso
22
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 10th Oct 2008 11:56 Edited at: 10th Oct 2008 11:56
OK, but what if texture is 400 x 400, does it always expand to 512 x 512 ?

And what if it is 50 x 400 ?
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Oct 2008 12:54
It's all according to your graphics card and your drivers - take a look at the spec on it on the manufacturers site.

Some older cards will insist on a square texture. Others will insist on rounding up to a power of 2. Others could just round up to a multiple of 4.

Only the card specs will tell you.

Virtual Nomad
Moderator
19
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 10th Oct 2008 21:02 Edited at: 10th Oct 2008 21:08
check the Basic3D commands under "Availability Expressions" (at the bottom). some commands there will help:

NONPOWTEXTURES AVAILABLE()
ONLYSQUARETEXTURES AVAILABLE()

etc

my system is pretty old (see sig for specs) and it supports non-power of 2 textures and non-square textures, so that's probably not the issue (eating up more memory than you think it should). it's more likely that you're just using too many resources at once and need to consider ways to manage what's available. 100 textures is a lot... i'd assume that the FPS hit comes from windows using swap files for the overflow(could be wrong here). you might consider, for example, where you can use 256x256 textures vs 512x512 ones since they require ~1/4 the memory, for starters, and go from there.

hope this helps. good luck

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP
Juso
22
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 11th Oct 2008 14:48
Thanks
I remembered that there is or was also a command something like texturememory available(), but it may not work correctly anymore ?

Login to post a reply

Server time is: 2025-06-15 12:12:12
Your offset time is: 2025-06-15 12:12:12