- Timestamp:
- 06/20/08 07:00:46 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/Readme.txt
r2785 r2789 2 2 ====================================== 3 3 4 This programn is a demonstration of the Coherent Hierarchical Culling algorithm 5 described in the chapter "Hardware Occlusion Queries Made Useful" of the book GPU 6 Gems II. Additional information and sample images are available at 7 8 http://www.cg.tuwien.ac.at/research/vr/chcull/ 9 10 Updates to this demo can can be found on the same webpage. 4 This programn is a demonstration of the CHC++ algorithm 5 described in the chapter "Game Engine Friendly Occlusion Culling" of the book ShaderX 7. 11 6 12 7 Copyright and Disclaimer: 13 8 14 This code is copyright Vienna University of Technology, 2004. 15 9 This code is copyright Vienna University of Technology, 2008. 16 10 17 11 Please feel FREE to COPY and USE the code to include it in your own work, … … 27 21 Authors of the book chapter: 28 22 23 Jiri Bittner (bittner@cg.tuwien.ac.at) 24 Oliver Mattausch (matt@cg.tuwien.ac.at) 29 25 Michael Wimmer (wimmer@cg.tuwien.ac.at) 30 Jiri Bittner (bittner@cg.tuwien.ac.at)31 26 32 Date: December 18, 2004 27 28 Date: June 20, 2008 33 29 34 30 ---------- … … 38 34 Help for keybord and mouse is available with F1. 39 35 40 You can switch between the different occlusion modes described in the book chapterusing the41 SPACE key (view-frustum culling, hierarchical stop and wait, coherent hierarchical culling ).36 You can switch between different known occlusion modes using the 37 SPACE key (view-frustum culling, hierarchical stop and wait, coherent hierarchical culling, chc++). 42 38 43 A visualization of the culling algorithm from can be shown by pressing '1' on the keyboard. Note that the 44 classification of nodes usually changes in consecutive frames, so that the hierarchy seems to oscillate. 45 This is expected, since the classification of previously visible interior nodes is based on the classification 46 of their children, which might be more accurate (leading to the interior node to become occluded) than the 47 query for the node itself. 39 A bird eye view visualization of the culling algorithm from can be shown by pressing '1' on the keyboard. 40 48 41 49 42 ---------- … … 51 44 ---------- 52 45 53 The scene used in this program consists of basic objects randomly placed in a box. The extent of the box and the 54 number and size of objects can be changed (see F1). 46 The scene used in this program is model of the city Vienna, which has a long history in the visibility research comunity as a scene to test and showcase various algorihms. 55 47 56 The hierarchical structure is a kd-tree with objects intersecting a split plane placed into multiple leaf nodes.48 The hierarchical structure is a bounding volume hierarchy which was precomputed (using Surface Area Heuristics) in order to not pollute the demo with lenghty construction code not relevant to the algorithm to keep the demo as simple and educationional as possible. Note that the original construction would also not take more than some seconds. 57 49 58 By playing with the parameters and moving around, the user can explore situtations where occlusion culling is extremly 59 useful, and where it is not (because the objects are too sparse or there is too much to see from this viewpoint). 50 --------------- 51 The algorithm 52 --------------- 60 53 61 The hierarchical coherent culling algorithm is compared to simple view-frustum culling and the hierarchical stop and wait 62 algorithm (which also uses hardware occlusion queries, but in a less sophisticated way). 54 The CHC ++ algorithm is build on the CHC alorithm and removes most of it's shortcomings while maintaining simplicity. By playing with the parameters and moving around, the user can explore situtations where occlusion culling is extremly useful, and where it is not (because the objects are too sparse or there is too much to see from this viewpoint). One can observe that the CHC++ algorithm provides good frame rates even in these difficult cases, even when the CHC algorithm breaks down and falls behind view frustum culling in terms of performance 55 56 57 -------------- 58 The engine 59 ------------- 60 61 We use a simple OpenGL based engine which was designed to be as simple as possible while providing the necessary feature list to simulate the behaviour of full-fledged game engines like Ogre3D. The engine supports simple material sorting mainly based on the texture size, avoiding the mix of differently sized textures, which according to various sources induces one of the costliest state change. We demonstrate the integration of the culling algorithm into the engine, and show how occlusion cullig and state sorting are possible within one framework, two paradigms that were previously considered to be cancelling out each other ("either you do front-back-sorting or material sorting"). 62 63 63 64 64 ---------- … … 66 66 ---------- 67 67 68 A binary for Win32 is included.68 A binary for Win32 and a solution for visual studio 2005 included. The program should work under XP and Windows Vista. 69 69 70 The program should compile under Windows and Linux, a CMAKE makefile for multi-platform71 compilation is included (see www.cmake.org for details).72 73 For Linux, you need to have a working GLUT and GLEW installation.74 70 75 71 ---------- … … 77 73 ---------- 78 74 79 This demo is written in C++ and partly C and uses OpenGL. 80 It has few external needs like limits.h, stdlib.h, math.h, string.h, stdio.h, or time.h. 81 We also make heavy use of stl classes, like priority_queue. 75 This demo is written in C++. We make heavy use of stl classes, like priority_queue. The program expects the GL_ARB_occlusion_query extension. 82 76 83 The program expects the GL_ARB_occlusion_query extension.77 The rendering core of the engine is provided by the class RenderTraverser, which provides front to back scene traversal based on a priority queue. It's subclasses implement the various culling algorithms. The new algorithm is represented by the class CHCPlusPlusTraverser. 84 78 85 The program and especially the mathematical routines are not designed for speed or 86 efficiency, but for simplicity and clarity. 79 The main routine is implemented in chcdemo.cpp. Also it contains the OpenGl setup code, glut stuff, and sets up of the scene hierarchy. 87 80 88 RenderTraverser.cpp: implements the core algorithm described in the paper 81 The project is separated into one section containing supportive code (utils), the traversal algorithms (traversal), and the basic engine classes like Camera, Geometry, Material, or RenderState (scene). 89 82 90 occquery.cpp: contains the OpenGl setup code, glut stuff, and sets up of the scene hierarchy 91 HierarchyNode.cpp: contains a kd-tree hierarchy implementation, which can be traversed by the culling algorithm 92 Geometry.cpp: represents simple drawable geometry, so that we have something to cull for the algorithm 93 94 Timers.cpp: contains exact timer functions in order to accurately measure the frame render time 95 stdafx.cpp: source file that includes just the standard includes 96 glInterface.h: includes gl, glut and glew headers 97 DataTypes.c: defines basic geometric datatypes 98 MathStuff.c: declares some handy mathematical routines 99 teapot.h: contains the teapot geometry 100 101 If you find any problem with the code or have any comments, we would like to hear from you! 83 If you find any problem with the code or have any comments, please feel free to ask us at any time.
Note: See TracChangeset
for help on using the changeset viewer.