Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualHodgman

Posted 07 November 2013 - 04:11 PM

If you use a finer grid in that example, and if you first determine which cells are completely empty, then it works wink.png 

Still perform the same recursive algorithm where you step through each portal into the neighboring cells (ignoring empty cells), adding the planes you've crossed to a stack as you traverse the cells. It should work just the same as in the BSP-tree example, except with BSP you can have a bit more control over where these splitting planes are placed (often the level designers / map makers can manually place these portals as well as relying on the BSP-compiler to create them automatically). To get decent results, your cells will have to be small enough so that you get some empty cells between rooms/corridors.

 

Grey cells are empty (no geometry, so don't treat them as being neighbours that you can traverse).

Starting at the green cell in the centre picture, when we step downwards from there, we add the orange line to our stack of planes. When traversing further from there, we can never step back up over that orange line, so the corner ends up functioning as an occluder.

ahgjyQy.png

In a more complex level it ends up looking like this (Starting at "A", green is visible, grey are empty cells, white are not visible for "A")

pQoKwhE.png


#1Hodgman

Posted 07 November 2013 - 04:06 PM

If you use a finer grid in that example, and still perform the same recursive algorithm where you step through each portal, adding the planes you've crossed to a stack as you traverse the cells, then it works just the same as in the BSP-tree example, except with BSP you can have a bit more control over where these splitting planes are placed (often the level designers / map makers can manually place these portals as well as relying on the BSP-compiler to create them automatically).

Grey cells are empty (no geometry, so don't treat them as being neighbours that you can traverse).

Starting at the green cell in the centre picture, when we step downwards from there, we add the orange line to our stack of planes. When traversing further from there, we can never step back up over that orange line, so the corner ends up functioning as an occluder.

ahgjyQy.png

In a more complex level it ends up looking like this (Starting at "A", green is visible, grey are empty cells, white are not visible for "A")

pQoKwhE.png


PARTNERS