Automatic texture atlas generation

Started by
6 comments, last by jsg007 16 years, 2 months ago
Hi everyone! What I am planning to do is to create a scene in a model editor, (some closed room, for example) then take that scene and paint the surfaces with a virtual brush in my program. So I'm looking for a technique wich would tranform all the textures in that scene into one big texture, so every texel in the scene would be unique ... (as far I know this is called "automatic texture atlas generation") Can anybody point me to some articles (or source code!) wich deal with this problem?
Advertisement
it looks similar to lightmapping. maybe if you searched how are texture coordinates changed or whatever when placing lightmap.

also you could use very small resolution of this painting map, as in texture splatting(or lightmapping). texture filtering will hide jagges.
yeah, it's something like a big lightmap texture, but how do I generate the texture coordinates?
I've come across one thing you might want to take a look at. I can't speak to the efficiency of the code or anything, but you could check out the lightmap packing code from Paul Nettle's FSRad (here).

Click on "Code," and it should be the first page that comes up. Click the image to download the source code. Alternatively, here's a direct link to the code: http://www.paulnettle.com/pub/FluidStudios/Radiosity/FSRad-004.zip

I also remember seeing this article while looking for something the other day; maybe worth investigating, but I haven't looked too closely.
You might find this article helpful.
DirectX comes with a texture atlas tool (and an API for calling it from your code).
Here is a very simple solution :
- in your model program, join all objects of the scene into a single mesh
- then use the UV unwrap feature of your model program
- then export the unwrapped map to your favorite paint program

This is what I use with Blender + Gimp for most of my models.

I use texture atlas for a quite different thing ; I first create my model/scene and texture them (see above), then I have a preprocess tool in my engine that based on the scene definition (models used for character, walls,...) and a max texture size will generate a texture atlas and update the uv of the incoming models. Since I only pack square texture, it is fairly simple.
Thanks for your responses!

The difficulty in my program is that I have triangles rather than polygons, so it is harder to pack triangles in the texture map than rectangles. But, I'm thinking on a solution by making pairs of neighboring triangles wich can roughly estimate a rectangle and packing them as rectangles.

This topic is closed to new replies.

Advertisement