From 9a741a07ec17c9a37015c5a84c92edfe5274dac6 Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 20 Dec 2009 13:11:18 +0000 Subject: [PATCH] implemented fogging for cl_decals_newsystem 1 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9606 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gl_rmain.c b/gl_rmain.c index a19cc83c..6cd86052 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -9120,6 +9120,25 @@ static void R_DrawModelDecals_Entity(entity_render_t *ent) if (numtris > 0) { r_refdef.stats.drawndecals += numtris; + + if (r_refdef.fogenabled) + { + switch(vid.renderpath) + { + case RENDERPATH_GL20: + case RENDERPATH_GL13: + case RENDERPATH_GL11: + for (i = 0, v3f = decalsystem->vertex3f, c4f = decalsystem->color4f;i < numtris*3;i++, v3f += 3, c4f += 4) + { + alpha = RSurf_FogVertex(v3f); + c4f[0] *= alpha; + c4f[1] *= alpha; + c4f[2] *= alpha; + } + break; + } + } + // now render the decals all at once // (this assumes they all use one particle font texture!) RSurf_ActiveCustomEntity(&rsurface.matrix, &rsurface.inversematrix, rsurface.ent_flags, rsurface.ent_shadertime, 1, 1, 1, 1, numdecals*3, decalsystem->vertex3f, decalsystem->texcoord2f, NULL, NULL, NULL, decalsystem->color4f, numtris, decalsystem->element3i, decalsystem->element3s, false, false); -- 2.39.2