Topics: General
Mar 27, 2007 at 1:39 AM
Great code! Could you offer some details on the state of BSP and what is left to do?
Mar 27, 2007 at 4:40 AM
Well, I've added some code to decide where in a group of triangles to make each split, and I've decided to split based on vertices per leaf node, not the usual convex set logic. My idea there is that the video card will probably work more effciently rendering 'beefy' nodes that 'correct' nodes - and that's okay because I don't plan on reusing this structure for collision detection.

Optimally what I would like to do is not store any node-to-node visiblity, and instead use the BSP tree and bounding frustum to render until some hardware depth check tells me I've hit solid walls, but I don't think XNA supports that yet.

I have not put the focus on the BSP tree yet because I don't have a large .3dw file to test it out on - I'm working on that right now actually, It's a large highway scene that has a tunnel, some over passes, embankments, and road debris. Hopefully this will be a mix of indoor/outdoor brushes with terrain and mesh placement. I'll use this when I'm done to play around with BSP trees and maybe investigate other partioning structures as well.

If you have any expertise or advice, I'd love to hear it!

Otherwise I'm fixing importing bugs (terrain and meshes don't work right now), thinking about adding a scale factor (so all imported positions equate to fractional values - design in whole centimeters, play in standard meters), and perfecting hidden surface removal which 3DWS actually has for me :)
Mar 27, 2007 at 9:15 PM
Thanks johnny lightbulb I am a professional 3D artist, and could make you some assets if that helps at all. Great job BTW! I am currently building a game in another development platform, but have been wooed by the possibility of XBOX 360 development, and being in a no-excuses solution, which is where I think XNA devel is going.

Is BSP CSG dependent? Is a BSP solution possible with concave geometry?

Mar 28, 2007 at 2:36 PM
Thanks for the art offer :) Right now I don't have any specific need, but a large/complex/detailed map that might help me test partitioning and other features would be much appreciated :) I understand that's a large order!

I don't think BSP trees are dependent on CSG type maps or even convex geometry. You can have non-CSG style editors and concave geometry and still break it into a BSP tree. In fact, in my implementation I've removed all brushes and broken them, including the terrain into a collection of triangles. I then throw that collection into a splitting algorithm and split down to x,000 vertex nodes, each node having either concave, convex, or both in terms of shapes.

I think engines that break all nodes down to the simplest convex geometry possible are losing importance; it's quicker to give my 3D card few large batches than to do my best to never give it triangles it won't render.
Apr 11, 2007 at 4:03 PM

Johnnylightbulb wrote:
Thanks for the art offer :) Right now I don't have any specific need, but a large/complex/detailed map that might help me test partitioning and other features would be much appreciated :) I understand that's a large order!


Have you tried the complex sample from off the Leadworks site?, I have downloadd the simple and complex sample from there (although not opened them yet) and they seem very good.

Apr 11, 2007 at 6:31 PM
Hmmm... I hadn't noticed those links - I'll include those in my testing. Right now I'm not spending any time on this project, as life has taken over. This weekend, I hope to get the BSP stuff working just a bit.

Thanks for the link!
Apr 13, 2007 at 10:37 PM
Edited Apr 13, 2007 at 10:39 PM
Sounds good :). As fate would have it, I am also going to be attempting to fix the BSP code this weekend in my project ;). I implemented collision detection but the beefy nodes are bogging the system so I plan to attempt to implement correct BSP behavior ;).

In my project I have the code implemented within a scene graph based system and I have a nice camera class. I also implemented swept sphere collision detection which seems to work. I spent quite a while figuring out how to get meshes to render but I got them working as well (currently I just render them with the basic effect shader and not the actual shader but that will change very soon).

Here is a screenshot:

I am not an expert, but perhaps we can work together in the near future. I could use the experience and I know my way around C# ;).

Apr 14, 2007 at 1:30 AM
Wow! Neato models, too. When you say 'beefy' nodes, do you know where your CPU time was being spent? (Maybe something I can try to avoid)
Apr 14, 2007 at 3:11 AM
Edited Apr 14, 2007 at 3:15 AM
I second that, the cyber guy model looks great, did you do that in another modelling tool?, blender or max?

Or did you do what the rest of us usually do and nab it from somewhere else?, lol.

Oh and I finally got round to installed 3D world studio, played arround with it and loaded the default samples and the complex sample off the site. The complex one is massive!!!!.

Although I tried exporting the default sample (just a simple house) to .X and it causes the DirectX viewer to crash?? ever heard of anything like that?
Will try and find some real time to properly test out the 3DWS importer soon hopefully, unless Life interferes again#!
Apr 14, 2007 at 7:39 PM
Oh the model is made by my artist :). It seems like the BSP nodes are very very large and as a result my collision detection is having to process way more polygons then it should need to at any given time. I know you didn't intend for the BSP tree to be used in collision detection but for my purposes it will make things much easier.

So far it seems that in the PartioningHelper you sort of skipped the convex logic and just return true (which means the BSP tree doesn't work like it should).

I am attempting to fix it but right now Visual C# is giving me trouble when it comes to compiling :\.
Apr 16, 2007 at 9:05 PM
I traced the errors to a few factors, the main bit being that if we generate a dividing plane, your code had no method to handle polygons that spanned the dividing plane which in my case causes an infinite loop.

I am currently in the process of making code to divide faces by dividing planes.
Apr 17, 2007 at 3:27 PM
It looks like my source code has been wiped, and I'll have to rebuild from my copy :( There goes the HL2 map loading code.... Donald, if you would like I can add you so you can check in code too ?
Apr 19, 2007 at 5:10 AM
Sure thing :). I might have a copy of your HL2 map loading code (although it might be an older copy) if you need it.