Slightly less aggressive culling of light sources

This commit is contained in:
2022-06-17 18:37:27 +01:00
parent cbfb417d21
commit f365f18ee8
+6 -3
View File
@@ -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