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
|
getLS = getlsparam . _lsParam
|
||||||
getTLS = getlsparam . _tlsParam
|
getTLS = getlsparam . _tlsParam
|
||||||
cbox = cullBox cfig w
|
cbox = cullBox cfig w
|
||||||
|
cpos = _cameraCenter w
|
||||||
getlsparam ls
|
getlsparam ls
|
||||||
| not (pointInPolygon lpos cbox) = Nothing
|
| not (pointInPolygon lpos cbox)
|
||||||
| dist (_cameraCenter w) (fst2 $ _lsPos ls) > _viewDistance w + _lsRad ls = Nothing
|
&& isNothing (intersectSegPolyFirst lpos (lpos +.+ rad *.* (normalizeV (cpos -.- lpos))) cbox)
|
||||||
| otherwise = Just ( _lsPos ls, _lsRad ls^(2::Int) , _lsCol ls)
|
= Nothing
|
||||||
|
-- | dist (_cameraCenter w) (fst2 $ _lsPos ls) > _viewDistance w + _lsRad ls = Nothing
|
||||||
|
| otherwise = Just ( _lsPos ls, rad^(2::Int) , _lsCol ls)
|
||||||
where
|
where
|
||||||
lpos = xyV3 $ _lsPos ls
|
lpos = xyV3 $ _lsPos ls
|
||||||
rad = _lsRad ls
|
rad = _lsRad ls
|
||||||
|
|||||||
Reference in New Issue
Block a user