Advertisement

OpenGL BSP Tree Demo Online

Started by December 23, 2000 07:02 PM
14 comments, last by DaWizard 23 years, 11 months ago
I appreciate all the help I recieved in this forum. THIS FORUM ROCKS !!! Any how, I have a demo that seems to work fine on my PC (Pentium II, 350MHz, 128MB RAM, ATI 3D Rage Pro (8MB RAM) and Win98 (I''ve tried WinNT 4.0 too but the video card on that system was worse then mine). It uses Backface Culling to remove hidden surfaces and the surfaces that pass thru'' the BSP Tree''s tests are thrown into the Frustum Culling test. BTW: One of my buddies complained that the program GPFed on Win2K so be careful or don''t use it on Win2K. You can grab it from here. Please read the Readme.txt file for instructions and credits. Also, while running the demo press ''H'' to toggle the help screen which displays all the keys you can use. Let me know what kind of FPS you get on your system and of course the kind of system you have and obviously of any problems. There is one interesting thing I''ve noticed is that when lighting is turned on, you can sometimes see how the floor got split up by the splitting algorithm but it isn''t noticeable with the Textures on. If all goes well, I will release a fully commented version of my source code to the OpenGL community (NOTE: IT USES OOP) Enjoy. ------------------------ DaWizard ------------------------
------------------------------------------------DaWizardhttp://www.geocities.com/ahmadkabani------------------------------------------------
Hi there!

My System:

P3 450, 196 mb 100 MHZ FSB RAM
Geforce 256 DDR (Creative Annhilator Pro)
NVidia Detonator Drivers (dunno the vers right now, last official)
WinNT 4.0 SP6,

Result: (All options on, texturing, BFculling, Frustum Culling, Shading,...)

lowest: 290 FPS
highest: 370 FPS

nice work!
One Question: The BSP tree is built at loadingtime, right? guess so..

cya,
Phil



Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states
Visit Rarebyte! and no!, there are NO kangaroos in Austria (I got this question a few times over in the states ;) )
Advertisement
Works fine on Win2k.
Did you lock the FPS at 30 or something? thats the highest it goes with everything off and everything on.
Celeron433@541, 32mb TNT2.
Now, how about a tutorial to go with it....
Dual Celeron 366 OC 500
128 MB RAM
Voodoo5 5500 AGP
Windows 2000

not too bad

looks especially better with my 4x4 fsaa all you faithful 3dfx haters

i was playing with it in fullscreen mode and it killed my computer. Probably not your fault though, my RAM is junk. Hey and RAM prices fell through the floor so if anybody wants to buy RAM now is the time!
"This is stupid. I can't believe this! Ok, this time, there really IS a bug in the compiler."... 20 mins pass ..."I'M AN IDIOT!!!"
Athlon 1GHz
128MB
32MB GF2-GTS (ASUS)
Win98

42FPS avg w/ FSAA
85FPS avg w/o FSAA

All settings on

not a bad engine youve got goin there
a tutorial is something that would nodoubtably become usfull reccommend you spend the time to make one as i and others would benifit
still dont get bsp''s.....
Quantum: I haven't locked the FPS. I myself get 40 FPS with my PC (Pentium II, 350 MHz with an ATI 3D Rage Pro) with all options turned on (my card chokes on texture mapping). If I turn all textures off I get 60-70 FPS. If I turn off the info and FPS everything runs smoothly.

I had to use GLSetup in order to get whatever hardware support I could get for OpenGL. Also, I'm unfamiliar with TNT2 or its drivers. Any how, after a day or two of commenting, I will release the source code for everyone to play with -- that way you can decide for your self.

Also, the frustum culling code rejects a polygon only if the entire polygon falls out of the frustum. If I don't then it looks ugly because each wall is made of triangles and part of the wall disappears.

As for a tutorial, it would take a long time to come up with one. Fortunately, I've divided the source code among classes which makes it easier to follow, at least that's what I think. I had to go thru' tonnes of DirectX tutorials like the one on mr-gamemaker's site. I have included the relevant links in the credits section of the Readme.txt. Besides, the demo doesn't even scratch the surface of BSP trees Once I get some time on my hands (I have two Physics exams on Jan 6th), I might write one.

------------------------
DaWizard
http://members.home.com/ahmadkabani
http://www.geocities.com/ahmadkabani
------------------------


Edited by - DaWizard on December 23, 2000 11:49:44 PM
------------------------------------------------DaWizardhttp://www.geocities.com/ahmadkabani------------------------------------------------
Advertisement
phueppl1: First of all, I'm amazed at the speed of your video card!!! I've been looking into getting a powerful system with a kick-ass video card for doing graphics modelling and programming.

And yes, the BSP Tree is built at loading time. The polygon information is read from a text file (using NeHe's tutorial on loading a 3D world). I throw each polygon into a linked list and then throw that list into my BSP class.

BSP trees are useful for loading static worlds (it will work if the polygons translate along their plane too). I use the BSP tree traversal algorithm to determine the drawing order and to get rid of polygons that do not face the view point.


------------------------
DaWizard
http://members.home.com/ahmadkabani
http://www.geocities.com/ahmadkabani
------------------------


Edited by - DaWizard on December 23, 2000 12:01:35 AM
------------------------------------------------DaWizardhttp://www.geocities.com/ahmadkabani------------------------------------------------
PSioNiC: And I thought I was the only one having problems! The GL drivers for my ATI Card behave weirdly when I switch modes -- the screen flickers for about 3 seconds, then the resolution changes and finally everything works normally. With the original drivers I couldn''t even get fullscreen.


------------------------
DaWizard
http://members.home.com/ahmadkabani
http://www.geocities.com/ahmadkabani
------------------------
------------------------------------------------DaWizardhttp://www.geocities.com/ahmadkabani------------------------------------------------
Now that is really really weird.
I ran it again and did some tests.
I put lighting on, texturing on, frustrum culling & culling off. I get 30.0 FPS.
I turned culling & frustrum culling on, lighting and textures off. I pointed myself away from the world so 0 polygons were being drawn. And guess what: 30.0 FPS!!
Maybe its Win2k? I usually get at least 50FPS in games.
It can''t be my VSYNC cause the refresh rate is *checks*. Hmm... 60hz. That''s exactly double my FPS. Now this is getting weird...

Hmm... I run it in windowed mode and I get between 40 and 60 FPS.
solid framerate of 58... didn''t change much from that... only time it dipped was when I ran through the objects... i think i saw it drop to 43 then, but that was me trying as hard as I could(also I never stopped winamp)... good demo...

win2k
p2 400
tnt2
128 meg Ram

This topic is closed to new replies.

Advertisement