Saturday, July 20, 2013

Masked textures in UDK


July 20th, 2013

I have been working on my project and discovered that 20,000+ actors/meshes on the map can easily drag performance into the toilet. I am rethinking my models to minimize faces/vertexes. A big piece of the puzzle is masked / see-thru textures.

I had a hell of a lot of trouble getting masking to work properly. I thought I'd document the key bits of the process for reference & anyone else trying to solve this problem. I have photoshop as an image editor. I do a ton of photography and have been using this tool for a long time...

1. I built a sample graffiti cube texture with 2 windows. I cut the window areas out on the texture:

1. [CNTL]-click on the image of the layer. This selects all the pixels on that layer excluding the window cut outs in this case:

3. Click on the Channel tab and click on the alpha-channel button at the bottom. This adds the alpha channel for the windows.


Save your image as a 32 bit Targa (tga). If you save it as 24 bit, the transparency won't work: 

In UDK I imported the texture. I created a material directly from the texture. Here are the settings for the import:

After the import, the material doesn't work for some reason. Open the material, drag the texture around and then click the green checkbox and voila, you have a masked texture.

No comments:

Post a Comment