About Portal
I'm building a portal base renderer now. In one frame, If I label the portals and areas that have already been accessed, and just jump them when a second visit, it will lose some areas that can be seen in fact. If I don't label them, I'll get a stack overflow error.
My question is what is the right condition to stop recursion. So I can access every visible portal and area, and avoid stack overflow error.
Thanks very much!
[edited by - maplexp on September 1, 2003 11:38:54 AM]
Keep going until the portal is no longer visible, which includes view-frustum checking and (important but probably overlooked) front/back facing checks - if a portal is in your view but back facing, then don''t recurse though it, otherwise you end up going back and forth until your stack gives out :S
If you just draw a sector and flag it, then you loose the ability to do mirrors etc. easily. Although I had a hybrid portal engine that the front/back checking wasn''t appropriate, so i transformed a portals point by the associated matrix and stored it in a list. If already present then i didn''t render it (becasue its already been done).
Odds are the frustum and back facing checks will be good enough though.
If you just draw a sector and flag it, then you loose the ability to do mirrors etc. easily. Although I had a hybrid portal engine that the front/back checking wasn''t appropriate, so i transformed a portals point by the associated matrix and stored it in a list. If already present then i didn''t render it (becasue its already been done).
Odds are the frustum and back facing checks will be good enough though.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement