Trouble fixing half-transperancies

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

Moderator: Moderators

Post Reply
Stevo
Corporal
Posts: 38
Joined: Tue Dec 16, 2003 8:31 pm
Location: Florida, USA
Contact:

Trouble fixing half-transperancies

Post by Stevo »

Hey, I'm using Photoshop 7.0 to make my .tgas for fence textures. The transperancy works fine. It's the blurred edges of the opaque pixels that are giving me trouble. Since targas don't support half-transperancies (or anything in between [or is that just me?]), Photoshop always uses some kind of default white backround behind the half-transperant pixels to make them opaque when i save the file. Now, in all the MOHAA textures, a BLACK backround seems to be used, unless, of course, they didn't even have to grapple with half-transperancies. So, what I want to do is have a black backround in lieu of the white backround for half-transperant pixels. I've tried just getting rid of the, altogether, so as to just have a hard edge to the textures, but that doesn't seem to work either.

Does anybody know what I'm talking about? I'd really appreciate it if someone could give me a real answer.

Thanks.

At any rate, a black backround for the half-transperancies would look much better than a white one, because the white one is noticeable and unrealistic, and the black one is, well, not noticeable.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

gray

Post by tltrude »

I don't get what you're saying. Most of the see-through TGAs use white as the mask and black as the see-through part in the alpha channel. It does not matter what the colors are in the three color channels. If you use gray in the alpha channel, it will be simi-transparent where it is gray. But, there are a lot of shades of gray, and #808080 is about half way between black and white.

Maybe you just need to switch from layers to channels.

I have PS 7.0 too, but gave up on it and went back to using 5.5 (the educational version).
Tom Trude,

Image
Random
Moderator
Posts: 401
Joined: Sun Jun 01, 2003 11:00 pm

Post by Random »

Ok so when you open up the file the parts that are supposed to be the areas that contain the trancparencies in the alpha channel are all white right? And you get that annoying lookin silver lining effect sorta. I use psp but im assuming you have a replace funtion for colors just replace white for black and walla you are done. Just remember open, replace and save and exit with out opening up the alpha layer, for some reason once you open up the alpha layer it makes it a default white in the areas that contain the alpha layer when you close it again. No idea how to change the default color in PhotoShop though sorry.

Hope this helps
Random

Ps TGA's do support half transparencies, or 1/4, or 1/3 or 1/5..........and so on ...... and so on ..... and so on
Moderator
Image
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

in photoshop, do u have the things, that should be shown ingame, on a separate layer?
In fact, I do rarely edit an alpha channel, but put the "picture" on a new layer, delete the background layer and then in the picture-layer erase the pieces that shall be transparent (the checked background will become visible). The more I erase, the more it becomes transparent. Then, I save it as 32bit Targa.
For the hard edges, don't adjust the image size after erasing (which would 'smooth' the edges again) and don't use a soft tooltip to erase (obviously).
Maybe your shader could be different to what it should be: There are different possibilities to get a transparency effect (alphaFunc Ge0, Ge128...)
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Oh

Post by tltrude »

Ok, so Steveo is talking about making a tga from scratch. When you click on new, change it from "white" to "background color" and all your new image windows will have black backgrounds.
Tom Trude,

Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I think photoshop 7 will not save alpha channels :( so basically it is way crappier than previous versions :?

I didn't read all the posts :oops: but if you want a constant transparency (i.e. a single color alpha channel) you can do without an actual alpha channel but generate alpha data from the shader, using e.g.

alphaGen constant 0.5
Image
Stevo
Corporal
Posts: 38
Joined: Tue Dec 16, 2003 8:31 pm
Location: Florida, USA
Contact:

Progress

Post by Stevo »

You have a way with words, Random! That annoying "silver lining" is exactly what I am talking about. You were right on the mark, except that when I open the picture in Photoshop, the half-transperant pixels are still just that - they don't have a backround added to them yet, and so I can't change its color. I assume there is a way to do it in Photoshop, but I just don't know much about it.

Let me illustrate my point, though.

Here's a couple of textures. The one on the left shipped with MOHAA. The one on the right is my own. They've both got transperancy.
Image

Now, see what happens when I turn off transperancy in Radiant.
Image

See my point now?

The regular MOHAA texture has a black backround, which is unnoticeable on the edges in the game because black is more natural. My texture, however, has a white backround. The white backround gives the fence, as Random so eloquently said, a "sliver lining" that just does NOT jive well at all.

So, what I'm concerned with is either giving the texture such a hard edge that the backround isn't even a factor, or, preferrably, making the backround black instead of white.

You can kinda see the "silver lining" on my texture in the first picture, also.
M&M
General
Posts: 1427
Joined: Sun Sep 14, 2003 1:03 am
Location: egypt
Contact:

Post by M&M »

if u want it like mohaa then
tltrude wrote:. When you click on new, change it from "white" to "background color" and all your new image windows will have black backgrounds.
i think he is refering with background colour 2 the colour u want which is black :wink:
Image
User avatar
Jack Ruby
General
Posts: 1443
Joined: Fri Feb 07, 2003 12:20 am
Location: london

Post by Jack Ruby »

Could you post the shader script ? I might be able to work out the problem, I use ps7 all the time, though I do remember having probs with it making a scope once.

Not sure if the shader I am using supports transparency so if I use yours I can play around with the image.
Philip II of Macedon sent a message to Sparta:
"If I win this war, you will be slaves forever."
The Spartan ephors sent back a one word reply: "If".
Stevo
Corporal
Posts: 38
Joined: Tue Dec 16, 2003 8:31 pm
Location: Florida, USA
Contact:

Post by Stevo »

The texture's shader? Okay.

Code: Select all


textures/steve/steve_railing01_h
{
	qer_editorimage textures/steve/steve_railing01_h.tga
	surfaceparm metal
	surfaceparm fence
	surfaceparm alphashadow
	cull none
	{
		map textures/steve/steve_railing01_h.tga
		blendfunc blend
		alphafunc ge128
	nextbundle
		map $lightmap
	}
}

I'm no expert at shaders, so I was not aware that shaders had anything to do with curing this ugly silver lining. I had assumed it was just the texture itself that mattered!

Oh, keep in mind also - this is just a minor problem I'm trying to fix here. It's not going to kill me if I can't figure it out. It's just kinda ugly to have the white stuff on the edge of the fence (especially with low graphics options).
Stevo
Corporal
Posts: 38
Joined: Tue Dec 16, 2003 8:31 pm
Location: Florida, USA
Contact:

Some more information...

Post by Stevo »

I've come up with some more info on the subject.

I managed to fix that one texture. Somehow, I made the backround (the silver lining) black (into an unnoticeable black lining). The trouble, though, is that I still don't know how to do it. I still have a bunch of textures, and I can't afford to waste time randomly hoping to fix them. I've deducted, I think, that it has something to do with the backround color you choose in Photoshop (the "current" color; you know - you have two current colors, one foreground, on backround) when you use an eraser.

Another point of speculation is the color that Radiant dictates for each texture. You know how when you pull up the Surface Inspector (pressing S), and select a texture in the texture window, it shows the texture's "color"? I always thought this was wierd, since almost no texture is a single flat color, but now I think that it is the color that Radiant uses for that backround color for the transperancies (when transperancies are toggled off).

Anyway, I still need help on this. I'm not much closer to figuring it out yet. Help!
Random
Moderator
Posts: 401
Joined: Sun Jun 01, 2003 11:00 pm

Post by Random »

Sorry like i said i dont have photoshop, but i am glad that i was able to translate the problem for you. :P

Good luck with it, there seem to be many Photoshop users that can help you with your problem.
Moderator
Image
Post Reply