How to make transparent textures (alphamask)

Lithtech Jupiter engine
Post Reply
User avatar
Spawn
Admin
Admin
Posts: 1128
Joined: Sun Jul 25, 2004 12:50 am
Location: Norway
Contact:

How to make transparent textures (alphamask)

Post by Spawn » Sun Sep 17, 2006 10:11 pm

How to make transparent textures (alphamask)

I had a hard time learning myself how to do this right.
so I guess a tutorial would be a good idea!
This is not difficult if you know the basics about how to make your own images in Photoshop
or any other imagingprogram, there's a lot of good software out there!

I'm using Photoshop for this tutorial..


1)Create your textures

I choosed to make a window with circleform as a demo. the black area will be transparent
and the red & grey part will be normal visible texture



main texture:
Image

the picture above is how the texture will appear, now copy this
texture and make another one in greyscales!

Why the greyscale?

The greyscale texture will tell the engine how transparent the
texture should be, this is how it works:

Black = total opacity
White = No opacity


If you want the texture to be partly visible, then do this by using different tints of grey,

Light grey=less opacity
Dark grey=more opacity


Image

I want all the red & the metal colored parts to have no opacity
and I usually do this by using photoshop's colorwand tool, select the black circle
and click 'invense' in the 'select' dropdown menu.. Now everything but the black circle is selected!

Image

Image

Now select white but with a tiny tint of grey and fill the selected area with this color

Grayscale:
Image

This texture will now qualify for the transparent window!
but will look very false because you can't see the window,it just looks like a hole in the wall.
Click 'inverse' again to select the black area.
Then choose a dark grey color and replace all the black, and add a few less darker stripes
to make it look like light reflections

Image

Export both files, I use the pcx format because this format will automatically take care
of the colordepth for the normal textures 32k(24bits) You may also use TGA on the main texture..
The greyscale must be a pcx file,and it has to be a 256color (8bit) file!

2) Import to DEdit

Finally we're back in DEdit again, and we're ready to import the new texture.
Create or find the preferred folder you want the texture imported to..
Select it and rightclick it, then choose 'Import PCX files'

Image

Browse for your main texturefile and load it

Image

Now select the new imported texture and rightclick it
and this time choose 'Import alpha Mask'

Image

Browse for the greyscale texture and load it,
then copy these settings into the texture properties!

Image

The texture is now complete and as you can see on the picture below,
the 2 textures are working together as one texture.

Image

IMPORTANT: Remember to use gouraud lightning mode on these brushes in
order to get the transparent area to become transparent

Image
Image

Post Reply