raybans simple med/ammo icons


(=SC=Beef) #1

Hello

Using the above min-mod, i am attempting to edit the current graphics he has used, for an edited version (as seen below)

Obviously, the problem is that there looks like there is no alpha channel, however there IS, but the .shader for some reason is not working and utilizing the alpha channel as it should. Included below is the .shader and a screen shot.

All your help is appreciated.

// raybans simple med/ammo pickup shader
// just replacement icons for the ammo and med packs, that are lower in
// poly and more quake3 style for simple items.
// [email]raybanb@gmail.com[/email]

models/multiplayer/supplies/healthbox_icon
{
	cull none
	deformVertexes autoSprite
      {
		map models/multiplayer/supplies/healthbox_icon.tga
		rgbGen identity
	}
	{
		map textures/effects/envmap_slate_90.tga
		blendFunc GL_ONE GL_ONE
		tcGen environment
		rgbGen wave sin .3 .1 0 0.5
	}
	{
		map models/multiplayer/supplies/healthbox_icon.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
	}
}

models/multiplayer/supplies/ammobox_icon
{
	cull none
	deformVertexes autoSprite
      {
		map models/multiplayer/supplies/ammobox_icon.tga
		rgbGen identity
	}
	{
		map textures/effects/envmap_slate_90.tga
		blendFunc GL_ONE GL_ONE
		tcGen environment
		rgbGen wave sin .3 .1 0 0.5
	}
	{
		map models/multiplayer/supplies/ammobox_icon.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
	}
}

models/multiplayer/supplies/ammobox_icon2
{
	cull none
	deformVertexes autoSprite
      {
		map models/multiplayer/supplies/ammobox_icon2.tga
		rgbGen identity
	}
	{
		map textures/effects/envmap_slate_90.tga
		blendFunc GL_ONE GL_ONE
		tcGen environment
		rgbGen wave sin .3 .1 0 0.5
	}
	{
		map models/multiplayer/supplies/ammobox_icon2.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen lightingdiffuse
	}
}

(kamikazee) #2

Check the .tga’s alpha channel, and also take a look in the console. There could be some errors printed there.


(=SC=Beef) #3

one error, completely none related to this.
All .tga’s are saved as 32 bit (none compressed)
The original mod’s alpha channel didn’t work either, but because the icon was practically a 128*128 square anyway, its not noticeable.


(Tyrlop) #4

sorry for interupt u but… what is that skinpack you use? in the back ground :stuck_out_tongue: becaus they looks awesome :slight_smile:


(-SSF-Sage) #5

Yes the guys are really looking retard. :smiley: Sry but I had to… :stuck_out_tongue: If you use photoshop 7 (not sure about other versions): New picture -> Give it the size you want in power of 2 and make it transparent from same window. Then save it as tga, 32 bits. Then shaders and you are good to go!


(=SC=Beef) #6

well, they are 32 bit with alpha… thats what im trying to say, i think ill upload the pk3.

/off topic

Tyrlop, skin pack? its default except the HUD faces, i made all the guys dirty, but put my settings too low to actually be able to see it :stuck_out_tongue:


(kamikazee) #7

I think you need to overwrite the first stage with the third stage for a try, so the shader would look like this:

models/multiplayer/supplies/healthbox_icon
{
   cull none
   deformVertexes autoSprite
   {
      map models/multiplayer/supplies/healthbox_icon.tga
      blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
      rgbGen identity
   }
   {
      map textures/effects/envmap_slate_90.tga
      blendFunc GL_ONE GL_ONE
      tcGen environment
      rgbGen wave sin .3 .1 0 0.5
   }
}

The shader you posted seems to draw an opaque version of the icon, the environment map and then the translucent version of the icon. I think Rayban did this to have an environment map effect on the little square, but not on the icon.

EDIT: Hmmm, images still do weird things with this forum. I think they need to be smaller, or links.


(PAV) #8

if you use paintshop pro, I understand your problem better. Use gimp to create an alpha channel for your tga picture.


(RayBan) #9

ok… just noticed this post… you want the red cross to show only?
if thats the case, you need to make a new shader, and ignore the one i have
for the models, since they will not allow transparent alpha channel, they do
use an alpha channel, but its to allow the slate to work.

i would say something like,


models/multiplayer/supplies/healthbox_icon
{
  	cull disable
	implicitMask models/multiplayer/supplies/healthbox_icon.tga 
}

or something like that should work… im just winging it, but you cant use
the stock shader i included to make it work.