Texture Atlas Generator

51 votes

This script generates a texture atlas out of the selected objects, and manipulates their UVs (and if necessary, their geometry as well). Currently only Multimaterials and/or Standardmaterials (with bitmaps in diffuse channel!) supported.
Texture atlasses especially are important for real time applications and game development. Check http://developer.nvidia.com/object/texture_atlas_tools.html to see performance comparisons.

- geometry slicing
- padding
- simple packing algorithm
- editing many objects at once, thus creating only one atlas for all of them

If feedback is positive, 3d-io would consider transforming this script into a much faster and better plugin, developed in C++.

Example for a generated texture atlas:

Additional Info: 

This script adds a single button to your Interface. When you click it, a rollout appears. Usage:

- Disable Undo: Should be checked, especially when working with big meshes.
- Generate Messages: Produces some interesting statistical data in the MAXScript Listener.
- Ignore Warnings: If you check this option, you won't be asked to stop or continue when there are errors in the UVs and/or in the meshes
- Slice Geometry and Generate UVs: This option will manipulate the UV coordinates of all selected models, so they fit to the texture atlas that will be generated. Meshes with texture coordinates lower than 0 or bigger than 1 are not really suitable for producing a texture atlas, because texture atlasses don't support tiled textures. Thus, this option will slice those meshes and move the texture chunks in such way that the coords are all in the range 0...1.
- Break all Edges: Normally, TexAtlasGen tries to keep texture chunks together where possible, which is very slow, as it tests every edge's position. With this option, you can break all edges, which is faster, but will increase KB size of the mapchannel. This option has no impact on UV mapped models, like characters.
- Create: If you don't want to create an atlas, disable this option
- No padding: This checkbox is only available if you don't generate the UVs (see above). It will prevent TexAtlasGen to add any padding for the individual textures in the atlas and thus will be much faster. If you want to have a fast overview of the textures, use this option.
- Choose Path & Filename: Where you want to have your texture atlas saved.
- Padding: The amount of padding around any tiled texture. Won't have any effect on UV maps.
- Shrink in Atlas: When checked, any texture in the atlas with padding will be resized so the original texture size persists. For example, if you have a 64x64 texture and set padding to 2, the texture will be resized to 60x60, with a padding border of 2 on every side. If you deactivate this option, the size of this texture in the atlas would be 68x68.
- Generate Texture Atlas: Let the magic begin.

Version Requirement: 
tested with Max 9, Max 2009
Video URL: 
test_texture_atlas.jpg281.23 KB
step_by_step.gif523.78 KB
TexAtlasGen-v1.0.3.rar14.8 KB


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
dejeka's picture

can anyone tell me how to

can anyone tell me how to generate this script? n how to open the textgen menu option? im new to scripting stuff but i do need this to generate UV coordinates since i got so many to place the UV one by one to their textures...anyone can help? im using 3ds MAX 9

3d-io's picture

Konnichi wa, ResidentNinja!

Konnichi wa, ResidentNinja! The error you got is displayed when some - probably small - mistake was made in the modelling or unwrapping process. A not sliced face generally means, that some of the generated UV coords could be not in the range [0,1] - if it's severe, then all the coords are off.

I don't quite understand why you need unique UV coords - you have Flatiron for that! :)

ResidentNinja's picture

Great for real-time

Great for real-time conversions...

Our company is doing real-time simulations. We needed a 3D city in a short time frame and ended up purchasing a pre-fab off of TurboSquid. Unfortunately, the city was textured with tiled UVs and UVs that extended outside of the normal 0,1 range. Our current pipeline has involved your other (fantastic) commercial plug-in Flat Iron, both for the Unwrella component as well as for baking in lighting. But, we still have to take the unwrapped UVs into Photoshop and manually create the texture atlas using the source textures. This plug-in would have the potential to save tons of tedious man-hours.

I did a test of this plug in and it is very close to what we'd need to fully automate our pipeline on our current project. I do receive an error: "A specific face couldn't be sliced, which will result in a incorrect UV map. Check your UVs and Geometry please. Continue anyway?" Which, I'm not sure what specifically it is having a problem with. However, it appears to produce a workable result if I "continue anyway."

I'm using it under 3ds Max2010, if that matters. ; )

My one main request would be for an option to make the UV coordinates unique. Right now the plug-in will stack UVs to reuse texture space, which could be useful in some circumstances, but in our case, we still need to bake lighting in. Ideally, such an option would take a textured box that had six identical faces and allow either the creation of a texture with stacked UVs and the one face texture filling the full space, or a texture with six UVs exploded out and each using it's own unique pixel space in the texture.

I have no idea if it would be possible, but if it could also do the same process using procedural textures, it might greatly expand on the plug-ins flexibility and marketability.

Anyways, a fantastic plug-in. Hope to see a commercial version someday. =D

3d-io's picture

Snoelk, I wrote you an

Snoelk, I wrote you an E-Mail. Check your spam folder! ;)

Snoelk's picture

this is the "plugin" i

this is the "plugin" i looked for so long.
i realy need this kind of tool for game creation.
right now we create lots of items and tried to create a texture atlas by hand. no need to mention that this works 50% fine and the rest is wastage.
could it be possible to render the other map channels also in the new atlas map ?

oppacity und bumb channels come to my mind. the bump channel ist used for the normal maps.

cool woold be a method to allow atlas textures that allow horizontal tiling. texture like 512x2048

thanks in advance

3d-io's picture

Make sure you meet the

Make sure you meet the following criteria:
Correct object type: Editable Poly, PolyMeshObject
Correct material type: Multimaterial, Standardmaterial (with bitmaps in diffuse channel)

ykk's picture

how to use it??? how come i

how to use it???

how come i have the error "select correct object type, with correct material type!" . anyone who know what is the problem??

nuosyo's picture

Videotutorial you might do a

Videotutorial you might do a tutorial or a more comprehensive .. intiendo is not much.

thank you very much

robtl's picture

谢谢你 Thanks for your

Thanks for your share

SpookyCat's picture

For us the main use would be

For us the main use would be getting legacy model textures into an Atlas for the game engine, new stuff is modelled with Atlases in mind so no tool needed for that for us. But would be handy for merging maps across many objects.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.