Slightly less aggressive culling of light sources
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user