Test aggressive object culling
This commit is contained in:
@@ -17,12 +17,11 @@ lightsForGloom cfig w = mapMaybe getLS (IM.elems $ _lightSources w)
|
||||
cbox = cullBox cfig w
|
||||
cpos = _cameraCenter w
|
||||
getlsparam 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
|
||||
| not (pointInPolygon lpos cbox) && extraculltest = Nothing
|
||||
| otherwise = Just ( _lsPos ls, rad^(2::Int) , _lsCol ls)
|
||||
where
|
||||
lpos = xyV3 $ _lsPos ls
|
||||
rad = _lsRad ls
|
||||
fst2 (V3 a b _) = V2 a b
|
||||
extraculltest
|
||||
| _debug_cull_more_lights cfig = True
|
||||
| otherwise = isNothing (intersectSegPolyFirst lpos (lpos +.+ rad *.* (normalizeV (cpos -.- lpos))) cbox)
|
||||
|
||||
@@ -41,9 +41,13 @@ worldSPic cfig w =
|
||||
<> foldMap mcSPic (filtOn _mcPos _machines)
|
||||
where
|
||||
filtOn f g = IM.filter (pointIsClose . f) (g w)
|
||||
pointIsClose p = dist camCen p < 30 + _viewDistance w
|
||||
--pointIsClose p = dist camCen p < _viewDistance w
|
||||
pointIsClose = cullPoint w
|
||||
camCen = _cameraCenter w
|
||||
|
||||
cullPoint :: World -> Point2 -> Bool
|
||||
cullPoint w p = pointInPolygon p (_boundBox w)
|
||||
|
||||
extraShapes :: World -> Shape
|
||||
extraShapes = _foregroundShape
|
||||
|
||||
|
||||
Reference in New Issue
Block a user