PDA

View Full Version : [UT200X]-Skinning : Masking


daloonie
19th May 2005, 10:12 AM
Tutorial for masking out parts of a player model.

For this tutorial I assume you have a basic knowledge of the UnrealED 3.0 interface. And is farely known to the interface in Adobe Photoshop 7.

I'll take this in steps.
1. What is masking?
2. Get an idea of what you want to be done.
3. Can it be done?
4. Making an Alpha channel.
5. Exporting/Importing the texture.
6. Final product.




1. What is masking?
First we need to know what masking is. Masking is basicly hiding parts of a model. This is achieved with alpha channels/textures and can be compiled in some different ways. Shaders' FinalBlends etc.




2. Get an idea of what you want to be done.
Right we start with choosing a model. I'll show you how I did it on my skin Theory, a Jugg based on the Male Jugg 'Gorge' model. I loaded up my Theory skin in a texture file and opened the 'Jugg' animation pack in the 'Animations window'.
http://img221.echo.cx/img221/8161/animationsmenu7og.jpg
I attached my skin in the menu on the right as shown.
http://img240.echo.cx/img240/889/animationsskin2wc.jpg
I've marked out the parts I want masked away with a red circle on this picture.
http://img240.echo.cx/img240/5317/selection4wn.jpg




3. Can it be done?
Can it be done? We will find out now. This is a simple way of finding out. In the Animation window you just move the camera up close to the parts you want masked. When the camera hits the part you can look through it. As shown you can see that this part is not vital part of the model, since there's a visible belt behind it.
http://img240.echo.cx/img240/4674/maskshow9pr.jpg
This clarifys that if you mask this part out the belt behind it will show, and the model will not have a hole.




4. Making an Alpha channel.
Now we have planned what we wan't to do and made sure it's possible. Now we need to know what makes a part visible/invisible. It's an Alpha channel that defines which parts to show and to hide.
To make an alpha channel open up your texture in Photoshop. Now to find the parts that needs to be masked out. This is fairly simple as you know what they look like. To make the masking fault free I recommend you download the wireframes (http://skincity.beyondunreal.com/?action=view_news&id=647) for all of the models in the game and apply this on top of the texture with around 40%'s oppacity. This way you can mask out exactly the part you want removed.
Next you will have to create the Alpha channel. To do this select the Lasso tool http://img240.echo.cx/img240/6682/lasso6np.jpg and select the parts to be masked out.
When all parts are selected got to menu point 'Select -> Save Selection'
http://img240.echo.cx/img240/5523/saveselection5rh.jpg
Now save it as Alpha 'Alpha' like so.
http://img240.echo.cx/img240/962/saveselection27qx.jpg
Don't mess around with the 'Document:' option leave it as it is. Now you have made an Alpha channel.
To see your Alpha Channel go to the 'Channels' menu in the 'Layers' palette.
http://img277.echo.cx/img277/804/channels3co.jpg
You'll notice it's black and white. It's meant to be like this. To understand these colors you'll need to know the fact that black = invisible and white = visible. You'll notice that your selection is 'inverted'. You'll need to Invert the colors in the Alpha channel to make it mask properly. This can be done with 'Ctrl+I'.
If you wish to make several selections you can always save more selections in this channel. Simply use these settings when saving the selection.
http://img277.echo.cx/img277/2448/saveselection35yr.jpg
If you have inverted the Alpha channel you'll need to use the 'Subtract from channel' option instead of 'Add to channel'.




5. Exporting/Importing the texture.
5. Now to export/importing the texture. I personally use nVidia's Photoshop Tools which can DXT compress files in .dds format which can be read by the Unreal Engine 2.X. The way of using this tool is simple you select 'File -> Save as' and select .DDS format. Press save and a menu will pop up. Select DXT1 (1 bit Alpha) and press save. You will now succesfully have Exported a DXT compressed file.
Next is to Import this texture. Load up UnrealED and go to the texture Browser. From here select 'File -> Import' and select your DXT compressed texture.
http://img277.echo.cx/img277/8750/import4nk.jpg
Now there will pop up an import box where you should type in where you want to have your texture located.
http://img277.echo.cx/img277/5650/import25ye.jpg
In this you box can also hack off 'Masked' and 'Alpha'. This isn't necessary as it can be done at any time but it is easy just to hack those off.
If you didn't hack off 'Masked' and 'Alpha' no harm is done all you need to do is right-click on your texture and select properties. Select the undermenu 'Surface' and set 'Masked' and 'Alpha' to true from there.
http://img277.echo.cx/img277/3394/textureproperties4ip.jpg
Now you'll have a masked texture. Try it on the model to see how it looks.




6. Final product.
Now you can add Shader's, Final blends and so on. I have made a Final Blend for your viewing pleasure.
http://img272.echo.cx/img272/9038/finalblend6ae.jpg

I hope this has cleared out what masking is and how to do it. This is basic knowlegde about masking.

The actual skin can be found here (http://forums.beyondunreal.com/showthread.php?t=157485)


_________________________________________
Søren 'the_rex' Falk aka DaLoonie