I've been fiddling around with trying to apply a specific shader (with an "alphagen wave sin" stage) to dead bodies so that the bodies disappear (fade out) instead of sinking into the floor (or, as is the case with my mod where they suddenly disappear, which is even worse).
I've added this bit of code to player_die() in g_combat.c:
self->s.time = level.time;
Where when someone dies, a timestamp is saved and transmitted to the client. On the client, in the CG_Players() function (in the file of the same name). I do this:
(note: the same is done for torso and head as well) I assumed that legs.shaderTime would properly set the starting point of the shader animation (the fade out) but it doesn't. It appears that this isn't the case, as the starting point of my alphagen sine differs every time I shoot an enemy (sometimes even inverted to how I want it, causing the body to suddenly disappear and fade into view). I've checked and cent->currentState.time does match the server-side level.time.
Does anyone know if I'm doing something wrong or if the shaderTime is bugged or something? I would love to be able to reliably set the starting point in the wave of my shader.