[PB]Snoelk
09-01-2009, 01:17 AM
Hi there
i made a script for automaticly assign a texture size based on the texel per unit settings. this is used for a lowpolymesh to bake with a highpoly. since the bake functions in max are a little limited, i implemented a port to xnormal as well. works pretty fine but there is a huge problem.
to get the lowpoly mesh to work with real-time engines, the textures of the lowpoly should be a power of 2. this is also solved.
but as a matter of fact, sometimes the wanted size of the lowpoly texture will be 1518 pixel and 1300 for example. so the next power of two would be 2048 x 2048. the script also places the uv chunks without scaling inside this power of 2 texture. so we still got the texel / unit proportion.
now we come to the real problem. the uv packing inside max. it uses the uv space from 0 to 1 as box. it doesnt try to get the minimum uv space with the possibility for rectangles. if i manually try to move the uv chunks inside the uv space i can create a better usage of the uv space and the resulting image is 2048 x 1024. sounds not much but the texture size in bytes decreases dramaticly.
is there a way to solve this problem inside max ? i hope i dont have to create a weird script to pack the uv chunks myself.
i made a script for automaticly assign a texture size based on the texel per unit settings. this is used for a lowpolymesh to bake with a highpoly. since the bake functions in max are a little limited, i implemented a port to xnormal as well. works pretty fine but there is a huge problem.
to get the lowpoly mesh to work with real-time engines, the textures of the lowpoly should be a power of 2. this is also solved.
but as a matter of fact, sometimes the wanted size of the lowpoly texture will be 1518 pixel and 1300 for example. so the next power of two would be 2048 x 2048. the script also places the uv chunks without scaling inside this power of 2 texture. so we still got the texel / unit proportion.
now we come to the real problem. the uv packing inside max. it uses the uv space from 0 to 1 as box. it doesnt try to get the minimum uv space with the possibility for rectangles. if i manually try to move the uv chunks inside the uv space i can create a better usage of the uv space and the resulting image is 2048 x 1024. sounds not much but the texture size in bytes decreases dramaticly.
is there a way to solve this problem inside max ? i hope i dont have to create a weird script to pack the uv chunks myself.