mirror of
https://github.com/UberGames/RPG-X2.git
synced 2024-11-21 20:11:21 +00:00
fx_plasma
This should do bit it doesn't, lol Signed-off-by: Harry Young <hendrik.gerritzen@googlemail.com>
This commit is contained in:
parent
7483478a6f
commit
614cb686bc
7 changed files with 121 additions and 17 deletions
|
@ -1685,17 +1685,14 @@ Create directed and scaled plasma jet
|
||||||
===========================
|
===========================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*void CG_Plasma( vec3_t start, vec3_t end, vec4_t startRGBA, vec4_t endRGBA )
|
void CG_Plasma( vec3_t start, vec3_t end, vec3_t sRGB, vec3_t eRGB, int startalpha, int endalpha )
|
||||||
{
|
{
|
||||||
vec3_t v, sp, sRGB, eRGB;
|
vec3_t v, sp;
|
||||||
float detail, len, salpha, ealpha;
|
float detail, len, salpha = (startalpha / 255) , ealpha = (endalpha / 255);
|
||||||
|
|
||||||
detail = FX_DetailLevel( start, 16, 1200 );
|
//detail = FX_DetailLevel( start, 16, 1200 );
|
||||||
if ( detail == 0 )
|
//if ( detail == 0 )
|
||||||
return;
|
// return;
|
||||||
|
|
||||||
salpha = Vector4to3( startRGBA, sRGB );
|
|
||||||
ealpha = Vector4to3( endRGBA, eRGB );
|
|
||||||
|
|
||||||
// Orient the plasma
|
// Orient the plasma
|
||||||
VectorSubtract( end, start, v );
|
VectorSubtract( end, start, v );
|
||||||
|
@ -1703,7 +1700,7 @@ Create directed and scaled plasma jet
|
||||||
VectorMA( start, 0.5f, v, sp );
|
VectorMA( start, 0.5f, v, sp );
|
||||||
|
|
||||||
// Stash a quad at the base to make the effect look a bit more solid
|
// Stash a quad at the base to make the effect look a bit more solid
|
||||||
FX_AddQuad( sp, v, NULL, NULL, len * 0.36f, 0.0f, salpha, salpha, sRGB, sRGB, 0.0f, 45.0f, 0.0f, 200, cgs.media.prifleImpactShader );
|
//FX_AddQuad( sp, v, NULL, NULL, len * 0.36f, 0.0f, salpha, salpha, sRGB, sRGB, 0.0f, 45.0f, 0.0f, 200, cgs.media.prifleImpactShader );
|
||||||
|
|
||||||
// Add a subtle, random flutter to the cone direction
|
// Add a subtle, random flutter to the cone direction
|
||||||
v[0] += crandom() * 0.04;
|
v[0] += crandom() * 0.04;
|
||||||
|
@ -1711,11 +1708,11 @@ Create directed and scaled plasma jet
|
||||||
v[2] += crandom() * 0.04;
|
v[2] += crandom() * 0.04;
|
||||||
|
|
||||||
// Wanted the effect to be scalable based on the length of the jet.
|
// Wanted the effect to be scalable based on the length of the jet.
|
||||||
FX_AddCylinder( start, v, len * 0.05, len * 2.0f, len * 0.16f, len * 0.32f, len * 0.40f, len * 0.64f,
|
FX_AddCylinder2( start, v, len * 0.05, len * 2.0f, len * 0.16f, len * 0.32f, len * 0.40f, len * 0.64f,
|
||||||
salpha, ealpha, sRGB, eRGB, 200, cgs.media.plasmaShader, 0.3f );
|
salpha, ealpha, sRGB, eRGB, 200, cgs.media.plasmaShader, 0.3f );
|
||||||
FX_AddCylinder( start, v, len * 0.05, len * 4.0f, len * 0.16f, len * 0.32f, len * 0.28f, len * 0.64f,
|
FX_AddCylinder2( start, v, len * 0.05, len * 4.0f, len * 0.16f, len * 0.32f, len * 0.28f, len * 0.64f,
|
||||||
salpha, ealpha, sRGB, eRGB, 200, cgs.media.plasmaShader, 0.2f );
|
salpha, ealpha, sRGB, eRGB, 200, cgs.media.plasmaShader, 0.2f );
|
||||||
FX_AddCylinder( start, v, len * 0.25, len * 8.0f, len * 0.20f, len * 0.32f, len * 0.02f, len * 0.32f,
|
FX_AddCylinder2( start, v, len * 0.25, len * 8.0f, len * 0.20f, len * 0.32f, len * 0.02f, len * 0.32f,
|
||||||
salpha, ealpha, sRGB, eRGB, 200, cgs.media.plasmaShader, 0.1f );
|
salpha, ealpha, sRGB, eRGB, 200, cgs.media.plasmaShader, 0.1f );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1802,7 +1802,7 @@ case EV_SHAKE_SOUND:
|
||||||
|
|
||||||
case EV_FX_PLASMA:
|
case EV_FX_PLASMA:
|
||||||
DEBUGNAME("EV_FX_PLASMA");
|
DEBUGNAME("EV_FX_PLASMA");
|
||||||
//CG_Plasma( cent->currentState.origin, cent->currentState.origin2, cent->currentState.angles, cent->currentState.angles2 ); // RGBA's
|
CG_Plasma( cent->currentState.origin, cent->currentState.origin2, cent->currentState.angles, cent->currentState.angles2, cent->currentState.weapon, cent->currentState.powerups );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EV_FX_STREAM:
|
case EV_FX_STREAM:
|
||||||
|
|
|
@ -1178,6 +1178,7 @@ typedef struct {
|
||||||
qhandle_t redRingShader;
|
qhandle_t redRingShader;
|
||||||
qhandle_t redRing2Shader;
|
qhandle_t redRing2Shader;
|
||||||
qhandle_t bigShockShader;
|
qhandle_t bigShockShader;
|
||||||
|
qhandle_t plasmaShader;
|
||||||
qhandle_t bolt2Shader;
|
qhandle_t bolt2Shader;
|
||||||
qhandle_t quantumRingShader;
|
qhandle_t quantumRingShader;
|
||||||
|
|
||||||
|
@ -2064,7 +2065,7 @@ void CG_CookingSteam( vec3_t origin, float radius );
|
||||||
void CG_ElectricFire( vec3_t origin, vec3_t normal );
|
void CG_ElectricFire( vec3_t origin, vec3_t normal );
|
||||||
void ForgeBoltFireback( vec3_t start, vec3_t end, vec3_t velocity, vec3_t user );
|
void ForgeBoltFireback( vec3_t start, vec3_t end, vec3_t velocity, vec3_t user );
|
||||||
void CG_ForgeBolt( centity_t *cent );
|
void CG_ForgeBolt( centity_t *cent );
|
||||||
void CG_Plasma( vec3_t start, vec3_t end, vec4_t startRGBA, vec4_t endRGBA );
|
void CG_Plasma( vec3_t start, vec3_t end, vec3_t sRGB, vec3_t eRGB, int startalpha, int endalpha );
|
||||||
void CG_ParticleStream( centity_t *cent );
|
void CG_ParticleStream( centity_t *cent );
|
||||||
void CG_TransporterStream( centity_t *cent );
|
void CG_TransporterStream( centity_t *cent );
|
||||||
void CG_ExplosionTrail( centity_t *cent );
|
void CG_ExplosionTrail( centity_t *cent );
|
||||||
|
|
|
@ -1374,6 +1374,7 @@ static void CG_RegisterGraphics( void ) {
|
||||||
cgs.media.nukeModel = trap_R_RegisterModel ( "models/weaphits/nuke.md3" );
|
cgs.media.nukeModel = trap_R_RegisterModel ( "models/weaphits/nuke.md3" );
|
||||||
cgs.media.bigShockShader = trap_R_RegisterShader( "gfx/misc/bigshock" );
|
cgs.media.bigShockShader = trap_R_RegisterShader( "gfx/misc/bigshock" );
|
||||||
//cgs.media.IMODMarkShader = trap_R_RegisterShader( "gfx/damage/burnmark2" );
|
//cgs.media.IMODMarkShader = trap_R_RegisterShader( "gfx/damage/burnmark2" );
|
||||||
|
cgs.media.plasmaShader = trap_R_RegisterShader( "gfx/misc/plasmanew" );
|
||||||
cgs.media.bolt2Shader = trap_R_RegisterShader( "gfx/effects/electrica" );
|
cgs.media.bolt2Shader = trap_R_RegisterShader( "gfx/effects/electrica" );
|
||||||
//cgs.media.holoOuchShader = trap_R_RegisterShader( "powerups/holoOuch" );
|
//cgs.media.holoOuchShader = trap_R_RegisterShader( "powerups/holoOuch" );
|
||||||
cgs.media.painBlobShader = trap_R_RegisterShader( "gfx/misc/painblob" );
|
cgs.media.painBlobShader = trap_R_RegisterShader( "gfx/misc/painblob" );
|
||||||
|
|
|
@ -801,7 +801,6 @@ localEntity_t *FX_AddQuad2( vec3_t origin, vec3_t normal, float scale, float dsc
|
||||||
FX_AddCylinder
|
FX_AddCylinder
|
||||||
|
|
||||||
Adds a cylinder to the FX wrapper render list
|
Adds a cylinder to the FX wrapper render list
|
||||||
Overloaded for RGB
|
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -870,6 +869,82 @@ localEntity_t *FX_AddCylinder( vec3_t start,
|
||||||
|
|
||||||
return(le);
|
return(le);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
===============
|
||||||
|
FX_AddCylinder2
|
||||||
|
|
||||||
|
Adds a cylinder to the FX wrapper render list
|
||||||
|
Overloaded for RGB
|
||||||
|
===============
|
||||||
|
*/
|
||||||
|
|
||||||
|
//NOTENOTE: The reigning king of parameters!
|
||||||
|
#define DEFAULT_ST_SCALE 1.0f
|
||||||
|
|
||||||
|
localEntity_t *FX_AddCylinder2( vec3_t start,
|
||||||
|
vec3_t normal,
|
||||||
|
float height,
|
||||||
|
float dheight,
|
||||||
|
float scale,
|
||||||
|
float dscale,
|
||||||
|
float scale2,
|
||||||
|
float dscale2,
|
||||||
|
float startalpha,
|
||||||
|
float endalpha,
|
||||||
|
vec3_t startRGB,
|
||||||
|
vec3_t endRGB,
|
||||||
|
float killTime,
|
||||||
|
qhandle_t shader,
|
||||||
|
float bias )
|
||||||
|
{
|
||||||
|
localEntity_t *le = CG_AllocLocalEntity();
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
if (!shader)
|
||||||
|
{
|
||||||
|
Com_Printf("FX_AddCylinder: NULL shader\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
le->leType = LE_CYLINDER;
|
||||||
|
le->refEntity.data.cylinder.height = height;
|
||||||
|
le->refEntity.data.cylinder.width = scale;
|
||||||
|
le->refEntity.data.cylinder.width2 = scale2;
|
||||||
|
|
||||||
|
le->startTime = cg.time;
|
||||||
|
le->endTime = le->startTime + killTime;
|
||||||
|
|
||||||
|
le->data.cylinder.height = height;
|
||||||
|
le->data.cylinder.dheight = dheight;
|
||||||
|
le->data.cylinder.width = scale;
|
||||||
|
le->data.cylinder.dwidth = dscale;
|
||||||
|
le->data.cylinder.width2 = scale2;
|
||||||
|
le->data.cylinder.dwidth2 = dscale2;
|
||||||
|
|
||||||
|
le->alpha = startalpha;
|
||||||
|
le->dalpha = endalpha - startalpha;
|
||||||
|
|
||||||
|
le->refEntity.customShader = shader;
|
||||||
|
|
||||||
|
le->refEntity.data.cylinder.bias = bias;
|
||||||
|
le->refEntity.data.cylinder.stscale = 1.0;
|
||||||
|
le->refEntity.data.cylinder.wrap = qtrue;
|
||||||
|
|
||||||
|
// set origin
|
||||||
|
VectorCopy ( start, le->refEntity.origin);
|
||||||
|
VectorCopy ( start, le->refEntity.oldorigin );
|
||||||
|
|
||||||
|
VectorCopy( normal, le->refEntity.axis[0] );
|
||||||
|
RotateAroundDirection( le->refEntity.axis, 0);
|
||||||
|
|
||||||
|
le->color[0] = startRGB[0];
|
||||||
|
le->color[1] = startRGB[1];
|
||||||
|
le->color[2] = startRGB[2];
|
||||||
|
le->color[3] = startalpha;
|
||||||
|
le->lifeRate = 1.0 / ( le->endTime - le->startTime );
|
||||||
|
|
||||||
|
return(le);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,34 @@ localEntity_t *FX_AddCylinder( vec3_t start,
|
||||||
float killTime,
|
float killTime,
|
||||||
qhandle_t shader,
|
qhandle_t shader,
|
||||||
float bias );
|
float bias );
|
||||||
|
localEntity_t *FX_AddCylinder2( vec3_t start,
|
||||||
|
vec3_t normal,
|
||||||
|
float height,
|
||||||
|
float dheight,
|
||||||
|
float scale,
|
||||||
|
float dscale,
|
||||||
|
float scale2,
|
||||||
|
float dscale2,
|
||||||
|
float startalpha,
|
||||||
|
float endalpha,
|
||||||
|
vec3_t startRGB,
|
||||||
|
vec3_t endRGB,
|
||||||
|
float killTime,
|
||||||
|
qhandle_t shader,
|
||||||
|
float bias );
|
||||||
|
localEntity_t *FX_AddCylinder( vec3_t start,
|
||||||
|
vec3_t normal,
|
||||||
|
float height,
|
||||||
|
float dheight,
|
||||||
|
float scale,
|
||||||
|
float dscale,
|
||||||
|
float scale2,
|
||||||
|
float dscale2,
|
||||||
|
float startalpha,
|
||||||
|
float endalpha,
|
||||||
|
float killTime,
|
||||||
|
qhandle_t shader,
|
||||||
|
float bias );
|
||||||
localEntity_t *FX_AddElectricity( vec3_t origin, vec3_t origin2, float stScale, float scale, float dscale,
|
localEntity_t *FX_AddElectricity( vec3_t origin, vec3_t origin2, float stScale, float scale, float dscale,
|
||||||
float startalpha, float endalpha, float killTime, qhandle_t shader, float deviation );
|
float startalpha, float endalpha, float killTime, qhandle_t shader, float deviation );
|
||||||
localEntity_t *FX_AddParticle( vec3_t origin, vec3_t velocity, qboolean gravity, float scale, float dscale,
|
localEntity_t *FX_AddParticle( vec3_t origin, vec3_t velocity, qboolean gravity, float scale, float dscale,
|
||||||
|
|
|
@ -1541,11 +1541,13 @@ void SP_fx_plasma( gentity_t *ent )
|
||||||
|
|
||||||
// Convert from range of 0-255 to 0-1
|
// Convert from range of 0-255 to 0-1
|
||||||
int t;
|
int t;
|
||||||
for (t=0; t < 4; t++)
|
for (t=0; t < 3; t++)
|
||||||
{
|
{
|
||||||
ent->startRGBA[t] = ent->startRGBA[t] / 255;
|
ent->startRGBA[t] = ent->startRGBA[t] / 255;
|
||||||
ent->finalRGBA[t] = ent->finalRGBA[t] / 255;
|
ent->finalRGBA[t] = ent->finalRGBA[t] / 255;
|
||||||
}
|
}
|
||||||
|
ent->startRGBA[3] = ent->s.weapon;
|
||||||
|
ent->finalRGBA[3] = ent->s.powerups;
|
||||||
|
|
||||||
VectorCopy( ent->s.origin, ent->s.pos.trBase );
|
VectorCopy( ent->s.origin, ent->s.pos.trBase );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue