Hi,
I hit some problems with egg-palettize that I can’t figure out myself.
Basically, this is what I want to achieve:
I have a number of gui elements, which are textures that I turned into texture-cards. Most, if not all, of these textures have a non-power-of-two size and are pretty small, e.g. 11x11 pixels, 1x11 pixels, 11x1 pixels, etc. the biggest element so far is 47x47 pixels. (Hmm, the artist seems to like prime numbers…
Furthermore, all elements are .png files and all should have an alpha-channel. But to be sure I force-rgba them in the textures.txa to make it possible to place all textures into a single texture
So basically I thought I’d use egg-palettize to group them all together into a single texture.
Here’s my textures.txa:
:palette 512 512
:group misc dir textures
:imagetype .png
:shadowtype .png
Slot.egg : misc
WindowBagFrame.egg : misc
Window/FillBot.egg : misc
Window/FillLeftBot.egg : misc
Window/FillRightBot.egg : misc
Window/FillTop.egg : misc
Window/FillLeftTop.egg : misc
Window/FillRightTop.egg : misc
Window/FillLeft.egg : misc
Window/FillRight.egg : misc
Window/FillMid.egg : misc
Window/FrameBot.egg : misc
Window/FrameLeftBot.egg : misc
Window/FrameRightBot.egg : misc
Window/FrameTop.egg : misc
Window/FrameLeftTop.egg : misc
Window/FrameRightTop.egg : misc
Window/FrameLeft.egg : misc
Window/FrameRight.egg : misc
*.png : 100%
*.png : nearest
*.png : force-rgba
I then call egg-palettize as follows:
egg-palettize -inplace -opt Slot.egg WindowBagFrame.egg Window/FillBot.egg Window/FillLeftBot.egg Window/FillRightBot.egg Window/FillTop.egg Window/FillLeftTop.egg Window/FillRightTop.egg Window/FillLeft.egg Window/FillRight.egg Window/FillMid.egg Window/FrameBot.egg Window/FrameLeftBot.egg Window/FrameRightBot.egg Window/FrameTop.egg Window/FrameLeftTop.egg Window/FrameRightTop.egg Window/FrameLeft.egg Window/FrameRight.egg
and egg-palettize gives the following output:
textures.boo does not exist; starting palettization from scratch.
Reading Window/FillBot.png
Reading Window/FillLeft.png
Reading Window/FillLeftBot.png
Reading Window/FillLeftTop.png
Reading Window/FillMid.png
Reading Window/FillRight.png
Reading Window/FillRightBot.png
Reading Window/FillRightTop.png
Reading Window/FillTop.png
Reading Window/FrameBot.png
Reading Window/FrameLeft.png
Reading Window/FrameLeftBot.png
Reading Window/FrameLeftTop.png
Reading Window/FrameRight.png
Reading Window/FrameRightBot.png
Reading Window/FrameRightTop.png
Reading Window/FrameTop.png
Reading Slot.png
Reading WindowBagFrame.png
Resizing textures_palette_2tllc_1.png to 64 64
Generating new textures_palette_2tllc_1.png
Reading Window/FillLeftBot.png
Reading Window/FillLeftTop.png
Reading Window/FillRightBot.png
Reading Window/FillRightTop.png
Reading Window/FrameLeftBot.png
Reading Window/FrameLeftTop.png
Reading Window/FrameRightBot.png
Reading Window/FrameRightTop.png
Reading Window/FillBot.png
Reading Window/FrameTop.png
Reading Window/FillTop.png
Reading Window/FrameBot.png
Reading Window/FillLeft.png
Reading Window/FillRight.png
Reading Window/FrameLeft.png
Reading Window/FrameRight.png
Writing textures_palette_2tllc_1.png
Writing shadow/textures_palette_2tllc_1.png
Reading Window/FillMid.png
Writing FillMid.png
Reading Slot.png
Writing textures/Slot.png
Reading WindowBagFrame.png
Writing textures/WindowBagFrame.png
Writing Window/FillBot.egg
Writing Window/FillLeft.egg
Writing Window/FillLeftBot.egg
Writing Window/FillLeftTop.egg
Writing Window/FillMid.egg
Writing Window/FillRight.egg
Writing Window/FillRightBot.egg
Writing Window/FillRightTop.egg
Writing Window/FillTop.egg
Writing Window/FrameBot.egg
Writing Window/FrameLeft.egg
Writing Window/FrameLeftBot.egg
Writing Window/FrameLeftTop.egg
Writing Window/FrameRight.egg
Writing Window/FrameRightBot.egg
Writing Window/FrameRightTop.egg
Writing Window/FrameTop.egg
Writing Slot.egg
Writing WindowBagFrame.egg
So basically what happens is:
- I get one combined image (textures_palette_2tllc_1.png)
- Two textures are written to the textures folder: textures/WindowBagFrame.png and Writing textures/Slot.png
- All .egg files are modified to reference the new textures.
So now for my problems and oddities:
a) I do not understand why slot.png and WindowBagFrame.png are not combined with the other textures. That’s what I ultimately want to achieve.
WindowBagFrame.png is 47x47 pixels and thus the version in the install dir is 32x32. Similar for slot.png. It gets resized from 44x44 to 32x32.
But as I said, I’d like to have these textures (without resizing) in the palette image. That was one of the reasons why I want to used egg-palettize in the first place: to be able to combine non-power-of-two textures in a single power of two texture…
b) All the Window*.png graphics are combined in a single image but in a somewhat interesting way: the original images are 11x11 or 11x1 pixels in size and these get padded to 15x15 (!) images in the combined texture.
I’m wondering why egg-palettize wouldn’t simply pad my 47x47 images to 64x64…
c) In the modified .egg files I end up with absolute paths, e.g.:
<CoordinateSystem> { Y-Up }
<Comment> {
"egg-palettize -inplace -opt Slot.egg WindowBagFrame.egg Window/FillBot.egg Window/FillLeftBot.egg Window/FillRightBot.egg Window/FillTop.egg Window/FillLeftTop.egg Window/FillRightTop.egg Window/FillLeft.egg Window/FillRight.egg Window/FillMid.egg Window/FrameBot.egg Window/FrameLeftBot.egg Window/FrameRightBot.egg Window/FrameTop.egg Window/FrameLeftTop.egg Window/FrameRightTop.egg Window/FrameLeft.egg Window/FrameRight.egg"
}
<Comment> {
"egg-texture-cards -g 0,1,1,0 -w clamp -p 1,1 -o data/textures/gui/WindowBagFrame.egg data/textures/gui/WindowBagFrame.png"
}
<Texture> WindowBagFrame {
"/e/TeamVienna/landc/Development/trunk/data/textures/gui/textures/WindowBagFrame.png"
<Scalar> format { rgba }
<Scalar> wrap { clamp }
<Scalar> minfilter { linear }
<Scalar> magfilter { linear }
<Scalar> anisotropic-degree { 0 }
<Scalar> alpha { dual }
}
<Group> {
<VertexPool> vpool {
<Vertex> 0 {
0 0 0
<UV> { 0 1 }
}
<Vertex> 1 {
0 47 0
<UV> { 0 0 }
}
<Vertex> 2 {
47 47 0
<UV> { 1 0 }
}
<Vertex> 3 {
47 0 0
<UV> { 1 1 }
}
}
<Group> WindowBagFrame {
<Polygon> {
<RGBA> { 1 1 1 1 }
<TRef> { WindowBagFrame }
<VertexRef> { 0 1 2 3 <Ref> { vpool } }
}
}
}
How can I tell egg-palettize to use relative paths…?
Thanks in advance,
Erik