From 57cc0f901ee6c61ceaf6ef40a40037443651878b Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Thu, 20 Apr 2006 16:52:39 +0000 Subject: [PATCH] Still some little improvements to flares. --- code/renderer/tr_flares.c | 6 +++++- code/renderer/tr_shader.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/code/renderer/tr_flares.c b/code/renderer/tr_flares.c index 51181c07..0779e48b 100644 --- a/code/renderer/tr_flares.c +++ b/code/renderer/tr_flares.c @@ -354,13 +354,17 @@ void RB_RenderFlare( flare_t *f ) { VectorScale(f->color, f->drawIntensity * tr.identityLight * intensity, color); // Calculations for fogging - if(f->fogNum) + if(f->fogNum < tr.world->numfogs) { tess.numVertexes = 1; VectorCopy(f->origin, tess.xyz[0]); tess.fogNum = f->fogNum; RB_CalcModulateColorsByFog(fogFactors); + + // We don't need to render the flare if colors are 0 anyways. + if(!fogFactors[0] && !fogFactors[1] && !fogFactors[2]) + return; } iColor[0] = color[0] * fogFactors[0]; diff --git a/code/renderer/tr_shader.c b/code/renderer/tr_shader.c index a4894595..dc5b7d70 100644 --- a/code/renderer/tr_shader.c +++ b/code/renderer/tr_shader.c @@ -3018,7 +3018,10 @@ static void CreateExternalShaders( void ) { int index; for(index = 0; index < tr.flareShader->numUnfoggedPasses; index++) + { tr.flareShader->stages[index]->adjustColorsForFog = ACFF_NONE; + tr.flareShader->stages[index]->stateBits |= GLS_DEPTHTEST_DISABLE; + } } tr.sunShader = R_FindShader( "sun", LIGHTMAP_NONE, qtrue );