Texture on Texture blending


(MrDiffrence) #1

Morning fellows,

I’m working on some Graffiti art for my in-development map and I’m running into a little problem. I’m trying to get the graffiti to fade somewhat so you can see the other texture it’s placed on top of and I haven’t seemed to figure it out.

My current shader;

textures/texturefolder/mytexture
{
surfaceparm nonsolid
polygonOffset
sort 6
{
map textures/texturefolder/mytexture.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen vertex
alphaGen vertex
}
}


(Fracman) #2

Either add an alpha const blend value, e.g. 0.25 , or make it as decal.
If you put it always on the same wall texture,
you might use photo editing tool to blend it with the wall and save it as new texture:
wall with blended Grafitti.


(MrDiffrence) #3

Enlighten me, I’m fairly dense.

add an alpha const blend value, e.g. 0.25

What shader keyword do I do to do this? I have no idea, checked the Shader Manual but must have missed it.


(Shaderman) #4

I guess Fracman is talking about alphaGen const. Search the forum for those keywords.


(Fracman) #5

alphaGen const <value>
You might try different values for the transparency there,
or modify your TGA to have partial alpha channel (then no need for alphaGen const)


(MrDiffrence) #6

Lovely, just lovely. Thank you gentlemen!


(obsidian) #7

alphaGen const, for some reason, was left out of the original Q3 Shader Manual. Its included in my local version of the Q3Map2 SM, but not on the online version as yet - still busy adding new sections to it.

I assume your texture does have an alpha channel?

You may want to use a _decal entity to apply the texture to the wall.


(MrDiffrence) #8

alphaGen const, for some reason, was left out of the original Q3 Shader Manual. Its included in my local version of the Q3Map2 SM, but not on the online version as yet - still busy adding new sections to it.

No prob

I assume your texture does have an alpha channel?

Yup

You may want to use a _decal entity to apply the texture to the wall.

I’ll give it a shot, so far it’s working just dandy without it but I’ll do it just for you Obsidian :banana: