From f95076984f725d8860f0a41e9086acbf12684456 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Sun, 11 May 2014 22:59:21 +0200 Subject: [PATCH] Shadow LOD fix for parallel lights --- neo/renderer/tr_frontend_addlights.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/neo/renderer/tr_frontend_addlights.cpp b/neo/renderer/tr_frontend_addlights.cpp index 764e2732..726ee711 100644 --- a/neo/renderer/tr_frontend_addlights.cpp +++ b/neo/renderer/tr_frontend_addlights.cpp @@ -302,13 +302,15 @@ static void R_AddSingleLight( viewLight_t* vLight ) } flod *= numLods; + + if( flod < 0 ) + { + flod = 0; + } + lod = idMath::Ftoi( flod ); - if( lod < 0 ) - { - lod = 0; - } - else if( lod >= numLods ) + if( lod >= numLods ) { //lod = numLods - 1; } @@ -329,7 +331,7 @@ static void R_AddSingleLight( viewLight_t* vLight ) } // never give ultra quality for point lights - if( lod == 0 && light->parms.pointLight ) + if( lod == 0 && light->parms.pointLight && !light->parms.parallel ) { lod = 1; }