Jump to content

Just looking for a quick answer with transparent images being RGB'd


Go to solution Solved by Ruxith,

Recommended Posts

Posted

So I tried my normal process for making an image RGB'd, which involves creating a mask for the RGB area and exporting as a png, however this time around i'm trying it with an image which has an area which needs to be transparent to begin with, so ontop of my normal RGB shader I added "alphaFunc GE192" so that it would allow the texture to be transparent, but instead it just makes the rgb area transparent too. I've also tried mapping the texture without rgb and having the transparent shader line, with the rgb textures mapped afterwards and it just shows the RGB in effect but without the transparency. Adding the transparency to the RGB mapped lines doesn't work either.

 

Here's my 2 shaders, if someone could let me know what I need to do to get RGB working on a transparent texture i'd be very greatful.

Thanks

 

Shader with transparent texture, and rgb texture mapped inside the shader:

 

 

models/players/jeslyn/amone/lower6
{
cull twosided
{
map models/players/jeslyn/amone/lower6
blendFunc GL_ONE GL_ZERO
alphaFunc GE128
rgbGen lightingDiffuse
}
{
map models/players/jeslyn/amone/lower6r
blendFunc GL_ONE GL_ZERO
rgbGen lightingDiffuseEntity
}
{
  map models/players/jeslyn/amone/lower6r
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen lightingDiffuse
}
{
map gfx/models/jeslyn/lower6_spec
blendFunc GL_SRC_ALPHA GL_ONE
detail
alphaGen lightingSpecular
}
}

 

Shader with one texture, transparent and an rgb mask:

 

 

models/players/jeslyn/amone/lower6
{
cull twosided
{
map models/players/jeslyn/amone/lower6
blendFunc GL_ONE GL_ZERO
alphaFunc GE128
rgbGen lightingDiffuseEntity
}
{
  map models/players/jeslyn/amone/lower6
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
alphaFunc GE128
rgbGen lightingDiffuse
}
{
map gfx/models/jeslyn/lower6_spec
blendFunc GL_SRC_ALPHA GL_ONE
detail
alphaGen lightingSpecular
}
}

 
I don't know enough about shader properties to know the solution.
This is what the texture looks like, the greyish area needs to be RGB'd:

1078lnb.jpg

Posted

You should very rarely need to use alphaFunc, especially for player models. It's also bad for performance.

 

This should work:

 

models/players/jeslyn/amone/lower6
{
  cull twosided
  {
    map models/players/jeslyn/amone/lower6
    blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
    rgbGen lightingDiffuseEntity
  }
  {
    map gfx/models/jeslyn/lower6_spec
    blendFunc GL_SRC_ALPHA GL_ONE
    detail
    alphaGen lightingSpecular
  }
}
  • Solution
Posted

Ah I didn't know that, worth noting thanks. I presumed the alphaFunc was how chewbacca's shader looked, I don't know why I assumed that but I just checked and I was wrong :P

I tried your suggestion but it didn't help, here's an image reel of the shader outcomes, i'm almost there with using the shader for the chewbacca (just a change in the blendFunc's in comparison to your shader suggestion) except it RGBs the whole visible area of the texture:

2a5n1c8.jpg

 

The image used was the same one I posted above, when I add a layer transparency mask to the RGB area of the image, it simply reverts to the first result, where the RGB area is transparent.

(sorry for spelling your name wrong I rushed the pic!)

 

Edit:

Fixed it, although your shader didn't fix it, it put me in the right direction, thanks man.

 

elb3b8.jpg

 

For anyone else who wants to look into making a model part that has transparency and making it RGB'd, here's my shader file:

 

 

 models/players/jeslyn/amone/lower6
{
		cull twosided
	{
		map models/players/jeslyn/amone/lower6
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen lightingDiffuse
	}
	{
		map models/players/jeslyn/amone/lower6b
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen lightingDiffuseEntity
	}
	{
		map gfx/models/jeslyn/lower6_spec
		blendFunc GL_SRC_ALPHA GL_ONE
		detail
		alphaGen lightingSpecular
	}
}

 

 

Basically you need your transparent image as the main texture, then you map your RGB file (only your RGB area visible in the image) and that's where the "lower6b" will go in the shader file. No fancy pngs with layer transparency masks are needed.

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