From: havoc Date: Fri, 6 Apr 2007 12:48:52 +0000 (+0000) Subject: view models no longer receive stencil shadows (only basic light visibility culling... X-Git-Tag: xonotic-v0.1.0preview~3354 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=9e0a39f4d5add83a1c31892e0d523098979c5612 view models no longer receive stencil shadows (only basic light visibility culling like transparent surfaces receive), this makes the gun much more visible and protects it the player's own shadow, this change may is a major one and may get further changes (such as better culling perhaps) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7065 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index e616c3b3..67ee63e5 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -2714,6 +2714,8 @@ void R_UpdateTextureInfo(const entity_render_t *ent, texture_t *t) t->currentmaterialflags |= MATERIALFLAG_NOSHADOW | MATERIALFLAG_NOCULLFACE; if (ent->effects & EF_NODEPTHTEST) t->currentmaterialflags |= MATERIALFLAG_NODEPTHTEST | MATERIALFLAG_NOSHADOW; + if (ent->flags & RENDER_VIEWMODEL) + t->currentmaterialflags |= MATERIALFLAG_VIEWMODEL; if (t->currentmaterialflags & MATERIALFLAG_WATER && r_waterscroll.value != 0) t->currenttexmatrix = r_waterscrollmatrix; else diff --git a/model_brush.h b/model_brush.h index c4e3fb25..511c56f0 100644 --- a/model_brush.h +++ b/model_brush.h @@ -97,8 +97,10 @@ mplane_t; #define MATERIALFLAG_VERTEXTEXTUREBLEND 32768 // disables GL_CULL_FACE on this texture (making it double sided) #define MATERIALFLAG_NOCULLFACE 65536 +// render after the normal scene +#define MATERIALFLAG_VIEWMODEL 131072 // combined mask of all attributes that require depth sorted rendering -#define MATERIALFLAGMASK_DEPTHSORTED (MATERIALFLAG_BLENDED | MATERIALFLAG_NODEPTHTEST) +#define MATERIALFLAGMASK_DEPTHSORTED (MATERIALFLAG_BLENDED | MATERIALFLAG_NODEPTHTEST | MATERIALFLAG_VIEWMODEL) typedef struct medge_s {