Sign in to follow this  
jsg007

Automatic texture atlas generation

Recommended Posts

jsg007    100
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?

Share this post


Link to post
Share on other sites
MassacrerAL    121
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.

Share this post


Link to post
Share on other sites
Neverender    147
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.

Share this post


Link to post
Share on other sites
Niwak    208
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.

Share this post


Link to post
Share on other sites
jsg007    100
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this