E Cient View Frustum Culling

E Cient View Frustum Culling

Ecient View Frustum Culling Daniel Skora Josef Jelnek sykoradfelcvutcz jelinejfelcvutcz Department of Computer Science Faculty of Electrical Engineering Czech Technical University Prague Czech Republic Abstract We have implemented ecient algorithms for view frustum culling introduced in the article Optimized View Frustum Cul ling Algorithms for Bounding Boxes by Ulf Assarson and Thomas Moller We measure and evaluate the eciency of selected sp eedup techniques used in static and dynamic scenes Keywords view frustum culling b ounding volumes scene hierarchy Introduction The main idea how to make VFC ecient was invented by Clark who used scene hierarchy Slater and Chrysanthou developed VFC probabilistic caching scheme which is signicantly faster but in some cases pro duces unacceptable errors Lots of improvements based on traversal coherency of the scene hierarchy were also presented by Bittner and Havran in We have examined the article Optimized View Frustum Cul ling Algorithms for Bounding Boxes and also the following technical rep ort by the same authors Optimized View Frustum Cul ling Algorithms which presents generalized and detailed parts of the basic article In this section we will describ e briey the main novel ideas of optimization metho ds that Assarson and Moller introduced in The following explanation is also used as the basic information ab out our implementation of the presented metho ds We will also include a detailed description critical comments and remarks ab out changes in our implementation The presentation of the abilities of our application will take place in Section including the discussion ab out the results in Section and Motivation and results in The main goal was to sp eedup the elimination of the invisible ob jects in complex scenes from the rendering pip eline This part of co de may not b e crucial in most cases but its sp eeding up will help esp ecially in huge scenes Moreover the general metho ds the authors of present also sp eedup techniques which use low degree of freedom of the camera motion in the userdriven walkthrough the scene This is signicant for well known D computer games driven by a player from his own p oint of view All metho ds are indep endent each other It is p ossible to determine standalone success in compar ison with another VFC algorithms Moller et al used the VFC algorithms of DirectModel DirectModel Specication Hewlett Packard and CosmoD CosmoD programmers guide Silicon Graphics Inc as a measure ethalon for establishing presented sp eedups All measurements were p erformed for several types of b ounding volumes and their hierarchy in scenes consisting of ab out thousands of p olygons They provide a solution which is times faster than DirectModel a system that uses the axes aligned b ounding b oxes hierarchy and times faster than CosmoD with the hierarchy of b ounding spheres Camera b ounding volumes and hierarchy We could reduce the whole problem of elimination of invisible ob jects to the test of the collision of two volume ob jects the visible volume of a camera also known as the viewing frustum and the b ounding volume of the current ob ject The visible volume of the camera is represented by six planes Two of them near and far are parallel The other four are connected in one p oint of space that represents the viewp oint They inclined a spatial angle that represents the FOV eld of view of camera The far plane b ounds visibility of far ob jects in space The near plane determines the distance of the viewp ort from the viewp oint Moller et al sp ecify the VF viewing frustum as an axes symmetrical quadrilateral frustum Often the reduced versions of the viewing frustum without the far plane and sometimes without the near plane are used in practice The near plane of VF could b e changed to the spherical surface in cases when we need to render ob jects in a panoramatic pro jection The most commonly used b ounding volumes for the VFC are already mentioned AABBs and spheres but also the OBB oriented bounding box or the kDOP discrete oriented polytope The volume of the ob ject in prop ortion to the volume of its b ounding solid determines the conservativity of the elimination algorithm The closer are the volumes the harder is the implementation of such a VFC algorithm The VFC algorithm based on b ounding spheres is simple and fast That is the reason for no really signicant sp eedup improvements as is shown on the results in The most commonly used structure that is go o d compromise b etween the tighttting kDOPs and conservative spheres is the AABB The imp ortant prop erty of the AABB is aligning to the world co ordinates In contrast to the OBB that is transformed by the same matrix as the vertices of the b ounded volume many transformations can b e removed in the case of AABB Still there is need to transform the AABB if the ob ject rotates Go o d compromise for this case can b e a combined hierarchy of the b ounding b oxes There are the OBBs in leafs of the oriented acyclic graph of the scene from which the AABBs on the higher levels of the hierarchy can b e easily computed only by a transformation and by nding the b ounds of the eight vertices set Clark shown that the scene hierarchy is really imp ortant data structure that helps sp eeding up the VFC signicantly Moller et al obtain the b est results for sp eeding up the eliminating phase with the hierarchy of the AABB The more complex hierarchy with the kDOP elements was not used by the authors but most of the optimization ideas can b e used even for these complex structures There should b e noted that the authors did not describ e the way how the AABB hierarchy was created its implementation how and how often they refreshed the dimensions of the b ounding volumes whether the scenes consisted of some animated solids etc Basic VFC algorithm Although Moller et al mentioned the system with VFC algorithm that they used as the base for the comparison but they did not give any further details They only stated that DirectModel uses the general test of the collision of two AABBs There was not mentioned its conservativity only the way how to convert the test of the axes aligned b ox to the quadrilateral frustum VF VF’ VF’ AABB AABB’ AABB’’ Figure Transformation of the AABB and VF to AABBs The entire pro cedure is in Figure The AABB and the VF is transformed by the p ersp ective transformation that reduces the VF to a b ox This transformation needs multiplications The new AABB is constructed around the original VF The collision detector is applied on this couple and can b e realized by the six comparisons An imp ortant feature of the basic algorithm is its conservativity in the sense of the detection of the state where the b ounding volume intersects the visibility volume of the camera Low precision of this test can cause unnecessary culling of a big amount of triangles of an ob ject inside the b ounding volume For an ob jective comparison of metho ds with dierent conservativity the global time measurement is needed b ecause the results of the VFC in this case aects the load of the output device that can b e hardware accelerator or software renderer Considering that we did not have all details of the implementation of the same basic VFC algorithm for comparison as the authors of the article we have used another much less exp ensive in the term of time that has the same conservativity as the so called AssarsonMollers basic test basic intersection that will b e describ ed later The acceleration can b e correctly measured even on less complex scenes by comparison of the CPU needed to compute only the VFC test routines But we have compared the algorithms with same which pro ducing the same results The fact that the Moller et al do not take care ab out conservativity of the compared algorithms aects reliability of the presented results The idea of the basic VFC algorithm for com parison is taken from the article Improved frustum object cul l where Villi Miettinen gives many ex p eriences with the practical applications for solving the VFC problem His algorithm is optimized for AABB and uses one of the AssarsonMollers opti We used only the core of Miettinens test mization d without this additional optimization Miettinens basic VFC algorithm uses the The r collision detection b etween the VF and a sphere In this case the b ounding sphere is determined by the center of the AABB and a half of the diagonal con necting the minimal and the maximal vertex of the AABB So it is sucient to compute only the dis tance of the center of the AABB from the tested Figure Basic VFC algorithm idea plane and consists of one dot pro duct and the com parison to the radius of the b ounding sphere Figure demonstrates the fact that the conversion of the AABB to the b ounding sphere is not exact If we measure the entire radius of the sphere and the distance from the center of the AABB we can see that we only need to compare its pro jection to the direction of the normal vector of the tested plane There is one more dot pro duct compared with the simple sphereplane test The following pseudoco de describ es more implementation details of this metho d int AABBvsFrustumAABB b FRUSTUM f oat m n int i result INSIDE for i i i PLANE p fplane i m bmx pa bmy pb bmz pc pd n bdx fabspa bdy fabspb bdz fabspc if m n return OUTSIDE if m n result INTERSECT return result Vector mx my mz represents the center of the AABB Absolute values of the normal vector of the plane a b c transform all p ossible values to the rst o

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us