Making masked textures

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
Raylen
Average
Posts: 51
Joined: Wed Jan 12, 2011 12:43 pm
Personal rank: BunnyTracker

Making masked textures

Post by Raylen »

Hello,

I'm trying to make my own masked texture. For editing I have the GIMP (no photoshop!)

I've made a texture which appears masked properly in the editor (using software rendering), but then when I run it in UT (using OpenGL), it's not masked. Anyone able to help?
Thanks in advance for answering the above question!
User avatar
Radi
Adept
Posts: 362
Joined: Tue Apr 16, 2013 12:41 pm
Location: DeGie - PL

Re: Making masked textures

Post by Radi »

Hmmm some ini setting probably, but I don't remember now which setting is responsible for that (in UnrealTournament.ini - section [OpenGLDrv.OpenGLRenderDevice])

Have you tried another render -d3d9 for example ?
Have you applied that texture in a map in two or more surfaces? and one of them is without masked surface check ?
Maybe post that texture, it might help and nobody bite you for that :)

Cheers
User avatar
papercoffee
Godlike
Posts: 10449
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Making masked textures

Post by papercoffee »

Radi wrote: Maybe post that texture, it might help and nobody bite you for that :)
^This
Higor
Godlike
Posts: 1866
Joined: Sun Mar 04, 2012 6:47 pm

Re: Making masked textures

Post by Higor »

Get this:
http://lamda-rising.de/pages/en/downloa ... hp?lang=EN

Use GIMP to convert your map to indexed 255 colors, export to PCX.
This should leave you with a 8 bit PCX file and a free color.

Open the PCX file with Wally,
> Image
> Convert Textures (Quake <-> Unreal)
This will swap the color slot 0 with an empty 255.

Now do
->Colors
->Edit palette.
Pick a very bright color or one that stands out in the picture.
Use flood fill to paint the pixels you want translucent with the color slot 0.

Once you're done.
Edit palette once again, set color 0 to (0,0,0)
Resave PCX file.

Import in UnrealEd, you now have a standard UT Masked texture without weird glitches.
User avatar
papercoffee
Godlike
Posts: 10449
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Making masked textures

Post by papercoffee »

Ah ...I always feared to ask (I doesn't wanted to look stupid) ...but how can I do this in Photoshop CS2?
Btw. thanks Higor for this small tutorial. Can I add it to the essential tutorials thread?
User avatar
memsys
Adept
Posts: 394
Joined: Mon Jul 15, 2013 9:21 pm
Personal rank: Silicon Lifeform

Re: Making masked textures

Post by memsys »

papercoffee wrote:Ah ...I always feared to ask (I doesn't wanted to look stupid) ...but how can I do this in Photoshop CS2?
Btw. thanks Higor for this small tutorial. Can I add it to the essential tutorials thread?
I had PM-ed you this some time ago but I might as well copy paste it here.
memsys wrote:Well... Only because you said please :mrgreen: .

Adobe has a nice article covering the subject Link
If you want a TL;DR explanation :

basically if you want to make a texture that masks properly in UT you need to create an 8 bit texture. The best way to do is click on "Image -> Mode -> Indexed color..." and mess around with the settings but leave "transparency" ON.

Now go to "Image -> Mode -> Color table..." and click on the block that has the transparent "color" and change that to something else that will be you mask and make a note the #****** value (I recommend something that has either a large contrast to the rest OR blends in to the rest of the image so it is usable when when not masked) click "ok".

Now click "Image -> Mode -> RGB color..." now "Image -> Mode -> Indexed color..." change the setting "none" under "forced" to custom this will open a new window and click the top left block(this forces the mask to be in the first spot of the palette as that is the color that UT uses to mask parts of the texture), select the color you used for your mask and hit "ok" "transparency" does not matter at this point as turning it off will reduce the palette count by one (stupidly enough) click "ok" again and you are done!

All you need to do is save the file using "save as" and save it as a PCX file and you have your maskable import ready texture!

The only downside of doing it this way is that you might lose 1 color entry in the palette. I also have to say that so far I have used a different method but this is the fastest and easiest way I have been able to figure out! (yes I learned a lot as well by explaining this this way is MUCH faster with a LOT less steps in the process, hopefully I remember this next time I need to make a masked texture :ironic:)
sn260591
Average
Posts: 75
Joined: Sat Jun 01, 2013 10:38 am

Re: Making masked textures

Post by sn260591 »

There is another way: use Bright.exe and bat-file with the contents of

Code: Select all

Bright *.bmp
After starting the bat-file all 24-bit bmp in folder convert to 8-bit pcx.
If you need a masked texture, the transparent color should be black (0,0,0).
Raylen
Average
Posts: 51
Joined: Wed Jan 12, 2011 12:43 pm
Personal rank: BunnyTracker

Re: Making masked textures

Post by Raylen »

Well, I just did all that, and it worked perfectly. Thanks ever so much.

Oh and I know I didn't post a shot...sorry!
Thanks in advance for answering the above question!
eGo
Novice
Posts: 10
Joined: Sat Jul 05, 2014 3:34 pm
Contact:

Re: Making masked textures

Post by eGo »

Tool Developer & Software Engineer
http://www.ego-creations.de
User avatar
ANUBITEK
Adept
Posts: 261
Joined: Sun Dec 28, 2014 1:10 am
Location: Anubitek

Re: Making masked textures

Post by ANUBITEK »

EDIT:

SO IF YOU ARE HAVING ISSUES WITH YOUR TEXTURES GOING BLACK, WHEN YOU EDIT YOUR IMAGE IN WALLY JUST SAVE IT AS A .bmp, THIS SEEMS TO HAVE WORKED!

\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Sorry to necro, but I'm having an issue following the method Higor provided.
Spoiler
Image
What I was doing was cutting the character sprite (in the center of the image) and pasting it into GIMP, and either using the fill tool to remove the black background (making it transparent) or replacing it with a white background. I then convert it to indexed, then export it as a .pcx. I usually export the texture with a white background, but I am still getting the same issue even if I remove the background color and make the image transparent. I then import the image into Wally and use the Quake <=> Unreal conversion, make color 1 red (255,0,0), use the fill tool in each space I want transparent, change the color back to (0,0,0), and export it as a .pcx.
Result
Image
But when I import the image to my texture package, it is like a regular masked texture (transparent) but the image itself (the character) is black. The image I am ripping from is a bitmap.
<<| http://uncodex.ut-files.com/ |>>

Code reference for UGold, UT99, Unreal2, UT2k3, UT3
Additional Beyond Unreal Wiki Links
wiki.beyondunreal.com/Legacy:Console_Bar
wiki.beyondunreal.com/Exec_commands#Load
wiki.beyondunreal.com/Legacy:Exec_Directive#Loading_Other_Packages
wiki.beyondunreal.com/Legacy:Config_Vars_And_.Ini_Files
wiki.beyondunreal.com/Legacy:INT_File
User avatar
papercoffee
Godlike
Posts: 10449
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Making masked textures

Post by papercoffee »

GoshDarnit ...I totally forgot about this ...............again :oops:
memsys wrote:
papercoffee wrote:Ah ...I always feared to ask (I doesn't wanted to look stupid) ...but how can I do this in Photoshop CS2?
Btw. thanks Higor for this small tutorial. Can I add it to the essential tutorials thread?
I had PM-ed you this some time ago but I might as well copy paste it here.
memsys wrote:Well... Only because you said please :mrgreen: .

Adobe has a nice article covering the subject Link
If you want a TL;DR explanation :

basically if you want to make a texture that masks properly in UT you need to create an 8 bit texture. The best way to do is click on "Image -> Mode -> Indexed color..." and mess around with the settings but leave "transparency" ON.

Now go to "Image -> Mode -> Color table..." and click on the block that has the transparent "color" and change that to something else that will be you mask and make a note the #****** value (I recommend something that has either a large contrast to the rest OR blends in to the rest of the image so it is usable when when not masked) click "ok".

Now click "Image -> Mode -> RGB color..." now "Image -> Mode -> Indexed color..." change the setting "none" under "forced" to custom this will open a new window and click the top left block(this forces the mask to be in the first spot of the palette as that is the color that UT uses to mask parts of the texture), select the color you used for your mask and hit "ok" "transparency" does not matter at this point as turning it off will reduce the palette count by one (stupidly enough) click "ok" again and you are done!

All you need to do is save the file using "save as" and save it as a PCX file and you have your maskable import ready texture!

The only downside of doing it this way is that you might lose 1 color entry in the palette. I also have to say that so far I have used a different method but this is the fastest and easiest way I have been able to figure out! (yes I learned a lot as well by explaining this this way is MUCH faster with a LOT less steps in the process, hopefully I remember this next time I need to make a masked texture :ironic:)
User avatar
Dr.Flay
Godlike
Posts: 3348
Joined: Thu Aug 04, 2011 9:26 pm
Personal rank: Chaos Evangelist
Location: Kernow, UK
Contact:

Re: Making masked textures

Post by Dr.Flay »

PCX is not as reliable at storing palette info. Use BMP for 8-bit.

A more generic method used in Irfanview can be translated to many other programs.
1) Set the window/display background colour to be black.
2) Save the image as a transparent PNG or GIF, and click on the area/colour you want to be transparent when asked
3) Re-save this image as a BMP
The saved file will now have the colour you clicked on set to palette number 0, and should also now be black.

If you want to use compressed textures and better transparency, you can skip all the messing around and just export it from Photoshop or Gimp as a DDS file.
That way you can keep real transparent alpha channels and have more convincing textures without a jagged edge.
Post Reply