From 2abaf27cdcb0bfc53669194ebf27a94a91379e29 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 12 Aug 2002 15:36:52 +0000 Subject: [PATCH] attempt to fix the dark models at centers of dlights --- libs/video/renderer/gl/gl_mod_alias.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/video/renderer/gl/gl_mod_alias.c b/libs/video/renderer/gl/gl_mod_alias.c index 6c27b258c..ed172a077 100644 --- a/libs/video/renderer/gl/gl_mod_alias.c +++ b/libs/video/renderer/gl/gl_mod_alias.c @@ -543,10 +543,12 @@ R_DrawAliasModel (entity_t *e, qboolean cull) for (lnum = 0; lnum < r_maxdlights; lnum++) { if (r_dlights[lnum].die >= r_realtime) { + float d; + VectorSubtract (e->origin, r_dlights[lnum].origin, dist); - add = ((r_dlights[lnum].radius - * r_dlights[lnum].radius * 8) - / DotProduct (dist, dist)); // FIXME Deek + d = DotProduct (dist, dist); + d = max (d, 1); + add = r_dlights[lnum].radius * r_dlights[lnum].radius * 8 / d; if (add > 0) { VectorMA (ambientcolor, add, r_dlights[lnum].color,