Home Technical Talk

Masked textures in classic Unreal Tournament

polycounter lvl 18
Offline / Send Message
NuclearTes polycounter lvl 18
Hi, I have a question about masked textures in classic Unreal Tournament. I've read that if a texture is imported as masked, color index 0 is set as transparent.

I've tried to import some textures to Unreal Tournament using this feature, but the only textures that show up with transparency in game are the Chat icons I made. However, I also want some parts of the actual skin to have transparency.

So, here's my question: Is it possible to have textures with transparency on UT player models? Should I write a script file or is there something else I should do to get it to work? I have no idea why it works for chat icons and not for the other textures I tried to import.

Replies

  • NuclearTes
    Offline / Send Message
    NuclearTes polycounter lvl 18
    Ok, I think I've discovered why it isn't working. The model's polygons need special flags like Masked, Translucent & Modulated in order to get special effects to work.

    Since the textures are for a custom model I'm trying to import, I'm trying to find a way to do this.
  • Fordy
    Offline / Send Message
    Fordy polycounter lvl 18
    Hi NuclearTes

    I have a small utility at home which lets you set all the various flags on a UT model. I'll be home in about 10 hours, I'll see if I can find it and i'll mail it to you. Whats your email address?

    Never mind, got your email addy from your profile.
  • Fordy
    Offline / Send Message
    Fordy polycounter lvl 18
    Im home and I've mailed it. Have fun!

    I dont know what version of MAx your using but this might be of interest:

    http://www.planetunreal.com/fordy/eeroks.htm
  • Fordy
    Offline / Send Message
    Fordy polycounter lvl 18
    Your gmail account doesnt like .zip files. Do you have another email address?
  • NuclearTes
    Offline / Send Message
    NuclearTes polycounter lvl 18
    Hi fordy,
    Sorry for my late reply I was away for a short holiday this weekend. It would be cool if you could sent the zip file to |e-mail adres removed|
  • Fordy
    Offline / Send Message
    Fordy polycounter lvl 18
  • NuclearTes
    Offline / Send Message
    NuclearTes polycounter lvl 18
    Yeah, I finally solved my problem! The textures have transparency now, but it was quite a hassle. Because it might be of some use to others, I will try to explain what I did to get it to work. grin.gif

    I exported the model from Milkshape to UT's Skeletal format (.psk), so I didn't have to animate the model myself and could use the animations included in the Advanced Models Support add-on. However, UnrealFX can only import and export UT's _d.3d format, so I couldn't use that tool to change the face flags, and Milkshape has no support for it at all. I searched the web for other tools to do the job, but they all needed Windows 2000 or Windows XP and I'm still using Windows ME. poly114.gif

    Anyway, I did find the following workaround:

    Because the model was imported with Advanced Model Support, I could add the following piece of code to my Skin info file:

    <font class="small">Code:</font><hr /><pre>static function SetFX(actor SkinActor,Class<GenericPlayer> PlayerClass)
    {
    Super.SetFX(SkinActor,PlayerClass);
    SkinActor.Style = STY_Masked;
    }

    static function UnsetSkin(actor SkinActor,Class<GenericPlayer> PlayerClass)
    {
    Super.UnsetSkin(SkinActor,PlayerClass);
    SkinActor.Style = STY_Normal; //reset to default
    }
    </pre><hr />
    With this script the in game model had transparency, eventhough I wasn't able to set the face flags in the .psk file itself. However, the script didn't work in the player selection menu. I could solve this issue by using a separate selection mesh in _d.3d format (exported from Milkshape) in combination with UnrealFX.

    It's not a pretty solution though, because it's not recommended to change display attributes with a script and I'm not sure if Valhalla Avatar supports it.
  • Ruz
    Offline / Send Message
    Ruz polycount lvl 666
    ermm i remember that pshop didn't seem to do the 0 index thing right. The only way I got it working was to use painshop pro to do the index thing.
  • NuclearTes
    Offline / Send Message
    NuclearTes polycounter lvl 18
    @Ruz: I used photoshop to save the textures and I didn't have problems with the "index 0 thing". tongue.gif I did the following:

    I erased all the parts of the texture that needed color index 0, using the background eraser tool - leaving them completely transparent. I then converted the textures to the indexed color mode. But before the textures are converted a menu pops up where you can change the settings: now you only have to tick the transparency option. The parts of the texture that needed color index 0 now have color index 0. Finally - you can change color index 0 to any color you like using the color table.

    Another option would be Erik Neve's tool Bright 1.83 for high quality palette reduction. It's a command line tool which can covert multiple textures in one "single sweep" to 8-bit palettized format. It also supports index color 0 - it changes a specific pink color on your texture to index 0. It also has an extra option for mipmapped textures. I never used it though - because I still don't know how it works. poly122.gif
  • NuclearTes
    Offline / Send Message
    NuclearTes polycounter lvl 18
    I've done some more beta testing with the scripted skins and it's indeed an unreliable method. The parts of the skin that should be transparent sometimes become visible again - atleast when there are several player characters running around using this method of transparency. The lighting on the mesh parts with transparency is also very strange - sometimes these parts look almost black.

    I really should flag those polies in the psk file, but I still haven't found a tool that would work on my windows ME system.

    * Edit *

    Yeah, I'm happy! I've found an experimental tool to set face flags in psk files. I had to compile it myself, but it worked. The model has working masks now. For those who are also interested in the tool, you can get it here: Download pskhack from the beyondunreal forums
Sign In or Register to comment.