Question about BSP tree

Started by
4 comments, last by Erik Rufelt 13 years, 1 month ago
Recently, I'm learning game scene management, and especially on BSP tree and Quad tree & octree. I've come across this question.


As I learned from some paper work, I know that, in a scene, we can make a bsp tree and put polygons into the nodes or leaves to accelerate rendering. But in a real game scene, there's not only one big model. For example, a big church, it is a model, and there're also many other things in it, e.g. desks or chairs, of cause they're with different VB, IB and materials. So if we look the models as sets of polygons, and divide the sets into nodes' polygon-lists, when rendering, we'll keep changing VB, IB and materials, that will be a waste of time, isn't it? Or is there something I misunderstood? Or there's many bsp trees in a scene, and one model, one bsp tree?
Advertisement
BSP trees aren't used like that anymore, and haven't been for a long time. When drawing with modern 3D hardware you don't use BSP trees to sort triangles, but usually choose whether or not to render the entire church, or all the desks in a room, using a portal or octree or similar. As you say, it's a waste of time to change states and use more draw-calls. 15 years ago this wasn't the case, as skipping a few triangles or pixels could save more time than a couple of state-changes, but that isn't the case anymore.

BSP trees aren't used like that anymore, and haven't been for a long time. When drawing with modern 3D hardware you don't use BSP trees to sort triangles, but usually choose whether or not to render the entire church, or all the desks in a room, using a portal or octree or similar. As you say, it's a waste of time to change states and use more draw-calls. 15 years ago this wasn't the case, as skipping a few triangles or pixels could save more time than a couple of state-changes, but that isn't the case anymore.

So what you mean is we just use quad tree or octree to decide whether the bounding volume is in the node which is in the frustum? So nowadays there's no meaning to use bsp tree for pvs????
There are many different techniques, but yes.
You could still use a BSP or similar to quickly find your current position for a precomputed PVS. Which method works depend a lot on your type of map.

BSP trees aren't used like that anymore, and haven't been for a long time. When drawing with modern 3D hardware you don't use BSP trees to sort triangles, but usually choose whether or not to render the entire church, or all the desks in a room, using a portal or octree or similar. As you say, it's a waste of time to change states and use more draw-calls. 15 years ago this wasn't the case, as skipping a few triangles or pixels could save more time than a couple of state-changes, but that isn't the case anymore.

Besides, what I'm considering is if the church is super big and very complex, but only a little part will be seen by camera, then what should we do?

[quote name='Erik Rufelt' timestamp='1300353659' post='4786921']
BSP trees aren't used like that anymore, and haven't been for a long time. When drawing with modern 3D hardware you don't use BSP trees to sort triangles, but usually choose whether or not to render the entire church, or all the desks in a room, using a portal or octree or similar. As you say, it's a waste of time to change states and use more draw-calls. 15 years ago this wasn't the case, as skipping a few triangles or pixels could save more time than a couple of state-changes, but that isn't the case anymore.

Besides, what I'm considering is if the church is super big and only a little part will be seen by camera, then what should we do?
[/quote]

You could try something like this:
Divide the outside of the church into a few pieces, and draw each piece that is in the cameras view, and not completely on the other side of the building than the camera.
If you have several different rooms inside the church with only small openings between them, make portals at the doors and draw every room where you can see a portal into that room.
If the whole inside is one open room (like churches often are, more or less), then you just have the whole inside as a single model (or a few pieces like the outside), and draw it whenever the camera is inside or you see a portal for a door to enter the church.

This topic is closed to new replies.

Advertisement