Jump to content

Home

shader prob - white jaggies on transparent grate


clu

Recommended Posts

Hey all

 

Here's a pic of a transparent grate shader I made that's having some anti-aliasing or some other issues. It has this ugly white, halo/jaggy effect around the edges where it becomes transparent:

 

http://www.jakekeating.com/pub/grate_problem/shot0001.jpg

 

Anyone know how to get rid of this? My shader code follows:

 

 

textures/colo/fence01_2sided

{

cull none

qer_editorimage textures/colo/fence01.tga

{

map $lightmap

alphaFunc GE128

}

{

map textures/colo/fence01

alphaFunc GE128

blendFunc GL_DST_COLOR GL_ZERO

rgbGen identity

}

}

 

My targa file is fine (no white things on edges), so I'm hoping theres a magic line of code I can add to feather the edges or something. Anyway, any help would be great.

 

-clu

Link to comment
Share on other sites

First of all I would delete the aplhaFunc from the lightmap stage.

 

I use a grate with the following shader code:

textures/twoofakind/floorgrate
{
qer_editorimage textures/doomgiver/floorgrate1
surfaceparm trans
surfaceparm nomarks
cull disable
{
	map textures/doomgiver/floorgrate1
	blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
	rgbGen identity
}
{
	map $lightmap
	blendFunc GL_DST_COLOR GL_SRC_COLOR
}
}

 

Maybe this helps to figure out something.

Link to comment
Share on other sites

OK. I think I'm almost there. I used your same code again, Leslie. This time I re-did my targa. Used a layer mask to make the alpha channel, and somehow it now works (almost).

 

Now the only weird things are as follows:

 

1) The transparent areas of the grate appear slightly grey (instead of truley transparent): http://www.jakekeating.com/pub/grate_problem/shot0003.jpg

 

2) When looking through one grate to the other side, both grate textures seem to flicker a bit and kind of blink in and out.

 

By the way, I am using a fully caulked brush with one face textured with the shader.

 

-clu

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...