Jump to content

Transparent shader acting oddly


Recommended Posts

I set up my skin with some textures with alpha applied in areas along with a shader so the parts aren't visible ingame. It works, only the textures that have this shader also show other things in the map through them.

 

The skin has alpha and the shader on the head and legs to hide some parts (which works) but it also makes other shaders in the map (and players too I think) visible through it:

 

alpha.png?dl=0

 

 

The shader:

models/players/mara_khaal/head
{
	{
		map models/players/mara_khaal/head
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen lightingDiffuse
	}
}

models/players/mara_khaal/legs
{
	{
		map models/players/mara_khaal/legs
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen lightingDiffuse
	}
}

Before, I was using blendFunc GL_ONE GL_ZERO (same as no blendFunc) and alphaFunc GE128, which worked fine, but Xycaleth said it wasn't good for performance

Link to comment

Yep, that worked, didn't seem to need an alphaGen. However, the legs have gone a bit weird, the back of the boot shafts are completely transparent:

 

 

legalpha.png?dl=0

 

models/players/mara_khaal/boots
{
	{
		map models/players/mara_khaal/boots
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen lightingDiffuse
		depthWrite
	}
}

models/players/mara_khaal/legs
{
	{
		map models/players/mara_khaal/legs
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen lightingDiffuse
		depthWrite
	}
}

I think it has something to do with the fact that I used 2 textures for the legs: One for the 'skin' and boots' foot part (legs.png), the other for the boot boot shaft (boots.png).

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