XBMCTex - The Textures.xpr Generator

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
jmarshall Offline
Team-XBMC Developer
Posts: 24,523
Joined: Oct 2003
Reputation: 138
Post: #1
hi all,

i've just committed support for non-swizzled 32 bit textures in xbmc.

this includes a new xbmctex version which enables this by default (it can be disabled using the -onlyswizzled command line switch).

swizzled textures have to have each dimension a power of 2, which means that much of the ram taken up while in xbmc is wasted space - not efficient. they are, however, quicker to render which ofcourse is a bonus.

unswizzled textures just have to have their width a multiple of 64 pixels. this is a much less stringent requirement, thus less wasted space.

for comparison: in pm3, the old version of xbmctex produced a textures.xpr file whose textures were on average 46% wasted space.

the new version produces on average just 9.5% of wasted space.

this translates to 5.5mb of ram saved while in the pm3 home page.

one thing to note is that textures.xpr produced with the new xbmctex version will not work with older versions of xbmc.

a couple of other suggestions for saving ram:

1. keep wasted (transparent) space around images to a minimum. try and keep images inside the nearest power of 2, but if this is not possible, just try and keep within a 64 pixel width constraint.

2. if images do not change much (ie constant colour, or constant vertical gradient etc.) then consider breaking the bits up that don't follow the same pattern and use a small texture for the patterned piece (eg a vertical gradient can be done with a texture 1 pixel wide, stretched as far as you like horizontally).

hope these help.

cheers,
jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
Smokehead Offline
Skilled Skinner
Posts: 168
Joined: Sep 2005
Reputation: 0
Location: Area 51
Post: #2
thanks for making this possible :thumbsup:

i guess going from 46% waste to 9.5% is pretty astonishing, and very efficient.. loads of respect for that m8. i tried it on my skin and it saves me 1mb on *.xpr filesize and about 3mb's for home page only, but i allready did some small optimization on the images, but the result is still impressive.
find quote
HarshReality Offline
Posting Freak
Posts: 1,557
Joined: Jan 2005
Reputation: 0
Post: #3
is textures.xpr and the current images in cvs also updated for this effect?

[Image: x3.jpg]
find quote
pike Offline
Project Manager
Posts: 4,820
Joined: Sep 2003
Reputation: 28
Location: Sweden
Post: #4
yes, textures.xpr in cvs is updated

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
HarshReality Offline
Posting Freak
Posts: 1,557
Joined: Jan 2005
Reputation: 0
Post: #5
kewl, just did a build of the tool and ran it locally on the existing images so i will asume by the results not all the current imagery has been adjusted to make use of this as yet (some of the home images still show 60% wasted space). but the xpr file is still @ 2 meg smaller Big Grin

[Image: x3.jpg]
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,523
Joined: Oct 2003
Reputation: 138
Post: #6
if you run the current version of xbmctex on the pm3 media folder, then the average wasted space is 9.5%.

note that if a particular image is specifying a lot of wasted space, it's probably due to it using one of the compressed texture formats, which at worse are 8bits/pixel (ie 4 times smaller anyway than uncompressed). so the "waste" that you see, is only in terms of pixels, not in terms of memory.

cheers,
jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
ashlar Offline
Member+
Posts: 2,048
Joined: Mar 2006
Reputation: 26
Post: #7
while much of this flies straight over my head, this new development saves memory for all purposes or only while in the gui? is this memory save something that frees more memory while playing videos as well?

For troubleshooting and bug reporting please make sure you read this first.
find quote
pike Offline
Project Manager
Posts: 4,820
Joined: Sep 2003
Reputation: 28
Location: Sweden
Post: #8
considering most big ui elements are already unloaded when you go fullscreen, im gonna walk out on a limb and say:

no

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
SleepyP Offline
Posting Freak
Posts: 2,282
Joined: Nov 2005
Reputation: 4
Location: Portland, Oregon
Post: #9
is it safe to assume that the xbmctex.rar file over on the 'official' ftp server (where t3ch's builds are found) is a relatively current binary? the file attributes say it was last modified 4/21/06. i plan on getting into screwing around with skinning, so i knew i'd need to get xbmctex. i already checked out a copy of all the current resources from the cvs (to get the uncompressed pmiii files), but i don't want mess with finding the xdk just so i can build my own copy of xbmctex.

Catchy Signature Here
find quote
pike Offline
Project Manager
Posts: 4,820
Joined: Sep 2003
Reputation: 28
Location: Sweden
Post: #10
yes, i would say so

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
Post Reply