From f365f18ee812a9b47f4de25af0c917b38caaadc1 Mon Sep 17 00:00:00 2001 From: justin Date: Fri, 17 Jun 2022 18:37:27 +0100 Subject: [PATCH] Slightly less aggressive culling of light sources --- src/Dodge/Render/Lights.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Dodge/Render/Lights.hs b/src/Dodge/Render/Lights.hs index e18eaaf60..cb5244cbe 100644 --- a/src/Dodge/Render/Lights.hs +++ b/src/Dodge/Render/Lights.hs @@ -15,10 +15,13 @@ lightsForGloom cfig w = mapMaybe getLS (IM.elems $ _lightSources w) getLS = getlsparam . _lsParam getTLS = getlsparam . _tlsParam cbox = cullBox cfig w + cpos = _cameraCenter w getlsparam ls - | not (pointInPolygon lpos cbox) = Nothing - | dist (_cameraCenter w) (fst2 $ _lsPos ls) > _viewDistance w + _lsRad ls = Nothing - | otherwise = Just ( _lsPos ls, _lsRad ls^(2::Int) , _lsCol ls) + | not (pointInPolygon lpos cbox) + && isNothing (intersectSegPolyFirst lpos (lpos +.+ rad *.* (normalizeV (cpos -.- lpos))) cbox) + = Nothing +-- | dist (_cameraCenter w) (fst2 $ _lsPos ls) > _viewDistance w + _lsRad ls = Nothing + | otherwise = Just ( _lsPos ls, rad^(2::Int) , _lsCol ls) where lpos = xyV3 $ _lsPos ls rad = _lsRad ls