Semi transparent shader


(Yatta) #1

Im incompetent with shaders, and need someone to do one rather simple for me, if possible.

What i want is a shader that gets more transparent on its lighter parts, white part are fully transparent, grey are semi transparent and black is fully opaque. I managed to do that once when light isnt compiled, but once light is applied it makes it invisible.

I know it has to do with blendFunc, but i dont understand much how it works or how to make sure lightmap wont influence it.


(Avoc) #2

Your texture needs to be a 32 bit .tga. The Alpha channel in the .tga will control how much transparancy/where the transparency is in the texture.

As for the shader, you can simply use a ‘blendFunc blend’.


(Yatta) #3

Ah right, im dumb. :smiley:
Instead of finding the right blend function to blend black parts of a plain image, I should have used tga alpha in the first place. Thanks ! ; )


(ischbinz) #4

i suggest using this tool:

http://bpeers.com/software/q3ase/

is not perfect but you can simply test some shader settings :slight_smile:


(twt_thunder) #5

try this

textures/yourfolder/your texture
{
	cull disable
	nomipmaps
	nopicmip
	surfaceparm nomarks
	surfaceparm alphashadow
	surfaceparm pointlight
	surfaceparm trans
      surfaceparm nonsolid
	implicitMask -
      
}

(Yatta) #6

Thanks, the problem was solved by using TGA alpha instead of trying to enforce it with blending.
Sorry I cant (or dont know how to) edit the title to mark it “solved”.