Jump to content

  • Log In with Google      Sign In   
  • Create Account

Question about BSP tree


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 sinfawkes   Members   -  Reputation: 103

Like
0Likes
Like

Posted 17 March 2011 - 02:49 AM

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?

Sponsor:

#2 Erik Rufelt   Crossbones+   -  Reputation: 3480

Like
0Likes
Like

Posted 17 March 2011 - 03:20 AM

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.

#3 sinfawkes   Members   -  Reputation: 103

Like
0Likes
Like

Posted 17 March 2011 - 04:03 AM

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????

#4 Erik Rufelt   Crossbones+   -  Reputation: 3480

Like
0Likes
Like

Posted 17 March 2011 - 04:05 AM

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.

#5 sinfawkes   Members   -  Reputation: 103

Like
0Likes
Like

Posted 17 March 2011 - 04:05 AM

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?

#6 Erik Rufelt   Crossbones+   -  Reputation: 3480

Like
0Likes
Like

Posted 17 March 2011 - 04:11 AM


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?


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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS