Power of two image. Incorrect packaging.
by Dmitriy Stukalov · in Torque Game Builder · 10/26/2007 (5:53 am) · 7 replies
Hello,
There is power of 2 image in my project (128x64 pixels).
I'm going to explain how my textures will packed with TGB by the code bellow
The image has been resized to 128x256 pixels!!!
I use a CELL image mode with a 64x64 cell size.
What's wrong?
Thank you.
EDIT: Incorrect URL
There is power of 2 image in my project (128x64 pixels).
I'm going to explain how my textures will packed with TGB by the code bellow$pref::T2D::imageMapDumpTextures = 1; $pref::T2D::imageMapShowPacking = 1;I will surprised with a result I've found in the "imageMapDump" directory.
The image has been resized to 128x256 pixels!!!I use a CELL image mode with a 64x64 cell size.
What's wrong?
Thank you.
EDIT: Incorrect URL
#2
10/26/2007 (9:26 pm)
Thats why sometimes its recommended to NOT use padding... i dont use it if my images sizes are exact powers of two... if they're not, then i dont mind.
#3
As Ehrlichmann mentions, just turn off padding for that image and you should be fine.
10/26/2007 (9:34 pm)
As far as I am aware (I've not looked at the code, but I remember this from a conversation), the reason for the extra couple of pixels is to make sure that the texture is ready for mip-mapping (which can be an issue if you have color pixels on the very edge of your image), so it goes ahead and trades image "safety/accuracy" for size.As Ehrlichmann mentions, just turn off padding for that image and you should be fine.
#4
I've turned off padding for all my CELL images and now ImageMap dumps are OK.
Thank you!
10/26/2007 (11:52 pm)
Thank you guys!I've turned off padding for all my CELL images and now ImageMap dumps are OK.
Thank you!
#5
10/27/2007 (11:33 am)
But if you turn it off you'll have glitches on the border of the image map, most of the time.
#6
10/28/2007 (12:47 am)
Unless the artist properly plans for the mipmapping process, meaning that they don't draw on the very edges of the image.
#7
10/28/2007 (10:41 pm)
Quote:Thank you for your mention Benjamen. I remember this issue pretty well. As you can see there is a free space between painting area and image edges.
But if you turn it off you'll have glitches on the border of the image map, most of the time.
Torque Owner DragonSix