RE: [Algorithms] Obscuring objects with Convex Closed Volumes
Brought to you by:
vexxed72
From: Martin F. <mf...@at...> - 2003-07-29 10:52:25
|
Yes but the point will only project to a single point on the screen plane. > Anyway, I was imaging something for more complex situations. Say to test is > a portal is occluded by a group of occluders which have convex hulls or OBBs Much more useful! :) The way I've handle occlusion in my engine is to use AABB or OBBs as occluders. If we start with the AABB case. Each face of the box is classified as front facing or back facing with respect to the camera. Each front facing face on the box is clipped to any and all parent clipping planes. (Portal, view fustrum, other occluders etc..) A visible face with a back facing adjacent face generates a plane built with the shared edge and the camera's position if the shared edge itself survives clipping to the parent clipping planes. These are silhouette planes. We need to add the plane equations of all the front facing visible faces. If not an object between the occluder and the eye could disappear if it was inside the volume defined by the silhouette planes. For an occluder we now have a number of planes. If any primitive is behind all of these planes it has been occluded. Of course testing box's, sphere's, convex hull's etc.. against planes is well documented. I've found a little performance advantage from storing the silhouette planes first then front facing planes in occluders array of planes. Sorting occluders / portals is important too. You can waste allot of processing if you generate planes for an occluder which itself is occluded by an occluder encountered later. The only difference with an OBB is the way the world space points are generated to build world space planes. Any convex, closed volume will do as an occluder. I only used AABB's / OBB's because they're a simple yet practical volume to use. Using arbitrary volumes means storing additional vertices, polygons and adjacency information and will likely generate more planes. Occluder LOD is also well worth while. When the projected area of an occluder get's too small I turn them off as, due to perspective, the ammount it occludes lessens significantly. The most significant benefit of occluders is often in occluding portals. Cheers, Martin -----Original Message----- From: gda...@li... [mailto:gda...@li...]On Behalf Of Gareth Lewin Sent: 29 July 2003 09:34 To: gda...@li... Subject: RE: [Algorithms] Obscuring objects can't even a single point be occluded on the way to the centre of the screen but not the top. | . | O | | | the | is the screen, the O is the sphere, the . is the point. Anyway, I was imaging something for more complex situations. Say to test is a portal is occluded by a group of occluders which have convex hulls or OBBs |