mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 06:51:47 +00:00
Minor optimization for shadows, and make translucent objects have shadows matching their alpha.
This commit is contained in:
parent
942bf55c06
commit
463ac44d9f
1 changed files with 6 additions and 5 deletions
|
@ -619,25 +619,26 @@ R_DrawAliasModel (entity_t *e, qboolean cull)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modelalpha < 1.0)
|
|
||||||
qfglDepthMask (GL_TRUE);
|
|
||||||
|
|
||||||
qfglPopMatrix ();
|
qfglPopMatrix ();
|
||||||
|
|
||||||
|
// FIXME: Translucent objects should cast colored shadows
|
||||||
// torches, grenades, and lightning bolts do not have shadows
|
// torches, grenades, and lightning bolts do not have shadows
|
||||||
if (r_shadows->int_val && clmodel->shadow_alpha) {
|
if (r_shadows->int_val && clmodel->shadow_alpha) {
|
||||||
qfglPushMatrix ();
|
qfglPushMatrix ();
|
||||||
R_RotateForEntity (e);
|
R_RotateForEntity (e);
|
||||||
|
|
||||||
qfglDisable (GL_TEXTURE_2D);
|
qfglDisable (GL_TEXTURE_2D);
|
||||||
color_black[3] = (clmodel->shadow_alpha + 1) / 2;
|
qfglDepthMask (GL_FALSE);
|
||||||
|
color_black[3] = modelalpha * ((clmodel->shadow_alpha + 1) / 2);
|
||||||
qfglColor4ubv (color_black);
|
qfglColor4ubv (color_black);
|
||||||
|
|
||||||
GL_DrawAliasShadow (paliashdr, vo);
|
GL_DrawAliasShadow (paliashdr, vo);
|
||||||
|
|
||||||
|
qfglDepthMask (GL_TRUE);
|
||||||
qfglEnable (GL_TEXTURE_2D);
|
qfglEnable (GL_TEXTURE_2D);
|
||||||
qfglPopMatrix ();
|
qfglPopMatrix ();
|
||||||
}
|
} else if (modelalpha < 1.0)
|
||||||
|
qfglDepthMask (GL_TRUE);
|
||||||
|
|
||||||
Cache_Release (&e->model->cache);
|
Cache_Release (&e->model->cache);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue