Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

More Portal-rific

Sign in to follow this  


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.
Sign in to follow this  


Recommended Comments

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]


Share this comment

Link to comment
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.

Share this comment

Link to comment
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]


Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!