From 24bcf9bf9aa3de0f16d36934a011dd95f0f8dafe Mon Sep 17 00:00:00 2001 From: vortex Date: Sun, 17 Oct 2010 22:26:24 +0000 Subject: [PATCH] Fix sprites whose name begins from ! (assumed lit sprites) to be actually lit with modellight/lightgrid, they are still not lit by realtime lightning at all. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10545 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=6ce1bf66db6a9a49886ce9b929bedbb89841cebd --- r_sprites.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/r_sprites.c b/r_sprites.c index 64401e40..fbcd8b36 100644 --- a/r_sprites.c +++ b/r_sprites.c @@ -384,6 +384,10 @@ void R_Model_Sprite_Draw_TransparentCallback(const entity_render_t *ent, const r frame = model->sprite.sprdata_frames + ent->frameblend[i].subframe; texture = R_GetCurrentTexture(model->data_textures + ent->frameblend[i].subframe); + // lit sprite by lightgrid if it is not fullbright, lit only ambient + if (!(texture->currentmaterialflags & MATERIALFLAG_FULLBRIGHT)) + VectorAdd(ent->modellight_ambient, ent->modellight_diffuse, rsurface.modellight_ambient); + // SPR_LABEL should not use depth test AT ALL if(model->sprite.sprnum_type == SPR_LABEL || model->sprite.sprnum_type == SPR_LABEL_SCALE) if(texture->currentmaterialflags & MATERIALFLAG_SHORTDEPTHRANGE) -- 2.39.2