Skip to main content
gamedev.net
🔒 Locked

Portals

Started by Kaesebrot 13 replies 350+ views
Original Post
Kaesebrot
Kaesebrot
Hi, can anyone point me to a good resource for portal-generation, I don''t found what I''m looking for.. I know what portals are and how they work. I Also know how to use them. My only problem is, to make the portals.. I have already generatad a BSP-Tree... I think it''s the first step, am I right?
felonius
felonius
BSP are not neccesarily required to do portals. Other approaches exist to.

If you already know what they are and how to use them, then what is the problem?

In short what you do is that the polygons in your BSP that you want to be portals you mark with some tag and then with a link to the target sector. During rendering if the portal is rendered (i.e. is not culled) then the target sector is rendered instead of the portal polygon but with the view frustum replaced with what can be seen through the portal. Simple, really.
Jacob Marner, M.Sc.Console Programmer, Deadline Games
Kaesebrot
Kaesebrot
my problem is to find this portal-polygon, that''s all...
felonius
felonius
what do you mean "find" it?
Jacob Marner, M.Sc.Console Programmer, Deadline Games
felonius
felonius
If you ask how to actually decide what should be portals, then this is something that you must do manually. Dividing your map into sectors and selecting good portals is not something I have seen any good algorithms for.

Jacob Marner, M.Sc.Console Programmer, Deadline Games
Kaesebrot
Kaesebrot
Hmmm.. okay.. I try to explain it..
My map consits of polygons which represending the walls and the ground. I have not defined polygons for the portals. My problem is to compute this polygons...

I hope it''s clear.. if not, I will try to explain it again
Kaesebrot
Kaesebrot
quote:
Original post by felonius
If you ask how to actually decide what should be portals, then this is something that you must do manually. Dividing your map into sectors and selecting good portals is not something I have seen any good algorithms for.



I think this is exactly my question..
Hmmm.. I'm shure there are algorithm's doing that, I don't think Quake & co. do portals manually..

I found one post with nearly the same topic

quote:

Are you aiming to copy how Quake3 generates it's .bsp files? If this is your plan, you will need to build a solid leaf bsp tree, construct large polygons along each nodes splitting plane, then clip each of these polygons to the bsp tree. These polygons are now your portals. Quake3 then generates a PVS using these portals and sectors from the bsp tree. Be warned, this is a lot of work to get going, and takes a long time to calculate.



And this is my problem:
"construct large polygons along each nodes splitting plane, then clip each of these polygons to the bsp tree"
how, I do that?

[edited by - Kaesebrot on May 23, 2002 9:32:44 AM]
felonius
felonius
Interesting approach. I hadn''t heard about that before. I''d rather not advice about the details since I haven''t tried it out myself.
Jacob Marner, M.Sc.Console Programmer, Deadline Games
JuNC
JuNC
The Quake portals can be automatically generated because the maps are formed in a very particular way, as long as your maps are similar (or you can invent some way of ensuring that) you can use the quake method of constructing the portals. If not you might have to either invent a new algo or do some searching, or do them manually.

quote:

construct large polygons along each nodes splitting plane, then clip each of these polygons to the bsp tree



Quake starts by creating large portals out of the AABB of the map, and adds the AABB planes to the top of the BSP (this might not be exactly the order because these portals can be constructed simply using the algo). These portals are added to the first node portal set. The algo then starts:

Create portal for first actual map node (in much the same way you generate the polys from the .map descriptions, just make them huge quads). Add this to the set.

You need to then split ALL polygons in the set for the current node (in this case includes the AABB portals) against that node's plane, constructing two new sets for each child.

Then recursively clip each of these sets against their appropriate child node. Continue, stopping depending on the contents of the node (the details are a little involved).

Eventually each leaf will have a set of portals associated with it.

I know it's a little sketchy but it's basically it.

[edited by - JuNC on May 23, 2002 2:01:14 PM]
Kaesebrot
Kaesebrot
okay.. thx

I have one stupid question: What does AABB stands for?

[edited by - Kaesebrot on May 23, 2002 3:23:56 PM]
timm
timm
AABB :Axis aligned bounding box.
GameDev Reader TODO List:1. Name my company.2. Buy domain name.3. Create web site.4. Name myself as CEO5. Create Game Engine.6. Design game.
Kaesebrot
Kaesebrot
oh... I see, this question was realy realy stupid
smitty1276
smitty1276
It wasn''t a stupid question... it was easier to just ask that to dig through a search engine.

Topic Locked

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

Sign in to reply to this topic.