PDA

View Full Version : Culling the "outside polys" of a level



Jan
09-05-2002, 06:42 AM
Hi guys.

I am thinking of how i could get rid of a big number of polys. I think all of you have someday made a level with Worldcraft or some other editor. Usually one creates a room by taking a box and hollowing it (or carving it out). After one has created some rooms, you place the player-startpoint in one of them.

Now: Many polys are useless, because, if your rooms are a closed set, so that you cannot get out of the building and therefore cannot watch it from the outside, those polys that are on the outside can never be seen.

My levelcompiler creates portals for my levels but it is damned slow (1000 trianglelevel takes 3 to 5 minutes). Additionally it creates a lot of portals only for those outside polys (I have a level with 300 portals, but i could cull 295 of them!)

So does anyone know (or has a link to a tutorial) how i can calculate, which polys are "outside" of the level (by knowing the players starting-point). This would speed many things really up.

Thanks in advance.
Jan.

AdrianD
09-05-2002, 06:52 AM
google: "CSG" and "BSP"

Nakoruru
09-05-2002, 07:02 AM
I think that the quake tools do a flood fill of the level from the player start point and eliminates any polygons that are not reachable.

A leak in the level is a node in which the outside of the level is reachable.

Since you use portals, it ought to be easy to do a flood fill.

Jan
09-05-2002, 07:08 AM
Could you explain a bit, how one does this floodfill? Also i would like to do this operation before i create portals, to speed up the portal-placing.

AdrianD: I implemented CSG once, but as far as i know you need two objects that intersect each other. I donīt know how i could use CSG with the level on the one side and the startingpoint on the other to calculate the outside-polys. Maybe you could give me a hint.

Jan.