Texture atlas generator

User contributed sources that have become inactive, deprecated, or generally unusable. But ... we don't really want to throw them away either.
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Texture atlas generator

Post by relsoft »

Texture atlas generator(makes memory usage lower):
Based on this: http://www.blackpawn.com/texts/lightmaps/default.html

DL
http://rel.betterwebber.com/junk.php?id=106

Screen:
Image

Update ver 0.5

* Added ability to set margins between sprites
* New VB6 based GUI (no choice here since it's the only RAD tool this laptop has)
* Added an ability to choose images folder in the GUI


Update ver 0.4:

* Added PNG support (both for loading and saving)
* Can now combine BMPs and/or PNGs in the images folder.

What this does is pack a bunch of multiple textures to fit on a single large texture using the minimum area.

Implications of this are:

Faster rendering (less binding of textures)
Low memory usage
Can use differently-sized sprites

So far this is only beta since I coded this primarily for my DS game:
Image
DL:
http://rel.betterwebber.com/junk.php?id=101


*Source is included for anyone's perusal.
Last edited by relsoft on Jul 16, 2012 8:58, edited 2 times in total.
agamemnus
Posts: 1842
Joined: Jun 02, 2005 4:48

Post by agamemnus »

Add a license in too! ("public domain"??)
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Post by dkl »

Cool!
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Post by relsoft »

License is "use or abuse"

;*)
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Post by relsoft »

Update:

http://rel.betterwebber.com/junk.php?id=106

Changes:

Multiple images support
Instructions on how to use (readme.txt)
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Post by relsoft »

Update:

Someone emailed me that the index file it spits out makes it hard to find index numbers. So here's a version with a linear index file.

http://rel.betterwebber.com/junk.php?id=106
agamemnus
Posts: 1842
Joined: Jun 02, 2005 4:48

Post by agamemnus »

Why is this method better or faster than individual textures?

Also, how does it reduce memory usage?
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Post by relsoft »

agamemnus wrote:Why is this method better or faster than individual textures?

Also, how does it reduce memory usage?
1.
Any opengl coder knows that binding individual textures are sloooooow.
2.
It optimizes usage of your megatexture.
agamemnus
Posts: 1842
Joined: Jun 02, 2005 4:48

Post by agamemnus »

relsoft wrote:
agamemnus wrote:Why is this method better or faster than individual textures?

Also, how does it reduce memory usage?
1.
Any opengl coder knows that binding individual textures are sloooooow.
2.
It optimizes usage of your megatexture.
I'm not convinced at all. :D

I don't have a megatexture...
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Post by relsoft »

agamemnus
Posts: 1842
Joined: Jun 02, 2005 4:48

Post by agamemnus »

Well, I see.

So, this is good for:
* If you are constantly changing the texture material parameters.
* If you are assuming the graphics card can't use non-power of two textures...

Otherwise... I'd rather do it the "easy" way. Though, I do see a possible impact on mipmap drawing, maybe...
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Post by relsoft »

The card supporting non-pow of 2 textures is a non issue. It's the texture binding that makes stuff slow, so the less stuff to bind the faster your engine. Also professional engines like unity3d uses the same exact algo to optimize textures.

Re: mipmapping. With mipmapping enabled, this system is actually not suited. Unless I make it so that they are well spaced. Like having a 2-5 pixel boundaries or textures would "bleed".

One of the uses of this is when you make an opengl 2d engine where sprites are textured quads.
agamemnus
Posts: 1842
Joined: Jun 02, 2005 4:48

Post by agamemnus »

Good point about the mipmaps..

What exactly do you mean by texture binding? Do you mean like when the materials changing all at the same time is discussed?
relsoft
Posts: 1767
Joined: May 27, 2005 10:34
Location: Philippines
Contact:

Post by relsoft »

Texture binding is when you change textures aka glBindTexture().
agamemnus
Posts: 1842
Joined: Jun 02, 2005 4:48

Post by agamemnus »

Ah, I see.. I've gotten away from the base openGL commands so I didn't really know straight away.
Post Reply