Quake 3 BSP [Using BSP Nodes, Leaves
& VisData]
Author bkenwright@xbdev.net
Its a really nice rendering the whole, level, but we could do that with any
format! 3ds, x, obj etc. Now we will take a look at the Quake BSP
Map additional level data. As the name says 'BSP' = 'Binary Space
Partitioning', it divides our world up into sections. The sections are
split along planes. These planes can be done at run time, but its slow and
can't always guarantee that it will be what we want, so the Quake BSP has these
subdivisions generated for us in a package and saved in the file format.
The information that where interested in for visual rendering, is the Nodes,
Leaves and VisData. The VisData is for the PVS camera rendering.
Depending on which room where in, determines which wall we can possibly see.
As if where in one of the little side rooms, then we can't see the other side
rooms, so we don't need to render them, this is where the VisData (PVS) comes
into play.
I've added additional code so you can see how the BSP system works.
Drawing the various plane subdivisions while you walk around, and as you cross
the various planes you'll notice how the rendering of the different level parts
change. This is done using either a single point, or a line which crosses
the planes, and of course multiple lines.
In the final version you would only use the VisData (PVS) method as this is
the solution.
Using a simple file 'test_level.bsp' and of
course some simple level textures for the walls and floor. You can
switch between a top view so you can monitor the various rendering of the
different section levels.
Or switch between first person so you can walk around the level like you
would in a real first person shooter-up.
|
Download Source Code
(321kb) |
|