Kodi Community Forum

Full Version: XBMCTex - The Textures.xpr Generator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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
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.
is textures.xpr and the current images in cvs also updated for this effect?
yes, textures.xpr in cvs is updated
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 :d
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
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?
considering most big ui elements are already unloaded when you go fullscreen, im gonna walk out on a limb and say:

no
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.
yes, i would say so
since i wasted a few hours on it, i figured i ought to post it somewhere to save others the trouble. i wrote a windows batch script which simplified building xpr files, especially themes.
you put the bat file & the xbmctex.exe together in a directory. you can then drag subdirectories in that location onto the bat file and xbmctex will build xprs with the same name as those directories.
example of usage:
i have a "themes" folder where i put the stuff i'm working on.
directory structure looks like this:
<themes>
<themes>\batch.bat
<themes>\xbmctex.exe
say i'm working on a v for vendetta theme. i would put all the files i want that theme to include in a subdirectory:
<themes>\vforvendetta\graphics *.png
then to build the xpr, i simply drag & drop that directory onto the bat file and it'll spit out a vforvendetta.xpr file in the same directory xbmctex.exe is located in.
it has a fork which looks for and deletes the file to be created if it already exists. it's intended to make developing themes a little easier.
Quote:@echo off
set startdir=%cd%
set target=%1
chdir /d %target%
for %%* in (%target%) do set mydir=%%~n*
if not defined mydir set mydir=%cd:\=%
cd..
if exist %mydir%.xpr echo file %mydir%.xpr already exists, deleting old copy...
if exist %mydir%.xpr del /f /q %mydir%.xpr
echo.
xbmctex.exe -input %mydir% -quality max -output %mydir%.xpr
pause
Quote: -input <dir> Input directory. Default: current dir
-output <dir> Output directory/filename. Default: Textures.xpr
-quality <qual> Quality setting (min, low, normal, high, max). Default: normal

can i set different quality for subdirectories to build one xpr file?
i try to make my own theme with not so big texture.xpr file

directory structure
\skinmedia\graphics *.png
\multiimage\4x3home-myprograms\graphics *.png
\multiimage\4x3home-mymusic\graphics *.png
.
.
\splash\animation\graphics *.png


this is my out of order .bat file

@echo off
xbmctex -input "skinmedia" -quality max -input "multiimage" -quality min -input "splash" -quality normal -output "new"
wtfHuhHuh?
Has anyone tried building textures.xpr using XBMCTex while in a remote desktop session?
I've a feeling that is the cause of the below error, but I could be wrong.

I'm fairly sure It worked the first time I did it (when I was at the machine)
I needed to do another build and kicked it off remotely, and got the below error.
I'll try another local build tonight when I can get to the machine.

Thanks for any help.
J

Code:
Copying files...
'xbepatch.exe' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the file specified.
        1 file(s) copied.
19 File(s) copied
*.xml
The system cannot find the file specified.
        0 file(s) copied.
Changelog.txt
copying.txt
keymapping.txt
        3 file(s) copied.
----------------------------------------
Creating Project Mayhem III Build Folder
The system cannot find the file specified.
----------------------------------------
Creating XPR File...
Cannot init D3D device: 8876086a
----------------------------------------
Copying XPR File...
File not found - Textures.xpr
0 File(s) copied
----------------------------------------
Cleaning Up...
Could Not Find D:\Projects\XBMCDBR\XBMCDBR\bin\Debug\XBMC\skin\Project Mayhem
I\media\Textures.xpr
----------------------------------------
XPR Texture Files Created...
Building Skin Directory...
4 File(s) copied
4 File(s) copied
20 File(s) copied
5 File(s) copied
5 File(s) copied
73 File(s) copied
30 File(s) copied
8 File(s) copied
skin.xml
        1 file(s) copied.
Changelog_PM.txt
        1 file(s) copied.
----------------------------------------
Pages: 1 2