When you use WoW Model Viewer (WMV) to extract models (.m2's in WoW) for use in Starcraft 2 (which uses the .m3 format), the textures for those models in WoW get converted to the .tga image format. Originally, WoW uses the .blp format for textures, which is a proprietary compressed format optimized for the game's engine. In Starcraft 2, most textures are in the more widely used .dds format using DXT5 compression, though the engine is also capable of using .tga textures as well. This tutorial will teach you how to optimize your exported WoW textures for use in SC2, saving you lots of valuable space.
First off, I want to point out to you that a typical 512x512 texture from WoW in the .tga format can be between 500-1500kb when exported straight from WMV. Working within the current 20mb limit for publishing maps/mods, that will eat away how many models you can import really quickly, and at most you would only be able to have 2-3 custom models total. This isn't very much is it? Consider the following:
Often times when you're seeing a unit, structure or doodad in WoW, that object will be roughly the same size if not much larger than your own character. Because of that, textures are at a fairly high resolution, wherein 512x512 is a large portion of anyone's screen (though keep in mind you're only seeing portions of that texture at any given time). However, when you're playing SC2, most objects in the game are miniscule, in that you'll at any time have multiple, sometimes even hundreds of that object on your screen at once.
So the first step to optimizing our textures for SC2 will be to reduce them down to 256x256, easily one quarter or more of the original size. WoW textures have a ton of details in their textures because you can usually see them if you get up close enough, but that will never be the case in a typical SC2 map, so even though we're cutting a quarter or more of the details out, it will never be noticed by the average player.
The second step will be saving the image in the .dds format. Now this process becomes a bit trickier, so let's lay it all out step by step:
Warning: To apply these new textures, you will need a copy of Autodesk 3ds Max 2009-2011. Nintoxicated's .m3 Plugins currently do not work correctly with 3ds Max 2012. Additionally, the NVIDIA Texture Tools Plugin for Photoshop is only available for Windows.
2. Start Photoshop and open your texture file and go to Image -> Image Size or press (Alt+Ctrl+I) to bring up the Image Size dialog, and change the Height and Width to 256. Press Ok.
3. Now, do a Save As (Ctrl+Shft+S) and choose .dds from the Format drop-down list.
4. After hitting Ok, the Nvidia dialog will come up with additional settings. There are only 2 things we need to worry about here. First, choose DXT5 ARGB 8 bpp | interpolated alpha from the drop down menu. Second, make sure that under MIP Map Generation the No MIP Maps option is selected. (SC2 creates its own mip maps within it's engine.)
6. Start 3ds Max and go to Customize -> Configure User Paths. From here we need to tell 3ds Max where our files will be located. Unfortunately 3ds Max doesn't seem to like to search subfolders, so we have to tell it exactly where to look for files when we import out model. Go to the External Files tab and click Add, then navigate to whichever folder your .m3 files and your original and optimized textures are in. If you're using a directory structure to keep your textures organized, you will need to add that path to max as well. For example, my textures will be in Assets/Textures/ relative to where my .m3 files are.
7. Go to the Utilities panel (the Hammer icon on the right-hand side of your screen) and click on MAXScript. This will open a new panel and from there select .M3 Import and .M3 Export from the drop down list, or press Open Script to open both of these, had you not taken the extra step specified earlier.
8. Under .M3 Import, click Open and search for your .m3 file you wish to import. After clicking ok, click the Import button at the bottom of the panel. This will take a few seconds, just be patient while max does it's thing. A dialog will tell you when the import process is complete. If you get an error that it was unable to find the textures, you did something wrong in step 6. Make sure max knows where your textures are located! Don't be worried if your model appears to be all one solid color, even if you did not get this warning!
9. Now open the Material Editor, it's the Checkered Sphere icon 4th from the right along the top row of icons. For the purposes of this tutorial, make sure you are in the Compact Material Editor mode from the Mode menu, I will not be covering how to do this in the newer Slate Material Editor!
10. With the Material Editor open, you should see a number of grey spheres and depending on your model, 1-4 of them will be colored differently. These are the materials being used by the model, and currently have the old .tga textures applied.
11. From here, scroll down to the Layers portion of the material properties. By default we should only need to modify the Diffuse Map, as for most of these materials that will be the only one with anything in it. This will vary based on which model you're editing however! It's up to you to figure out which texture goes in which spot, but as a general rule, you'll only be working with Diffuse, Emissive and Alpha map layers for most WoW models. If there isn't anything there in the first place, then that's just how the model was set up.
12. To change the Diffuse (aka flat Colors) texture of the model to your new optimized version, click on the Diffuse map button, which will now swap you out to sub-material properties panel. From here under Map Path, you can change the Bitmap to the one you just made, however when it asks you the Bitmap Type, ALWAYS choose 3ds Max Bitmap. Then, search for your custom texture and click ok. Your texture should now be applied!
13. Repeat 10-12 until you've swapped out all the textures the imported model had for your custom ones. To get back to the material's original properties, go to Navigation -> Go to Parent, or click the Checkered Sphere with an Upward facing arrow second to the right on the horizontal icons, or, select the top list item from the drop down menu in the center.
14. For if any reason you're unable to see textures on the model in the viewport, go to Views -> Show Materials in Viewport As -> Software or Hardware Materials with Maps. If the model still has no textures, one of the previous steps was not followed correctly or it's possible that Max is just being difficult and your problem is independent of this tutorial, sorry.
15. Lastly, go to the M3 Export panel and make sure you specify the texture path relative to where the model file itself is located before clicking the Export button. This process will take a few seconds to a few minutes depending on your setup, but if all goes well you should receive and Export Successful dialog when the process is complete!
16. Now, import your textures and models as your normally would in the Galaxy Editor! Enjoy the extra space for even more custom models!
Overall, whenever I've done this to textures, they turn out to be a mere 65kb compared to their original 500-1500kb! That's easily about 10-30x smaller! Now if only we can find a way to optimize .m3 files better!
Great post. This will be very helpful to mappers, like myself and my friend Delirium, who have used WoW models before. Using optimizing, Delirium was able to reduce the size of one of our maps, due to wow imports, by almost 60%.
Short explanation for GIMP:
- Resize .tga and export them as .dds file
- Rename the dds file to .tga file ending
- Import in map and ignore all errors because of the wrong file format (only the editor complains, if you click on a picture. SC2 can read it just fine).
Benefit example:
If you resize a 512x512 tga to a 64x64 max compressed dds, you can bring the textures from around 500 to 3 kb. So resize the texture as far as you like it.
Tip for exporting models:
- only export model animations that you are using.
Benefit example:
If you resize a 512x512 tga to a 64x64 max compressed dds, you can bring the textures from around 500 to 3 kb. So resize the texture as far as you like it.
Tip for exporting models:
- only export model animations that you are using.
Just keep in mind every time you reduce a texture, be it from 1024 -> 512 -> 256 -> 128 -> 64 ->32 -> 16 -> 8, you're cutting a quarter of the details out each time. The smallest I'd recommend is 128x128, at which you'll start to see a difference in quality. 256 is adequate for SC2, even though most unit textures shipped with the game are 1024 or 512.
Either way, comparing same resolution TGA's to DDS files, you're looking at easily half the original file size if not better.
As for model animations, that's very true. Cut out every animation you won't use. If anything, import the model first with every animation, figure out which you'll use. then go and optimize it later by cutting out all the unused animations. Your models can easily be 300kb or smaller using the bare minimum of animations.
Sorry if this is a partial necro, but I'm having trouble using this technique with GIMP. I've saved each file as a .dds but I'm having trouble with the renaming thing.
If I simply rename and add ".tga" to the end of the file it remains a .dds file and just reads "xxxxxxx.tga.dds" when I import it into the editor.
I tried importing it as a .dds and changing the extension to .tga in the editor which works, but when you have multiple textures in the import section it overwrites the wrong ones and messes itself up. Any suggestions?
UPDATE: Managed to rename the files inside the editor to .tga and they work, but I have to save after every rename so if you could advise as to an outside the editor renaming solution it would be helpful.
Honestly I wouldn't support that method simply because it can cause errors. What you're doing is tricking the models into loading your .dds textures without doing any of the replacement steps in Max. This can cause various problems, such as the Galaxy Editor not interpreting them properly, etc. So I'd recommend avoiding doing this at all costs, but if you have no alternative, that's your only option.
tl;dr - Open the .TGA in gimp, save it as a .DDS. Change the extension on the .DDS file by renaming it (under windows you need to have file extensions visible) back to .TGA. Import to SC2 as usual and the textures should still apply to your model, but be smaller in file size.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
How-To: Optimizing WoW Textures for SC2:
When you use WoW Model Viewer (WMV) to extract models (.m2's in WoW) for use in Starcraft 2 (which uses the .m3 format), the textures for those models in WoW get converted to the .tga image format. Originally, WoW uses the .blp format for textures, which is a proprietary compressed format optimized for the game's engine. In Starcraft 2, most textures are in the more widely used .dds format using DXT5 compression, though the engine is also capable of using .tga textures as well. This tutorial will teach you how to optimize your exported WoW textures for use in SC2, saving you lots of valuable space.
First off, I want to point out to you that a typical 512x512 texture from WoW in the .tga format can be between 500-1500kb when exported straight from WMV. Working within the current 20mb limit for publishing maps/mods, that will eat away how many models you can import really quickly, and at most you would only be able to have 2-3 custom models total. This isn't very much is it? Consider the following:
Often times when you're seeing a unit, structure or doodad in WoW, that object will be roughly the same size if not much larger than your own character. Because of that, textures are at a fairly high resolution, wherein 512x512 is a large portion of anyone's screen (though keep in mind you're only seeing portions of that texture at any given time). However, when you're playing SC2, most objects in the game are miniscule, in that you'll at any time have multiple, sometimes even hundreds of that object on your screen at once.
So the first step to optimizing our textures for SC2 will be to reduce them down to 256x256, easily one quarter or more of the original size. WoW textures have a ton of details in their textures because you can usually see them if you get up close enough, but that will never be the case in a typical SC2 map, so even though we're cutting a quarter or more of the details out, it will never be noticed by the average player.
The second step will be saving the image in the .dds format. Now this process becomes a bit trickier, so let's lay it all out step by step:
Warning: To apply these new textures, you will need a copy of Autodesk 3ds Max 2009-2011. Nintoxicated's .m3 Plugins currently do not work correctly with 3ds Max 2012. Additionally, the NVIDIA Texture Tools Plugin for Photoshop is only available for Windows.
1. Download and install the NVIDIA Texture Tools for Adobe Photoshop: http://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop
2. Start Photoshop and open your texture file and go to Image -> Image Size or press (Alt+Ctrl+I) to bring up the Image Size dialog, and change the Height and Width to 256. Press Ok.
3. Now, do a Save As (Ctrl+Shft+S) and choose .dds from the Format drop-down list.
4. After hitting Ok, the Nvidia dialog will come up with additional settings. There are only 2 things we need to worry about here. First, choose DXT5 ARGB 8 bpp | interpolated alpha from the drop down menu. Second, make sure that under MIP Map Generation the No MIP Maps option is selected. (SC2 creates its own mip maps within it's engine.)
5. Download and install NiNToxicated's .M3 Plugins here: http://www.sc2mapster.com/assets/m3-export-plugin-3ds-max/ Take the extra step and copy the scripts to the startup folder as well.
6. Start 3ds Max and go to Customize -> Configure User Paths. From here we need to tell 3ds Max where our files will be located. Unfortunately 3ds Max doesn't seem to like to search subfolders, so we have to tell it exactly where to look for files when we import out model. Go to the External Files tab and click Add, then navigate to whichever folder your .m3 files and your original and optimized textures are in. If you're using a directory structure to keep your textures organized, you will need to add that path to max as well. For example, my textures will be in Assets/Textures/ relative to where my .m3 files are.
7. Go to the Utilities panel (the Hammer icon on the right-hand side of your screen) and click on MAXScript. This will open a new panel and from there select .M3 Import and .M3 Export from the drop down list, or press Open Script to open both of these, had you not taken the extra step specified earlier.
8. Under .M3 Import, click Open and search for your .m3 file you wish to import. After clicking ok, click the Import button at the bottom of the panel. This will take a few seconds, just be patient while max does it's thing. A dialog will tell you when the import process is complete. If you get an error that it was unable to find the textures, you did something wrong in step 6. Make sure max knows where your textures are located! Don't be worried if your model appears to be all one solid color, even if you did not get this warning!
9. Now open the Material Editor, it's the Checkered Sphere icon 4th from the right along the top row of icons. For the purposes of this tutorial, make sure you are in the Compact Material Editor mode from the Mode menu, I will not be covering how to do this in the newer Slate Material Editor!
10. With the Material Editor open, you should see a number of grey spheres and depending on your model, 1-4 of them will be colored differently. These are the materials being used by the model, and currently have the old .tga textures applied.
11. From here, scroll down to the Layers portion of the material properties. By default we should only need to modify the Diffuse Map, as for most of these materials that will be the only one with anything in it. This will vary based on which model you're editing however! It's up to you to figure out which texture goes in which spot, but as a general rule, you'll only be working with Diffuse, Emissive and Alpha map layers for most WoW models. If there isn't anything there in the first place, then that's just how the model was set up.
12. To change the Diffuse (aka flat Colors) texture of the model to your new optimized version, click on the Diffuse map button, which will now swap you out to sub-material properties panel. From here under Map Path, you can change the Bitmap to the one you just made, however when it asks you the Bitmap Type, ALWAYS choose 3ds Max Bitmap. Then, search for your custom texture and click ok. Your texture should now be applied!
13. Repeat 10-12 until you've swapped out all the textures the imported model had for your custom ones. To get back to the material's original properties, go to Navigation -> Go to Parent, or click the Checkered Sphere with an Upward facing arrow second to the right on the horizontal icons, or, select the top list item from the drop down menu in the center.
14. For if any reason you're unable to see textures on the model in the viewport, go to Views -> Show Materials in Viewport As -> Software or Hardware Materials with Maps. If the model still has no textures, one of the previous steps was not followed correctly or it's possible that Max is just being difficult and your problem is independent of this tutorial, sorry.
15. Lastly, go to the M3 Export panel and make sure you specify the texture path relative to where the model file itself is located before clicking the Export button. This process will take a few seconds to a few minutes depending on your setup, but if all goes well you should receive and Export Successful dialog when the process is complete!
16. Now, import your textures and models as your normally would in the Galaxy Editor! Enjoy the extra space for even more custom models!
Overall, whenever I've done this to textures, they turn out to be a mere 65kb compared to their original 500-1500kb! That's easily about 10-30x smaller! Now if only we can find a way to optimize .m3 files better!
Great post. This will be very helpful to mappers, like myself and my friend Delirium, who have used WoW models before. Using optimizing, Delirium was able to reduce the size of one of our maps, due to wow imports, by almost 60%.
Short explanation for GIMP:
- Resize .tga and export them as .dds file
- Rename the dds file to .tga file ending
- Import in map and ignore all errors because of the wrong file format (only the editor complains, if you click on a picture. SC2 can read it just fine).
Benefit example:
If you resize a 512x512 tga to a 64x64 max compressed dds, you can bring the textures from around 500 to 3 kb. So resize the texture as far as you like it.
Tip for exporting models:
- only export model animations that you are using.
Just keep in mind every time you reduce a texture, be it from 1024 -> 512 -> 256 -> 128 -> 64 ->32 -> 16 -> 8, you're cutting a quarter of the details out each time. The smallest I'd recommend is 128x128, at which you'll start to see a difference in quality. 256 is adequate for SC2, even though most unit textures shipped with the game are 1024 or 512.
Either way, comparing same resolution TGA's to DDS files, you're looking at easily half the original file size if not better.
As for model animations, that's very true. Cut out every animation you won't use. If anything, import the model first with every animation, figure out which you'll use. then go and optimize it later by cutting out all the unused animations. Your models can easily be 300kb or smaller using the bare minimum of animations.
@Ahli634: Go
Sorry if this is a partial necro, but I'm having trouble using this technique with GIMP. I've saved each file as a .dds but I'm having trouble with the renaming thing.
If I simply rename and add ".tga" to the end of the file it remains a .dds file and just reads "xxxxxxx.tga.dds" when I import it into the editor.
I tried importing it as a .dds and changing the extension to .tga in the editor which works, but when you have multiple textures in the import section it overwrites the wrong ones and messes itself up. Any suggestions?
UPDATE: Managed to rename the files inside the editor to .tga and they work, but I have to save after every rename so if you could advise as to an outside the editor renaming solution it would be helpful.
@rpc190: Go
Honestly I wouldn't support that method simply because it can cause errors. What you're doing is tricking the models into loading your .dds textures without doing any of the replacement steps in Max. This can cause various problems, such as the Galaxy Editor not interpreting them properly, etc. So I'd recommend avoiding doing this at all costs, but if you have no alternative, that's your only option.
tl;dr - Open the .TGA in gimp, save it as a .DDS. Change the extension on the .DDS file by renaming it (under windows you need to have file extensions visible) back to .TGA. Import to SC2 as usual and the textures should still apply to your model, but be smaller in file size.