Jump to content

Texture/Shader alpha transparency?


Recommended Posts

Posted

I ripped a hairstyle from another game, and it uses alpha transparency in some areas, essentially the texture is white/blank in those spots. Is there a way to use a shader to apply transparency to those areas?

Posted

Yes there are multiple options to do that actually.

It largely depends on the type of alpha channel used in the texture.

One option for the hair shader stage that gives soft, fading transparency:

	{
		map models/mymodel/hair.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen lightingDiffuse
	}

The other which gives you crisp hard egded transparency:

    {
        map models/mymodel/hair.tga
        alphaFunc GE128
        blendFunc GL_ONE GL_ZERO
        rgbGen lightingDiffuse
    }

And a third, also hard edged transparency option for if the result you get is the inverse of what you want (transparent hair, visible white spots):

    {
        map models/mymodel/hair.tga
        alphaFunc LT128
        blendFunc GL_ONE GL_ZERO
        rgbGen lightingDiffuse
    }

 

let me know if you need more help with this, just @ me ?

 

ooeJack and Psyk0Sith like this

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...