shader/alpha help


(DWM|Commando) #1

Hey i am currently trying to make a texture that fades out to opaque on the outside. The utorials i have seen say to use a gradiant fill in the alpha channel. I did and what i get in game is that i jsut see the “whitest” part of hte gradiant fill,then an immediate transition to opaque, basically making a circle, with the texture in it. No smooth transition or “fade” to opaque, here is my shader… i think i might have messed something up in it? possibly somethign that wont allow it to smoothtly fade? Any help appreciated.


textures/test/test1
{	
    surfaceparm trans		
    surfaceparm alphashadow
    polygonOffset

	cull none
    
	


	{
		map textures/test/test1.tga

		blendFunc GL_ONE GL_ZERO
		alphaFunc GE128
		depthWrite
		rgbGen identity
	}
	{
		map $lightmap
		rgbGen identity
		blendFunc GL_DST_COLOR GL_ZERO
		depthFunc equal
	}
}


(kamikazee) #2
blendFunc GL_ONE GL_ZERO

should probably be:

blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA

or

blendfunc blend

(shorthand)


(Detoeni) #3

you have polygonOffset, like in a decal and cull none?

textures/test/test1
{
polygonOffset
entityMergable
surfaceparm nomarks
{
map textures/test/test1.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen vertex
alphaGen vertex
}
}

edit:Blast :confused: I need to learn to type faster.


(DWM|Commando) #4

lol, thanks alot guys, ill try it now