Jump to content

Opacity "fading out" a texture


Recommended Posts

I am trying to figure out a trick on how to fade out an animated texture, like with alpha layer. I am thinking its solution is  close and that i need probably another pass in my shader, but i cant wrap my head arround it since i been in and out of this thing.

I am using at the moment the following shader for the waterfall, but the stream that comes out, i want to fade out.

 

textures/sp_terrain/wf1
{
	qer_editorimage textures/sp_terrain/wf1
	qer_trans 0.75
	sort banner
	surfaceparm nonsolid
	surfaceparm nonopaque
	surfaceparm trans
	surfaceparm nomarks
	surfaceparm water
	q3map_material water
	q3map_nolightmap
	cull none
	polygonoffset
	{
		map textures/sp_terrain/wf3
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphaGen vertex
		rgbGen identity
		tcMod scroll 0 -0.35
		glow
	}
	{
		map textures/sp_terrain/wf2
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphaGen vertex
		rgbGen identity
		tcMod scroll 0 -0.75
	}
	{
		map textures/sp_terrain/wf1
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphaGen vertex
		rgbGen identity
		tcMod scroll 0 -1
	}
}	

which results me in something like this.

oFAd9Ka.jpg

I am looking for something to fade it more out, like using an alpha layer to make the thing dissapear. Is that possible? Or have someone attempted this before?

mjt likes this
Link to comment

You could probably use vertex alpha for the fade, which you can control using alpha volumes. The principle is similar to (one method for) blending textures on terrain. I was going to point you towards SimonOC, but the website seems to be down. Somebody else can probably provide more details.

Link to comment
  • 3 weeks later...

Only using one stage to depthWrite and alphaFunc GE128 and the following with depthFunc equal which will only write on the alpha mask of the previous stage... that would then be static and the depthFunc equal stage would be scrolling. However the variant with terrain blending seems to be the better choice - using it on top of the suggested method and having the alpha mask around 128 in average brightness and some grainyness in between. Similar to this: 

 

spacer.png

 

as the alphamask first stage

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...