Gasmask on Helmet / Cap


(Berzerkr) #1

Thank you all for helping, the shader works now.
Also added the gasmask to other caps as prefab for skinners.
Feel free to use/change them the way you want.

Download the Gasmask Stuff here


(Cambodunum) #2

ja wen haben wir denn hier :wink:

im sorry i cant help you really much atm … im working on some maps … take a look at the “jason” skin … if im not wrong then it maybe helps you … i forgot the name of the skin … if ill find it anyday you will get it

greetz Cambo


(Berzerkr) #3

Hallo Cambo!

you mean meyerhorror.pk3, made by meyerinchains. afaik it’s replacing the helmet with a hockey mask.
Would be near the same as it’s now (gasmask part of the helmet).
RayBan told me it’s very time-consuming to add new meshes to an existing animated model.
Maybe someone can solve this detail or not.


(RayBan) #4

for blender it is, at least as far as i can tell, since the animations are ‘baked’
into the model, each frame is represented in blender, but you cannot add
a mesh to the existing baked one. i tried to parent the mask to the tag_teeth
but it just slipped and slid over the face since the head tilting, and jaw moving
cant be insync with the mask. if there was a way to parent the mask to a
single vertex, say the tip of the nose then it would be possible, but as far
as i know it cannot be done. maybe some other 3d editing program can do it.

the only way to do it in blender, is to delete all the frames, add the new mask
then add bones for the head, eyes, eyebrows… ect… and reanimate the whole
thing which is time consuming.


(Berzerkr) #5

Seems like it’s really way to much work for an small effect. :expressionless:


(carnage) #6

could you not remove the animations then add create some more basic ones of your own, since the mask is behind the head you might get away with not including any animations to the actul face and just concentrate on some simple head movements


(Berzerkr) #7

I can’t make models of my own, have no talent for this.
All I can do with model is to change the pathes to a texture or delete existing parts.


(Berzerkr) #8

Don’t want to start a new topic for this, figured out that the shader is a bit wrong and I can’t fix it for myself.

The texture of the gasmak is always shown before other things like fog and snow-splash.

Had a look into Q3Map2 Shader Manual and it seemed to me it’s the sort-thing.

Can please anybody fix the shader for me? I’m completley new at this.

models/players/temperate/axis/soldier/gasmask
{
	cull back
	sort underwater
	surfaceparm trans

	{
		map models/players/temperate/axis/soldier/gasmask.tga
		blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
		rgbGen lightingDiffuse
	}
}

EDIT:
I think it’s fixed with sort underwater. Looks not more like on the screenshots above. Edited the shader, too.
Is there a way to mix the values for sort together?


(S14Y3R) #9

I had that problem with a rotating wheel texture one time, I eventually got it running with this setup, so it does’t draw in front of everything:


models/players/temperate/axis/soldier/gasmask
{
	qer_editorimage odels/players/temperate/axis/soldier/gasmask.tga
	qer_alphafunc gequal 0.5
        cull back
	surfaceparm nomarks       
        surfaceparm trans 
	{
		map models/players/temperate/axis/soldier/gasmask.tga
		alphaFunc GE128
		rgbGen identity
	}
}

I haven’t checked out your dl yet, but give that a try, see how it looks.


(Berzerkr) #10

Works alot better than my shader. Thank you very much!!!
Figured out with my shader the gasmask is shown through fog, tested it with a demo of railgun.
With your shader it’s not longer shown through anything elese.

But now appeared a small problem:
The half-transparency of the eyeglasses is gone. :expressionless:

EDIT:
Made a few versions of the gasmask.tga with different values of transparency.
Above 50% the glasses are cutted out, under 50% there is no transparency. :?


(S14Y3R) #11

:oops: I forgot surfaceparm alphashadow (i think that’s correct one), should be above trans. :slight_smile:


(Berzerkr) #12

I try it with alphashadow. Never thought that such a small effect ends up in days of work.

Yesterday I used the script for transparent windows and it seemed this works, too. Have to test it a bit more.

models/players/temperate/axis/venom/gasmask
{
	qer_editorimage models/players/temperate/axis/venom/gasmask.tga
	cull back
	surfaceparm trans
	surfaceparm alphashadow
	surfaceparm pointlight
	implicitBlend -
	{
		map models/players/temperate/axis/venom/gasmask.tga
		rgbGen lightingDiffuse
	}
}

For what is pointlight good for? I see no difference if this is included in the shader or not.
Does implicitBlend - mean I can remove this line?


(S14Y3R) #13

Heh heh, seems its a switch to force vertex lighting and bypass lightmap?

Does it draw normally? or still drawing infront of everything.

implicitBlend - is a “default” shader, instead of manually setting blendfunc blend and rgbgen LD, you shouldn’t need it with your map/rgbgen specified. I’m surprised it works with both :slight_smile:

If you remove the implicitBlend - key, you’ll probably need to specify blendfunc blend above rgbGen lightingDiffuse. But that just takes you back to square one.

Should try your original shader again, but instead of

-blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
try blendFunc blend (is same as implicitBlend)

happy testing 8)


(DerSaidin) #14

Thats the alphaFunc GE128.

That line means if the alpha is greater than 128 (out of 256 or 255 or whatever) then it will round up to 256. If its less, it will be 0.

Just get rid of that line and it should blend nicely.


(Berzerkr) #15

      _(I)(I)_		FRITZ THE FROG SAYS:
     ( _ .. _ )		
      `.`--'.'		Never edit an existing shader and save it
       )    (		under the same filename!
   ,-./      \,-.	
  ( _( ||  || )_ )	
 __\ \\||--||'/ /__	
 `-._//||\/||\\_.-'	Remember kids:
      `--'`--'		Grey fog is called smog.

Some more rules for shaders who Fritz can say? :lol:

EDIT:
Edited my first posting, tested the whole thing and as far as I could see it was bugfree.


(kamikazee) #16

Tip: When altering an existing image, do save it with a new filename. Overriding W:ET textures with your pk3 is a no-go.

I once found out that the Stargate map replaced a W:ET texture causing other maps to have strange, darker textures.


(nUllSkillZ) #17

Instead of adding the whole mask to each frame of the head animation wouldn’t it make more sense to add a new tag to each frame of the animation?
Would reduce the work to copy/paste/rename because the new tag (“tag_mask”?) would be at the same position as “tag_helmet”(?).

Milkshape can’t handle tags’s.
Not sure about Blender.
Lightray3D does as far as I know.


(kamikazee) #18

Adding a tag might not work… AFAIK, there is no script/config file to just attach the mask to the player model.