10/23/2001CS 638, Fall 2001 Today Terrain –Terrain LOD.

Slides:



Advertisements
Similar presentations
Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Advertisements

Lecture 4 (week 2) Source Coding and Compression
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
AVL Trees1 Part-F2 AVL Trees v z. AVL Trees2 AVL Tree Definition (§ 9.2) AVL trees are balanced. An AVL Tree is a binary search tree such that.
Chapter 4: Trees Part II - AVL Tree
Augmenting Data Structures Advanced Algorithms & Data Structures Lecture Theme 07 – Part I Prof. Dr. Th. Ottmann Summer Semester 2006.
Quick Review of Apr 10 material B+-Tree File Organization –similar to B+-tree index –leaf nodes store records, not pointers to records stored in an original.
Brute-Force Triangulation
Two Methods for Fast Ray-Cast Ambient Occlusion Samuli Laine and Tero Karras NVIDIA Research.
Real-Time Rendering POLYGONAL TECHNIQUES Lecture 05 Marina Gavrilova.
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
K-structure, Separating Chain, Gap Tree, and Layered DAG Presented by Dave Tahmoush.
Nice, 17/18 December 2001 Adaptive Grids For Bathymetry Mapping And Navigation Michel Chedid and Maria-João Rendas I3S - MAUVE.
Terrain rendering in games
Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain.
1 Further Terrain Rendering and Level of Detail Lecture 8 - Week 4 Advanced Programming for 3D Applications CE
Haptic Rendering using Simplification Comp259 Sung-Eui Yoon.
Mesh Simplification Global and Local Methods:
1 Dr. Scott Schaefer Hidden Surfaces. 2/62 Hidden Surfaces.
Introduction General Data Structures - Arrays, Linked Lists - Stacks & Queues - Hash Tables & Binary Search Trees - Graphs Spatial Data Structures -Why.
FALL 2006CENG 351 Data Management and File Structures1 External Sorting.
CS 206 Introduction to Computer Science II 12 / 03 / 2008 Instructor: Michael Eckmann.
CS4432: Database Systems II
10/11/2001CS 638, Fall 2001 Today Kd-trees BSP Trees.
10/02/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Octrees.
Brute-Force Triangulation
Hidden Surface Removal
Samuli Laine: A General Algorithm for Output-Sensitive Visibility PreprocessingI3D 2005, April 3-6, Washington, D.C. A General Algorithm for Output- Sensitive.
10/21/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Terrain Dynamic LOD.
CPSC 335 BTrees Dr. Marina Gavrilova Computer Science University of Calgary Canada.
10/29/02 (c) 2002 University of Wisconsin, CS559 Today Hidden Surface Removal Exact Visibility.
CS-378: Game Technology Lecture #11: Visibility Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
Priority Queues and Heaps Bryce Boe 2013/11/20 CS24, Fall 2013.
ICS 220 – Data Structures and Algorithms Week 7 Dr. Ken Cosh.
Data Structures Week 9 Towards Weighted BFS So, far we have measured d s (v) in terms of number of edges in the path from s to v. Equivalent to assuming.
Surface Simplification Using Quadric Error Metrics Michael Garland Paul S. Heckbert.
10/09/2001CS 638, Fall 2001 Today Spatial Data Structures –Why care? –Octrees/Quadtrees –Kd-trees.
1 Speeding Up Ray Tracing Images from Virtual Light Field Project ©Slides Anthony Steed 1999 & Mel Slater 2004.
The Visibility Problem In many environments, most of the primitives (triangles) are not visible most of the time –Architectural walkthroughs, Urban environments.
Heaps, Heapsort, Priority Queues. Sorting So Far Heap: Data structure and associated algorithms, Not garbage collection context.
12/4/2001CS 638, Fall 2001 Today Managing large numbers of objects Some special cases.
CS 206 Introduction to Computer Science II 04 / 22 / 2009 Instructor: Michael Eckmann.
- Laboratoire d'InfoRmatique en Image et Systèmes d'information
Representation and modelling 3 – landscape specialisations 4.1 Introduction 4.2 Simple height field landscapes 4.3 Procedural modeling of landscapes- fractals.
Week 10 - Friday.  What did we talk about last time?  Graph representations  Adjacency matrix  Adjacency lists  Depth first search.
Maths & Technologies for Games Spatial Partitioning 2
AVL Trees and Heaps. AVL Trees So far balancing the tree was done globally Basically every node was involved in the balance operation Tree balancing can.
CSE554Contouring IISlide 1 CSE 554 Lecture 5: Contouring (faster) Fall 2015.
CSE554Contouring IISlide 1 CSE 554 Lecture 3: Contouring II Fall 2011.
CSE554Contouring IISlide 1 CSE 554 Lecture 5: Contouring (faster) Fall 2013.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
1 Chapter 6 Heapsort. 2 About this lecture Introduce Heap – Shape Property and Heap Property – Heap Operations Heapsort: Use Heap to Sort Fixing heap.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Polygon Triangulation
Model Optimization Wed Nov 16th 2016 Garrett Morrison.
"Teachers open the door, but you must enter by yourself. "
CSE 554 Lecture 5: Contouring (faster)
Data Structures: Disjoint Sets, Segment Trees, Fenwick Trees
Terrain Level of Detail
Hidden Surfaces Dr. Scott Schaefer.
Hashing Exercises.
CS475 3D Game Development Level Of Detail Nodes (LOD)
CMSC 341 Lecture 13 Leftist Heaps
Data Structures: Segment Trees, Fenwick Trees
CS679 - Fall Copyright Univ. of Wisconsin
CS679 - Fall Copyright Univ. of Wisconsin
Visibility Preserving Terrain Simplification An Experimental Study
Run-Time LOD Run-time algorithms may use static or dynamic LOD models:
Amortized Analysis and Heaps Intro
Presentation transcript:

10/23/2001CS 638, Fall 2001 Today Terrain –Terrain LOD

10/23/2001CS 638, Fall 2001 Terrain LOD As you have heard by now, terrain poses problems for static LOD methods –Must have high resolution in the near field, and low resolution in the distance, all in one model Dynamic LOD methods are the answer –All based on the idea of cuts through a tree of potential simplifications We will discuss the ROAM algorithm in detail –Other algorithms are similar in style, but this is the best

10/23/2001CS 638, Fall 2001 Terrain is Easier! Assumption: We are starting with a height field defined on a regular grid –Assume it’s a square to make it easier –We can mesh it by forming triangles with the data points The data is highly structured –Every data point has the same number of neighbors –Every triangle can be the same size –Hence, the tree of possible simplifications is very regular Still, multiple possibilities exist for the triangulation and the simplification operations

10/23/2001CS 638, Fall 2001 Triangle Bintrees Binary trees in which: –Each node represents a right-angled isosceles triangle –Each node has two children formed by splitting from the right angle vertex to the midpoint of the baseline –The leaf nodes use vertices from the original height field Another way to build a spatial partitioning tree, but particularly well suited to simplification algorithms –Easy to maintain neighbor information –Easy to avoid T-vertices

10/23/2001CS 638, Fall Triangle Bintree Example

10/23/2001CS 638, Fall 2001 Bintree Data Structure Parent and child pointers Neighbors –A left neighbor, a right neighbor, and a base neighbor –Note that the base and right angle give us a way to orient the triangle –Neighbors are not necessarily at your own level Later, error bounds that say how much variation in height there is in your children

10/23/2001CS 638, Fall Cuts

10/23/2001CS 638, Fall Neighbors 5: left neighbor 6, right neighbor 9 6: left neighbor 8, right neighbor 5 7: left neighbor 8, base neighbor 10 8: base neighbor 6, right neighbor 7 9: base neighbor 5, left neighbor 10 10: base neighbor 7, right neighbor 9 Note that 8 is 6’s left neighbor but 6 is 8’s base neighbor –If you are someone’s left/right/base neighbor they are not always your right/left/base neighbor In other words, neighbors need not come from the same level in the tree 6 5

10/23/2001CS 638, Fall Not All Cuts Are Created Equal Note the T-vertex - causes cracks in rendering

10/23/2001CS 638, Fall 2001 Generating Cuts Cuts are generated by a sequence of split or merge steps –Split: Drop the cut below to include your children –Merge: Lift the cut up above two children To avoid T-vertices, some splits lead to other, forced, splits An LOD algorithm chooses which steps to apply to generate a particular triangle count or error rate

10/23/2001CS 638, Fall A Split A split cuts a triangle in two by splitting its base edge –If the base edge is on a boundary, just split, as shown –If the base edge is shared, additional splits are forced Add a new triangle to the mesh 6

10/23/2001CS 638, Fall 2001 Forced Splits Triangles are always split along their base Hence, must also be able to split the base neighbor –Requires neighbors to be mutual base neighbors –If they are not base neighbors, even more splits are needed –Simple recursive formulation

10/23/2001CS 638, Fall Merges A diamond is a merge candidate if the children of it’s members are in the triangulation –The children of the 7-10 diamond below are candidates –Look for parents of sibling leaf nodes that are base neighbors or have no base neighbors Reduces the triangle count

10/23/2001CS 638, Fall 2001 Refinement LOD Algorithm Start with the base mesh Repeatedly split triangles until done –Stop when a specific triangle count is reached, or … –Stop when error is below some amount To guide the split order, assign priorities to each split and always do the one with the highest priority –After each split, update priorities of affected triangles –Sample priority: High priority to splits that will reduce big errors What is the complexity of this? (Roughly) A similar algorithm works by simplifying the mesh through merge operations. Why choose one over the other?

10/23/2001CS 638, Fall 2001 Refinement Notes If the priorities are monotonic, then the resulting terrain is optimal –Monotonic: Priorities of children are not larger than that of their parent Priorities can come from many sources: –In or out of view, silhouette, projected error, under a vehicle, line of sight, … Does not exploit coherence: As the view moves over the terrain, the triangulation isn’t likely to change much We should be able to start with the existing triangulation, and modify it to produce the new optimal triangulation

10/23/2001CS 638, Fall 2001 Dual Queue Optimization Have the split queue, as before Have a merge queue: –Queue of potential merges, with priority as the max of the split priority for the triangles in each merge Repeat until target size/accuracy and the max split priority is less than the min merge priority –If the mesh is too large/accurate, do the optimal merge Update data structures appropriately –Otherwise, do the optimal split Update data structures appropriately

10/23/2001CS 638, Fall 2001 Why Does it Work? The merge queue priorities tell you how much error you would add by doing each merge The split queue tells you how much error you would remove by doing each split A merge frees up two triangles, while a split takes at least one If you can free some triangles with a merge and use them with a more effective split, then you win –The min in the merge queue is the least error you can add with a merge –The max in the split queue is the most error you can remove with a split –If you can trade a split for a merge and save some error, then do it

10/23/2001CS 638, Fall 2001 Projected Error Metrics Idea is to figure out how far a sequence of merges moves the terrain from its original correct location –Measured in screen space, which is what the viewer sees Start with bounds in world space, and then project the bounds at run-time –World space bounds are view independent –Projected screen space bounds are view dependent

10/23/2001CS 638, Fall 2001 World Space Bounds With terrain, merge only moves points up or down Bound how far a point can move with a wedgie –A bintree triangle extruded up and down to contain its children –Defined by d, the thickness of the extrusion Fast to compute, so works for dynamic terrain –Important for explosion craters and the like d

10/23/2001CS 638, Fall 2001 Performance Bottlenecks Storing and managing priorities for out-of-view triangles is a waste of time –Do standard frustum culling to identify them Sending individual triangles is wasteful –Build strips as triangles are split and merged Naively, at every frame, wedgies must be projected, new priorities computed and the queues re-sorted –Use the viewer’s velocity to bound the number of frames before a priority could possibly make it to the top of a heap –Delay recomputation until then Priority queue: Bin priorities to reduce sorting cost –At low priorities, order within bins doesn’t matter

10/23/2001CS 638, Fall 2001 Additional Enhancements Stop processing after a certain amount of time –Easily done: just stop processing the next split or merge –Result no longer optimal, but probably not bad Cost of dual queue algorithm depends on the number of steps required to change one mesh into another –Check ahead of time how many steps might be required –If too may, just rebuild mesh from scratch using refinement algorithm Can get accurate line-of-sight or under-vehicle height by manipulating priorities to force certain splits

10/23/2001CS 638, Fall 2001 Other Algorithms Algorithm from Lindstrom et al is essentially the same idea as the ROAM refinement algorithm –Based on square blocks of (triangulated) terrain Makes determining forced splits harder –Slightly different error bounds An algorithm from the game community: –For a particular split operation, the viewer distance is the primary error factor –For each split, store distance at which it should occur –Check current mesh on each frame for splits/merges according to viewer distance –Non-optimal, but gets rid of priority queues (the big cost)

10/23/2001CS 638, Fall 2001 Midterm Info Thursday in class Bring in: –Something to write with –A ruler (it will be helpful) –A double sided letter sized sheet with anything on it (except things that increase the surface area)

10/23/2001CS 638, Fall 2001 Project Next Stage LithTech does almost everything we have talked about in the last six weeks So, the next stage is going to be done mostly in OpenGL (or similar) –Light maps –Stencil-buffer shadow volume algorithms LOD in LithTech