Skip to main content
gamedev.net
🔒 Locked

BSP + PVS

Started by ciccio 6 replies 500+ views
Original Post
ciccio
ciccio
I need some info and help about BSP trees + PVS In particular I ''d like to know how I can build a BSP structure containing a 3d map using the PVS starting from a set of polygons,the fact is that I don''t find stuff about implementing a PVS Zcode
Zcode
monkeyman
monkeyman
I''m not exactly sure what the question is but I hope I can help.. the best way I found to do it was to create the BSP first, then calc the PVS from there..BSP''s are like fractals, you can divide the world into mini-BSP''s of any depth, then use those for the PVS..once you have the BSP you can seperate it into as many small chunks as you want, and determine which chunks are visible from any given chunk..I wouldn''t worry about the PVS until you have a working BSP structure though..


"Like all good things, it starts with a monkey.."
"Like all good things, it starts with a monkey.."
ciccio
ciccio
Thanks! However I have to ask you something else...
where can I find an example of an algorithm for
constructing PVS? I found only generic articles until
this moment, but I need some practical lines
Zcode
Thr33d
Thr33d
http://www.planetquake.com/quark/armin/index.shtm#Documentation
had some source code on qbsp for quake 1 and 2.
maybe this will help?

-mike

Edited by - thr33d on July 1, 2000 1:17:48 PM
ciccio
ciccio
many thanks!
other helps are well accepted

Zcode
Zcode
ciccio
ciccio
...of course I''m still doubtful!
I dont know the most important thing: what is the test I must do
in order to see which leafs are visible from each others?that is
how can I determine the PVSs (before storing it)? Every code example I found is a "bsp-reader" not "writer"...


Zcode
Zcode
monkeyman
monkeyman
once you have the BSP created calcing the PVS is fairly easy..before you can get into PVS''s I have to ask - do you have a working BSP model yet? you stated that all the code you could find was to read BSP''s, not create them..if you do have a BSP structure to work with, here would be the next steps:

Subdivide the BSP into a linked list of small mini-BSP''s..

Set all polygons within a mini-BSP to the same color(different color for each mini-BSP)..

Render the entire world from each mini-BSP, check every pixel on the screen to see which mini-BSP''s make it into the final view, use those pixels as an index for the other mini-BSP''s that are in the PVS..do this with each mini-BSP..

At the root of every mini-BSP have a pointer to a table of pointers to other mini-BSP''s..

When rendering determine which mini-BSP you''re in..check with all other mini-BSP''s in the PVS and render from the farthest back..

If you don''t have a working BSP creator you won''t get very far calcing the PVS(unless you''re not going to use BSP''s at all)..if you need some info on creating BSP''s check this out:

http://reality.sgi.com/bspfaq


"Like all good things, it starts with a monkey.."
"Like all good things, it starts with a monkey.."
DaJudge
DaJudge
I myself have a BSP-compiler/viewer up and running, but I don''t get the idea of the PVS-creation completely. You say that I am supposed to render the world from the view of one small BSP-tree, but if you do that for, let''s say a tree of five triangles, how can you say from where to render and how can you be sure that there is NO place inside th space of that BSP tree that enables you to see the other one if you render just ONE position?
Would be cool if you could help me with that one...

And if you know some good links I''d be VERY happy if you''d share them with me.

Thanks,
Alex

Alexander Stockinger
Programmer
Alexander Stockinger
Programmer

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.