Skip to main content
gamedev.net
🔒 Locked

PVS Problems Again

Started by Gazza 0 replies 1k views
Original Post
Gazza
Gazza
Hi, I have my PVS code almost working perfectly accept i am getting some small gaps in the PVS set.I mean there are places where if you stand at certain angles you can just about see into a leaf but the leaf has not been added to the PVS set so you see a black gap. The Portals have been generated correctly i know this so the problem must be in the way i am constructing the Clip Planes for the anti penumbra and traversing the leafs with them. At the moment i am using a strategy like this:- 1) For Every Leaf 2) For Every Portal (SourcePortal) in that leaf 3) For Every Portal (TargetPortal) in the Leaf on the opposite side of the SourcePortal . I call this the Destination leaf; 4) For Each Vertex on SourcePortal 5) Construct ClipPLanes from each Vertex in source portal to every edge on Target Portal. 6) TestLeaf=Leaf on the other side of Target Portal 7) Set PVS Bits for TestLeaf and Destination Leaf in the CurrentLeafs PVS Set. 8) Traverse the leafs starting in TestLeaf and checking if any of test leafs portal are within all the clip planes.If so i resize the clipplanes from the same point in the source portal but this time to each edge on the new portal in test leaf.I do this recursively setting the PVS Bits for each leaf entered until i reach a leaf where no portals fall inside the clip planes. Now this works almost perfectly but not quite, a few leafs dont get added to the pvs where they should. My first implementation did NOT resize the ClipPlanes which although did not suffer from this problem did suffer from leakage.This means there were leafs which could not possibly be seen but would still make it into a leafs PVS Set. At the end i check each leafs PVS set against the other.If leaf A can see leaf B but Leaf B can not see Leaf then i set both to zero.Otherwise they can both see each other. Any help or suggestions on what i am doing wrong would be greatly appreciated.

Topic Locked

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

Sign in to reply to this topic.