1 Further Terrain Rendering and Level of Detail Lecture 8 - Week 4 Advanced Programming for 3D Applications CE00383-3.

Slides:



Advertisements
Similar presentations
GR2 Advanced Computer Graphics AGR
Advertisements

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

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.
CSE 381 – Advanced Game Programming Scene Management
Real-Time Rendering POLYGONAL TECHNIQUES Lecture 05 Marina Gavrilova.
Visibility Culling using Hierarchical Occlusion Maps Hansong Zhang, Dinesh Manocha, Tom Hudson, Kenneth E. Hoff III Presented by: Chris Wassenius.
K-structure, Separating Chain, Gap Tree, and Layered DAG Presented by Dave Tahmoush.
Terrain rendering in games
High-Quality Simplification with Generalized Pair Contractions Pavel Borodin,* Stefan Gumhold, # Michael Guthe,* Reinhard Klein* *University of Bonn, Germany.
Haptic Rendering using Simplification Comp259 Sung-Eui Yoon.
Mesh Simplification Global and Local Methods:
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
Introduction General Data Structures - Arrays, Linked Lists - Stacks & Queues - Hash Tables & Binary Search Trees - Graphs Spatial Data Structures -Why.
Content Subdivision First some basics (control point polygon, mesh)
1 Terrain Rendering and Level of Detail Week 7 Advanced Programming for 3D Applications CE
Visualization and graphics research group CIPIC January 21, 2003Multiresolution (ECS 289L) - Winter Dynamic View-Dependent Simplification for Polygonal.
Bounding Volume Hierarchies and Spatial Partitioning Kenneth E. Hoff III COMP-236 lecture Spring 2000.
1 Advanced Scene Management System. 2 A tree-based or graph-based representation is good for 3D data management A tree-based or graph-based representation.
Quadtrees and Mesh Generation Student Lecture in course MATH/CSC 870 Philipp Richter Thursday, April 19 th, 2007.
10/11/2001CS 638, Fall 2001 Today Kd-trees BSP Trees.
10/02/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Octrees.
The Story So Far The algorithms presented so far exploit: –Sparse sets of images (some data may not be available) –User help with correspondences (time.
11/30/04© University of Wisconsin, CS559 Fall 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
10/21/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Terrain Dynamic LOD.
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.
Spatial Data Structures Jason Goffeney, 4/26/2006 from Real Time Rendering.
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.
4/15/04© University of Wisconsin, CS559 Spring 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
Dynamic Meshing Using Adaptively Sampled Distance Fields
NDVI-based Vegetation Rendering CGIM ‘07 Stefan Roettger, University of Erlangen
Week 11 - Thursday.  What did we talk about last time?  Image processing  Blurring  Edge detection  Color correction  Tone mapping  Lens flare.
2D/3D Shape Manipulation, 3D Printing Shape Representations Slides from Olga Sorkine February 20, 2013 CS 6501.
Real-Time Rendering SPEEDING UP RENDERING Lecture 04 Marina Gavrilova.
Subdivision Schemes Basic idea: Start with something coarse, and refine it into smaller pieces for rendering –We have seen how subdivision may be used.
Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.
10/23/2001CS 638, Fall 2001 Today Terrain –Terrain LOD.
1 Polygonal Techniques 이영건. 2 Introduction This chapter –Discuss a variety of problems that are encountered within polygonal data sets The.
View-dependent Adaptive Tessellation of Spline Surfaces
Duy & Piotr. How to reconstruct a high quality image with the least amount of samples per pixel the least amount of resources And preserving the image.
- Laboratoire d'InfoRmatique en Image et Systèmes d'information
CSCE 552 Spring D Models By Jijun Tang. Triangles Fundamental primitive of pipelines  Everything else constructed from them  (except lines and.
Representation and modelling 3 – landscape specialisations 4.1 Introduction 4.2 Simple height field landscapes 4.3 Procedural modeling of landscapes- fractals.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques Presented by SooKyun Kim.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Ray Tracing II. HW1 Part A due October 10 Camera module Object module –Read from a file –Sphere and Light only Ray tracer module: –No shading. No reflection.
Maths & Technologies for Games Spatial Partitioning 2
DPL2/10/2016 CS 551/651: Final Review David Luebke
Painterly Rendering for Animation Introduction speaks of focus and detail –Small brush strokes focus and provide detail –Large strokes are abstract and.
Rendering Large Models (in real time)
DPL3/10/2016 CS 551/651: Simplification Continued David Luebke
Processing Images and Video for An Impressionist Effect Automatic production of “painterly” animations from video clips. Extending existing algorithms.
Presented by 翁丞世  View Interpolation  Layered Depth Images  Light Fields and Lumigraphs  Environment Mattes  Video-Based.
1 Geometry for Game. Geometry Geometry –Position / vertex normals / vertex colors / texture coordinates Topology Topology –Primitive »Lines / triangles.

Scene Manager Creates and places movable objects like lights and cameras so as to access them efficiently, e.g. for rendering. Loads and assembles world.
Bounding Volume Hierarchies and Spatial Partitioning
Week 12 - Thursday CS361.
Terrain Level of Detail
Bounding Volume Hierarchies and Spatial Partitioning
CS475 3D Game Development Level Of Detail Nodes (LOD)
CS679 - Fall Copyright Univ. of Wisconsin
Chap 10. Geometric Level of Detail
Run-Time LOD Run-time algorithms may use static or dynamic LOD models:
Last Time B-splines Project 3 was made available
Presentation transcript:

1 Further Terrain Rendering and Level of Detail Lecture 8 - Week 4 Advanced Programming for 3D Applications CE

22 Fractal Terrain Based on subdivision of a course polygon mesh Based on subdivision of a course polygon mesh Each subdivision adds detail to the mesh in a random way Each subdivision adds detail to the mesh in a random way Algorithm (starting with a triangular mesh): Algorithm (starting with a triangular mesh): –Split each edge, and shift the new vertex up or down by a random amount –Subdivide the triangles using the new vertices –Repeat Also algorithms for quadrilateral meshes Also algorithms for quadrilateral meshes ml ml

33 Subdivision Method No 1 Note: Works on any triangular mesh - does not have to be regular or have equal sized triangles.

44 Subdivision Method No 2 Generates a triangle bintree from the top down Generates a triangle bintree from the top down Useful for LOD, Useful for LOD, Ideally, works for right- angled isosceles triangles Ideally, works for right- angled isosceles triangles

55 Subdivision Method No 3 Assume quadrilateral meshes Assume quadrilateral meshes

66 Rendering Terrain Coarser Finer

77 Rendering Terrain Adaptive Representation Bilinear Patch

88 Rendering Terrain Adaptive Representation T-Junction

99 Triangle Bintrees Binary trees in which: 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 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

Triangle Bintree Example

1111 Bintree Data Structure Parent and child pointers Parent and child pointers Neighbors 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 Later, error bounds that say how much variation in height there is in your children

Cuts

Neighbors 5: left neighbor 6, right neighbor 9 5: left neighbor 6, right neighbor 9 6: left neighbor 8, right neighbor 5 6: left neighbor 8, right neighbor 5 7: left neighbor 8, base neighbor 10 7: left neighbor 8, base neighbor 10 8: base neighbor 6, right neighbor 7 8: base neighbor 6, right neighbor 7 9: base neighbor 5, left neighbor 10 9: base neighbor 5, left neighbor 10 10: base neighbor 7, right neighbor 9 10: base neighbor 7, right neighbor 9 Note that 8 is 6’s left neighbor but 6 is 8’s base neighbor 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 In other words, neighbors need not come from the same level in the tree 6 5

Cuts Are Not Always Equal Note the T-vertex - causes cracks in rendering

1515 Generating Cuts Cuts are generated by a sequence of split or merge steps 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 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 An LOD algorithm chooses which steps to apply to generate a particular triangle count or error rate

A Split A split cuts a triangle in two by splitting its base edge 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 Add a new triangle to the mesh 6

1717 Forced Splits Triangles are always split along their base Triangles are always split along their base Hence, must also be able to split the base neighbor 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

Merges A diamond is a merge candidate if the children of it’s members are in the triangulation 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 Reduces the triangle count

1919 Refinement LOD Algorithm Start with the base mesh Start with the base mesh Repeatedly split triangles until done 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 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) What is the complexity of this? (Roughly) A similar algorithm works by simplifying the mesh through merge operations. Why choose one over the other? A similar algorithm works by simplifying the mesh through merge operations. Why choose one over the other?

2020 Fractal Terrain Details The original mesh vertices don’t move, so it defines the overall shape of the terrain (mountains, valleys, etc) The original mesh vertices don’t move, so it defines the overall shape of the terrain (mountains, valleys, etc) There are options for choosing where to move the new vertices There are options for choosing where to move the new vertices –Uniform random offset –Normally distributed offset – small motions more likely –Procedural rule – eg Perlin noise making patterns from pseudo- random numbers making patterns from pseudo- random numbers If desired, boundary vertices can be left unmoved, to maintain the boundary edge If desired, boundary vertices can be left unmoved, to maintain the boundary edge

2121 Fractal Terrains Very jagged terrain

2222 Populating Terrain Coloring terrain: Coloring terrain: –Paint texture maps –Base color on height (with some randomness) Trees: Trees: –Paint densities, or randomly set density –Then place trees randomly within regions according to density Rivers (and lakes): Rivers (and lakes): –Trace local minima, and estimate catchment areas (more later…)

2323 Terrain Generation Trade-Offs Control vs Automation: Control vs Automation: –Painting gives most control –Fractal terrain next best control because you can always specify more points –Random methods give little control - generate lots and choose the one you like Generate on-the-fly: Generate on-the-fly: –Random points and fractal terrain could be generated on the fly, but fractal terrain generation is quite slow –Tilings can also be generated on the fly

2424 Static LOD Depending on the roughness of the terrain and the application, 5%-50% of the vertices and triangles can be removed Depending on the roughness of the terrain and the application, 5%-50% of the vertices and triangles can be removed –With triangles still more than triangles to draw in best case. Frustum culling further reduces number of triangles to draw Frustum culling further reduces number of triangles to draw In most cases we still draw the terrain at full resolution near the far plane In most cases we still draw the terrain at full resolution near the far plane

2525 View-Dependent Dynamic LOD Dynamic simplification of visible part of the terrain Dynamic simplification of visible part of the terrain A mountain observed from a distance of 10 km requires a higher tessellation than when observed from a distance of 100 km A mountain observed from a distance of 10 km requires a higher tessellation than when observed from a distance of 100 km The quality of the tessellation can be changed at run time to achieve constant frame rates The quality of the tessellation can be changed at run time to achieve constant frame rates Terrains can be altered at run time Terrains can be altered at run time

2626 Terrain LOD Terrain poses problems for static LOD methods 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 Dynamic LOD methods are the answer –All based on the idea of cuts through a tree of potential simplifications ROAM algorithm is a good example ROAM algorithm is a good example –Other continuous LOD algorithms are similar in style An alternative is to create fixed LODs for sub- regions and figure out how to join them together An alternative is to create fixed LODs for sub- regions and figure out how to join them together

2727 Terrain LOD Algorithms Triangle bintree based Triangle bintree based –‘ROAMing Terrain: Real-time Optimally Adapting Meshes’ – Duchaineau et al. Quad tree based Quad tree based –E.g. ‘Real-Time, Continuous Level of Detail Rendering of Height Fields’ – Lindstrom et al. Progressive mesh based Progressive mesh based –E.g. ‘Smooth View-Dependent Level-of-Detail Control and its Application to Terrain Rendering’ – Hoppe Geo Mipmapping Geo Mipmapping –‘Fast Terrain Rendering Using Geometrical MipMapping’ – de Boer

2828 Rendering Fractal Landscapes Alternative methods: Alternative methods: –Polygon rendering using graphics hardware Tesselate the height field Tesselate the height field Draw each triangle separately or Draw each triangle separately or Perform adaptive level-of-detail rendering Perform adaptive level-of-detail rendering –Ray-tracing A) Tesselate the height field and trace the triangle mesh A) Tesselate the height field and trace the triangle mesh B) Directly trace the fractal (QEAB) B) Directly trace the fractal (QEAB) Check out

2929 Rendering Fractal Landscapes Polygon rendering Polygon rendering –Tesselation is given implicitely or can be generated  A height field over a rectangular domain, values are given at discrete sample points

3030 Rendering Fractal Landscapes Rendering lit and textured triangles Rendering lit and textured triangles –Vertices, colors, texture coords, normals Textured onlyTextured and shaded

3131 Rendering Fractal Landscapes Rendering triangles using graphics hardware Rendering triangles using graphics hardware –Render triangle strips: v 0,v X,v 1,v X+1,v 2,v X+1,... Triangle defined by new point and previous two points Triangle defined by new point and previous two points Each vertex is rendered only once Each vertex is rendered only once –Still have to send every vertex even in smooth regions –Popping artefacts where triangles below pixel size V0V0 V2V2 V1V1 V3V3... V X-1 VXVX V X+2 V X+1 V X+3

3232 Rendering Fractal Landscapes LOD-Rendering LOD-Rendering –Adaptively refine the mesh with regard to the current view

3333 Rendering Fractal Landscapes LOD-Rendering LOD-Rendering –Top-down or bottom-up approach –Hierarchically partition the mesh –Start with coarse resolution and adaptively refine until desired level-of-detail is reached –Start with original mesh and successively merge triangles –Consider world space and/or screen space deviation –Re-build mesh for every frame

3434 Rendering Fractal Landscapes ROAM: Real-Time Optimally Adapting Meshes ROAM: Real-Time Optimally Adapting Meshes –Exploits triangle bintree structure: split along base edge –Valid triangulation has to be guaranteed Two triangles have no overlap Two triangles have no overlap Overlap at common vertex/common edge Overlap at common vertex/common edge Critical case

3535 Rendering Fractal Landscapes The recursive split operation The recursive split operation –Triangle to be split has coarser base neighbor Force split of base neighbor first Force split of base neighbor first Recursively force further splits until diamond is found Recursively force further splits until diamond is found Diamond can be split without further splits Diamond can be split without further splits

3636 Rendering Fractal Landscapes Error criterion for split operation Error criterion for split operation –Deviation in world space Difference between height value at center vertex and average of left and right vertex Difference between height value at center vertex and average of left and right vertex Recursively pull deviation values from bottom to top Recursively pull deviation values from bottom to top –Deviation in screen space Determine upper bound for screen space length of world space difference vector (0,d,0) Determine upper bound for screen space length of world space difference vector (0,d,0)

3737 Rendering Fractal Landscapes Ray-Tracing Ray-Tracing –Ray-tracing triangle meshes Trace rays until a triangle is hit Trace rays until a triangle is hit Implicit occlusion culling Implicit occlusion culling

3838 Rendering Fractal Landscapes Ray-Tracing - performance issues Ray-Tracing - performance issues –Mesh data structure has to be stored –Hierarchical representation necessary for improved intersection test Octree or kD-tree Octree or kD-tree max/min(H) Store max/min heights within subregion Skip regions below minimal height of ray Employ ray coherences

3939 Rendering Fractal Landscapes Rendering polygonal models – analysis Rendering polygonal models – analysis –Aliasing due to undersampling of small features –No exploitation of the fractal lod-nature © Images K. Musgrave

4040 Other Issues Terrain Texturing Terrain Texturing Terrain Lighting Terrain Lighting Camera Animation and Fly-through Camera Animation and Fly-through SkyBox SkyBox Terrain following (a form of collision) Terrain following (a form of collision) –Maintaining characters and objects on top of Terrain