mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
Set up shadevector for gl alias models.
The setup had been lost at some stage, thus shadows were always directly under the entity. Unlike the original quake shadow code, the vector is correctly transformed into the entity's space.
This commit is contained in:
parent
fbc0ad59df
commit
a7327acb80
1 changed files with 8 additions and 0 deletions
|
@ -678,6 +678,8 @@ gl_R_DrawAliasModel (entity_t *e)
|
|||
|
||||
// torches, grenades, and lightning bolts do not have shadows
|
||||
if (r_shadows->int_val && model->shadow_alpha) {
|
||||
mat4_t shadow_mat;
|
||||
|
||||
qfglPushMatrix ();
|
||||
gl_R_RotateForEntity (e);
|
||||
|
||||
|
@ -695,6 +697,12 @@ gl_R_DrawAliasModel (entity_t *e)
|
|||
color_black[3] = model->shadow_alpha;
|
||||
qfglColor4ubv (color_black);
|
||||
}
|
||||
shadevector[0] = 1;
|
||||
shadevector[1] = 0;
|
||||
shadevector[2] = 1;
|
||||
VectorNormalize (shadevector);
|
||||
Mat4Transpose (e->transform, shadow_mat);
|
||||
Mat4as3MultVec (shadow_mat, shadevector, shadevector);
|
||||
if (vo->tex_coord)
|
||||
GL_DrawAliasShadowTri (paliashdr, vo);
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue