More Portal-rific

Published March 14, 2006
Advertisement
Found yet another set of issues with the portal system, caused by a combination of two portals leading from one cell into another and one of them crossing the camera's near clip plane.

We tried to lay out a level making every cell only able to have one portal out of it per wall, but that was a pain, so we had to fix it for real.

I didn't want to use a purely 3d solution of clipping one portal polygon to another, as they could become non-convex ( imagine a triangular piece of a portal seend through a square portal ), so I wanted to maintain the 2d bounding rect method of intersection, but the fact that I wasn't updating the z extents of the view frusta was causing the portal system to get into loops.

Earlier methods of tagging portals with frame counters or putting them in sets didn't work b/c you can end up going through one portal to another portal more than once per frame ( again the case of multiple portals leading to one room ).

The solution was a hybrid - we use the same code the anti-portals use to construct a 3d frustum from the plane of the portal as the near plane, and the sides from the eye point and the portal edges. This frustum is used to reject other portals that don't cross it. The fact that the frustum near plane is the portal itself prevents the traversal from going backwards in an infinite loop. If we had mirrors or non-euclidean portals, we would need another scheme. If the new portal is not rejected, it is converted to 2d as before for intersection.

This series of fixes seems to have finally done the job, and we aren't able to get any of the previously failing cases to do anything strange.

I also fixed the fog culling issue - I was using the world bounds for the entities instead of the visual bounds for the fog culling step, which rarely caused a mismatch.
Previous Entry Update
Next Entry LOD Love
0 likes 3 comments

Comments

jollyjeffers
Nice one - good to hear you finally got it all sorted out [grin]

So, what's next then? Surely the graphics-coding side of things must be pretty much feature/functionality complete now? Leaving physics, AI, gameplay?

Provided it isn't "I could tell you, but then I'd have to kill you" secret, care to make an entry giving a rough overview of where things are going in the near future - what you're working towards and on (roughly) what timeline?

Dunno about anyone else, but I'd find that interesting [wink]

Cheers,
Jack
March 14, 2006 12:28 PM
SimmerD
Yes, the graphics is finally about done, and so is the perf work, of which the portal system was the biggest piece. I may yet move the cal3d animation to vertex shaders at some point also.

My last major engine task is to make sound integration easier & require less / no code by using the facet system.

My partner is working on improving the AI code.

For me, next is the gameplay coding. I have to add key support to doors, for example, and add weapon upgrades.
March 14, 2006 06:34 PM
jollyjeffers
Sounds good to me [smile]

If you're working on the gameplay now, does that mean we'll be seeing a playable demo sometimes soon?? [grin]

Jack
March 15, 2006 02:31 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

1.2 Almost ready...

1112 views

Sound Paths

1331 views

Stately Progress

1133 views

State Lines

1283 views

Pulsing

866 views

Return to The Ship!

1007 views

Cameras & Boxes

1124 views
Advertisement