Creating transparent textures ???

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Useing wacko's method will work but if you want semi transparent areas you will need to use the alpha channel method . Grey in the alpha channel will make those areas semi transparent how transparent depends on what shade of grey that you use .
Image
Balr14
Colonel
Posts: 450
Joined: Sat Aug 03, 2002 4:01 am
Location: Germantown, WI, USA

Post by Balr14 »

bdbodger, your shader is doing white blending, scrolling and scaling. It would be awfully slow for a simple transparency, as it requires multiple texture passes.

mcunha98, I would not use nomipmaps / nopicmip unless it is a very small and fine texture (like a wire fence). These values will prevent the texture from culling at a distance, which hurts performance and can look kind of odd.

Wacko, my version of Photoshop is fairly old, but it is possible to create a 32 bit TGA, using CMYK channels. This is true 32 bit color and is not supported by MOHAA (or any other game). You have to create the TGA as RGB channels (24 bit) and add an alpha channel to make it 32 bit. Maybe your version of Photoshop defaults to creating RGB and an alpha channel, mine doesn't. In any case, you should edit the alpha channel and clean up the black and white areas for best transparent results.
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

Balr14 wrote:Wacko, my version of Photoshop is fairly old, but it is possible to create a 32 bit TGA, using CMYK channels. This is true 32 bit color and is not supported by MOHAA (or any other game). You have to create the TGA as RGB channels (24 bit) and add an alpha channel to make it 32 bit. Maybe your version of Photoshop defaults to creating RGB and an alpha channel, mine doesn't. In any case, you should edit the alpha channel and clean up the black and white areas for best transparent results.
CMYK would be true 32bit, u're right and that's why everybody is saying it won't work in MOHAA. I'm using Photoshop 7, and here I even cannot save a CMYK image as Targa: This option simply doesn't show up if the image is CMYK. Also, in my version, I can make layers semi transparent and this information would be saved in an alpha channel automatically by saving the image as 32bit Targa. As an example, u can d/l a shadow texture (both psd and tga) and try it with the shader below. This image got no alpha channel, just one layer with a gradient in opacity.

Code: Select all

textures/test/shadow
{
	qer_editorimage textures/test/shadow.tga
	qer_keyword utility
	surfaceparm alphashadow
	surfaceparm nonsolid
	surfaceparm trans
	polygonOffset //makes it float above the face to prevent z-fighting
	{
	map textures/test/shadow.tga 
	blendFunc blend 
	depthWrite 
	}
}
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

hmm never though of trying to make a layer semi transpartent . I know you can do that but never tried it in mohaa maybe I have been doing the hard way .
Image
User avatar
mcunha98
Lieutenant Colonel
Posts: 384
Joined: Sat Jan 17, 2004 1:52 am
Location: Brasil
Contact:

Post by mcunha98 »

Image


Work !!!!!!!!! :lol:
Like Pantera tell, my problem is the final format to save, i select 24bit, in true, the correct format is 32 bits.

Thanks for all replys !!!!!!!!!!!!!!!
Balr14
Colonel
Posts: 450
Joined: Sat Aug 03, 2002 4:01 am
Location: Germantown, WI, USA

Post by Balr14 »

Wacko, you have some decent knowledge of shader functions. The polygon offset is a very cool trick.
Post Reply