Well, this is a short tutorial about optimizing the textures in UDK and some of the key things to remember
while importing texture into UDK.
Before we start, I would like to list out the supporting formats by UDK.
The following Texture formats are supported:
I often save the texture in TGA but sometime TGA file gets saved in 32 bit and sometimes we happen to save them with plain alpha even though they actually don’t contain any alpha information. This is very bad because UDK imports TGA files and tries to compress it with its inbuilt Compressor known as DXTC. However, the alpha is not completely compressed or sometimes not at all by Unreal Engine 3. So it’s better to save the file with no Alpha only if you really don’t need any alpha information in unreal engine. Make sure the file is saved in 8 Bits per Channel RGB/RGBA format just to avoid complication while importing.
Here I’ll be starting off with one of the simple foliage texture that is Banana Palm leaf texture.
We all tend to save the file in three different formats i.e. Diffuse, Specular and Normal map. Although you really don’t have to save a separate specular map always because we can extract it from diffuse map.
As shown in the above Unreal Material Editor, I extracted the Red and Green information from the diffuse map and multiplied it and then again I multiplied it with a constant value of 18 just to crank up the result as you can adjust it according to your desire or you could import 256 x 256 specular map instead of constant parameter. You will be able to see the second multiplied value starts to shine a little bit which is the exact thing we wanted after that just plug the result into the specular node. You can also plug the constant parameter value to specular power node only if want a nice and shiny specular Result. That’s it we’ve just created a specular map from a diffuse map and thus saving memory to load one more 1024 res map in engine.3
Whenever we tried to load or save a texture map we mostly miss out to check the resolution or dimension of the texture map. Always check the resolution of the map because UDK only import the texture having the resolution of power of 2, (x2)
For example: 256 x 256, 512 x 512, 1024 x 1024, 2048 x 2048 and so on. Make sure the file is saved in 8 Bits per Channel RGB/RGBA format just to avoid complication while importing.To check that out, open up the file in Photoshop and Go to Image–>Mode–>and there you should see 8 Bits/ Channel selected if not then just click on it.
After you load the texture, make sure that you’ve set the LOD Bias.
As shown in the above texture properties, I have imported the banana leaf texture with a resolution of 1024 x 1024 but I’ve set the LOD bias to 1.What Happens here is the resolutions decreases by 1 step (x2) that is 512 x 512 so you don’t have to load photoshop for that. The reason I’ve set the load bias to 1 is because our mesh is simple foliage so 1024 x 1024 is going to drain a lot of memory. Below is the difference between With LOD Bias and Without LOD Bias.
In UDK go to View and then Browser window and select Texture Stats to see the statistic of the textures loaded in your scene.
As you can see in the above pic the textures are loaded in 1024 x 1024 dimensions with no LOD bias set. The Textures here are using the memory of about 1366 kb each.
In the above pic, the textures are loaded in 1024 x 1024 dimensions but with LOD Bias set to 1. Each Textures are using the memory of about 342 kb.
For objects where you need high detail you dont have to do the above process. But for simple static objects like foliage, grass, leaves and any other such static meshes, you can go for the above process. This will save a lot of memory thus optimizing the gameplay.
Thank you for your time 🙂