NSRenderableEntity: Add RenderFX RFX_GLOWSHELL2, which is the same as RFX_GLOWSHELL, but

the glow effect has a 'cull back' rendering flag.
This commit is contained in:
Marco Cawthorne 2022-04-06 19:32:46 -07:00
parent a8c8938408
commit e08852284f
Signed by: eukara
GPG Key ID: C196CD8BA993248A
6 changed files with 39 additions and 1 deletions

View File

@ -113,6 +113,18 @@ Viewmodel_ApplyBob(entity gun)
strength = 240 - strength;
strength *= 0.005f;
#ifdef WASTES
float sprint;
if (pSeatLocal->m_iSprinting && vlen(pSeat->m_vecPredictedVelocity) > 240) {
pSeatLocal->m_flSprintLerp = bound(0.0f, pSeatLocal->m_flSprintLerp + clframetime, 1.0f);
} else {
pSeatLocal->m_flSprintLerp = bound(0.0f, pSeatLocal->m_flSprintLerp - clframetime, 1.0f);
}
sprint = 20 * pSeatLocal->m_flSprintLerp;
gun.angles[0] += sprint;
gun.angles[1] += sprint + (sprint * pViewBob->m_flBob) * 0.25f;
#endif
gun.angles[0] += strength * sintime;
gun.angles[1] += strength * sintime;
gun.angles[2] += strength * sintime;

View File

@ -41,6 +41,7 @@ font_s FONT_CON;
//var string g_shellchrome;
var float g_shellchromeshader;
var float g_shellchromeshader_cull;
/* clientside cvars */
var float autocvar_zoom_sensitivity = 1.0f;

View File

@ -119,6 +119,7 @@ CSQC_RendererRestarted(string rstr)
//g_shellchrome = spriteframe("sprites/shellchrome.spr", 0, 0.0f);
g_shellchromeshader = shaderforname("shellchrome", sprintf("{\ndeformVertexes bulge 1.25 1.25 0\n{\nmap %s\ntcMod scroll -0.1 0.1\ntcGen environment\nrgbGen entity\n}\n}", "textures/sfx/reflection.tga"));
g_shellchromeshader_cull = shaderforname("shellchrome2", sprintf("{\ncull back\ndeformVertexes bulge 1.5 1.5 0\n{\nmap %s\ntcMod scroll -0.1 0.1\ntcGen environment\nrgbGen entity\n}\n}", "textures/sfx/reflection.tga"));
/* end msg */
print("Graphical resources reloaded\n");

View File

@ -49,7 +49,8 @@ enum
RFX_CONSTANTGLOW = 14,
RFX_DISTORT = 15,
RFX_HOLOGRAM = 16,
RFX_GLOWSHELL = 19
RFX_GLOWSHELL = 19,
RFX_GLOWSHELL2 = 20
};
#endif

View File

@ -427,6 +427,22 @@ NSRenderableEntity::RenderFXPass(void)
drawflags = 7;
abslight = 128;
break;
case RFX_GLOWSHELL2:
/* make this entity shellchrome */
effects = EF_ADDITIVE;
fatness = 0;
colormod = m_vecRenderColor;
forceshader = g_shellchromeshader_cull;
alpha = 1.0;
/* copy entity into rendering queue */
addentity(this);
/* reset */
forceshader = 0;
fatness = 0;
colormod = [1,1,1];
alpha = 1.0f;
effects = 0;
break;
case RFX_GLOWSHELL:
/* make this entity shellchrome */
effects = EF_ADDITIVE;

View File

@ -565,6 +565,8 @@ prop_vehicle_driveable::RunVehiclePhysics(void)
new_origin *= 0.25f;
setorigin(this, new_origin);
PlayerAlign();
/* actiony stuff */
}
#ifdef SERVER
@ -604,6 +606,8 @@ prop_vehicle_driveable::Respawn(void)
if (m_eDriver)
PlayerLeave((base_player)m_eDriver);
SendFlags = -1;
}
#endif
@ -720,6 +724,9 @@ prop_vehicle_driveable::SendEntity(entity ePVSent, float flSendFlags)
WriteByte(MSG_ENTITY, ENT_VEH_4WHEEL);
WriteFloat(MSG_ENTITY, flSendFlags);
if (!modelindex)
return (false);
if (flSendFlags & VEHFL_DRIVER) {
WriteEntity(MSG_ENTITY, m_eDriver);
}