Fixes for alpha blending and dlights

This commit is contained in:
Ian 2023-10-24 11:07:51 -04:00
parent bc8b61e34f
commit 881e90d79f
5 changed files with 15 additions and 11 deletions

View file

@ -487,7 +487,7 @@ if (bits&(1<<i))
#endif
if (bits & U_EFFECTS)
ent->effects = MSG_ReadByte();
ent->effects = MSG_ReadShort();
else
ent->effects = ent->baseline.effects;

View file

@ -2228,7 +2228,7 @@ void QMB_MuzzleFlash(vec3_t org)
float size, timemod;
timemod = 0.04;
timemod = 0.08;
if(!(ISUNDERWATER(TruePointContents(org))))
{

View file

@ -85,6 +85,7 @@ void AddLightBlend (float r, float g, float b, float a2)
void R_RenderDlight (dlight_t *light)
{
#if 0
int i, j;
float a;
vec3_t v;
@ -92,6 +93,7 @@ void R_RenderDlight (dlight_t *light)
rad = light->radius * 0.35;
VectorSubtract (light->origin, r_origin, v);
if (VectorLength (v) < rad)
{ // view is inside the dlight
@ -100,11 +102,13 @@ void R_RenderDlight (dlight_t *light)
}
glBegin (GL_TRIANGLE_FAN);
glColor3f (light->color[0],light->color[1],light->color[2]);
//glColor4f(lightcolor[0]/255, lightcolor[1]/255, lightcolor[2]/255, 1.0f);
glColor4f (light->color[0]*0.2f,light->color[1]*0.2f,light->color[2]*0.2f, 1.0f);
//glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
for (i=0 ; i<3 ; i++)
v[i] = light->origin[i] - vpn[i]*rad;
glVertex3fv (v);
glColor3f (0,0,0);
//glColor3f (0,0,0);
for (i=16 ; i>=0 ; i--)
{
a = i/16.0 * M_PI*2;
@ -114,6 +118,7 @@ void R_RenderDlight (dlight_t *light)
glVertex3fv (v);
}
glEnd ();
#endif
}
/*
@ -123,6 +128,7 @@ R_RenderDlights
*/
void R_RenderDlights (void)
{
#if 0
int i;
dlight_t *l;
@ -131,7 +137,7 @@ void R_RenderDlights (void)
r_dlightframecount = r_framecount + 1; // because the count hasn't
// advanced yet for this frame
glDepthMask (0);
glDepthMask (GL_FALSE);
glDisable (GL_TEXTURE_2D);
glShadeModel (GL_SMOOTH);
glEnable (GL_BLEND);
@ -149,7 +155,8 @@ void R_RenderDlights (void)
glDisable (GL_BLEND);
glEnable (GL_TEXTURE_2D);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask (1);
glDepthMask (GL_TRUE);
#endif
}
@ -239,9 +246,6 @@ void R_PushDlights (void)
int i;
dlight_t *l;
if (gl_flashblend.value)
return;
r_dlightframecount = r_framecount + 1; // because the count hasn't
// advanced yet for this frame
l = cl_dlights;

View file

@ -1590,7 +1590,7 @@ void R_RenderScene (void)
GL_DisableMultitexture();
R_RenderDlights ();
//R_RenderDlights ();
R_DrawParticles ();

View file

@ -596,7 +596,7 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg)
if (bits & U_SKIN)
MSG_WriteByte (msg, ent->v.skin);
if (bits & U_EFFECTS)
MSG_WriteByte (msg, ent->v.effects);
MSG_WriteShort (msg, ent->v.effects);
if (bits & U_ORIGIN1)
MSG_WriteCoord (msg, ent->v.origin[0]);
if (bits & U_ANGLE1)