How come some spriteshaders pulse and some don't ?


(Svartberg.) #1

Ravaging through the various sprites which hover above the characters, i’ve noticed that some pulse (in/out) and some stay solid.

I tried checking this in depth, but it seems shaders are ussually used three times, the declaration, the register and the actual place in the code which calls for them.

They should all act the same, yet some pulse. (you guessed it, i don’t want one of them to pulse).

Is the reason for this in the sprite itself, say, if a sprite .tga has a certain background does it pulse differently ?

Thanks in advance


(Lanz) #2

Check the shader for the sprite and you will probably find “alphagen wave sin …”, remove that and it will stop pulsing. Look in the sprites.shader for more info.


(Svartberg.) #3

Hrrm i’ve looked for these things, but didn’t find anything.

I’ll tell you what i did, i tested on the spawn sprite, and i change the register of the Invincibility shader to a different sprite, what i got was when ppl spawned they had a different sprite on their head but it was pusling :


	//cgs.media.spawnInvincibleShader = trap_R_RegisterShader( "sprites/shield" );
	cgs.media.spawnInvincibleShader = trap_R_RegisterShader( "sprites/construct" );

Thanks in advance


(Lanz) #4

It’s there, take another look. Open up sprites.shader in the etmain/scripts folder and you will see the differance:


sprites/shield
{
	nocompress
	nopicmip
	{
		map sprites/icon_shield.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbgen vertex
	}
}

sprites/construct
{
	nocompress
	nopicmip
	{
		map sprites/construct.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphagen wave sin .6 .5 .5 .25  <---- this line creates the pulse
	}
}


(Svartberg.) #5

Man, thank you so much - it was the last place i would ever look for it. (i wasn’t even aware of the scripts there)
It works pretty well now, tested it with another client too.

Thanks again, cya :slight_smile: