1 Terrain Rendering and Level of Detail Week 7 Advanced Programming for 3D Applications CE00383-3.

Slides:



Advertisements
Similar presentations
Week 11 - Wednesday.  Image based effects  Skyboxes  Lightfields  Sprites  Billboards  Particle systems.
Advertisements

Real-Time Rendering POLYGONAL TECHNIQUES Lecture 05 Marina Gavrilova.
University of Wisconsin-Milwaukee Geographic Information Science Geography 625 Intermediate Geographic Information Science Instructor: Changshan Wu Department.
December 5, 2013Computer Vision Lecture 20: Hidden Markov Models/Depth 1 Stereo Vision Due to the limited resolution of images, increasing the baseline.
1 Terrain. Game Type Oriented Game Type Oriented Terrain Terrain –For visual ( 廣義的場景 ) »Ground / Building / Static models / Dynamic models –For terrain.
1 Further Terrain Rendering and Level of Detail Lecture 8 - Week 4 Advanced Programming for 3D Applications CE
4.4. L EVEL OF D ETAIL Exploration of 3D mesh level-of-detail approaches.
CPSC 335 Geometric Data Structures in Computer Modeling and GIS Dr. Marina L. Gavrilova Assistant Professor Dept of Comp. Science, University of Calgary,
Mesh Simplification Global and Local Methods:
EE 7730 Image Segmentation.
3D Flight Simulator for CE Balaban Nir Lander Shiran Supervisor: Futerman Yan.
Content Subdivision First some basics (control point polygon, mesh)
Rendering of Realistic Landscapes K. H. Ko Department of Mechatronics Gwangju Institute of Science and Technology October 31, 2007.
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.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
Guilford County Sci Vis V204.01
Spatial data models (types)
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
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.
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
Procedural and Fractal Terrains
Polygon Shading. Assigning color to a shape to make graphical scenes look realistic, or artistic, or whatever effect we’re attempting to achieve But first.
CS-378: Game Technology Lecture #11: Visibility Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
Modelling and Simulation Types of Texture Mapping.
Graphics Graphics Korea University cgvr.korea.ac.kr Creating Virtual World I 김 창 헌 Department of Computer Science Korea University
Surface Simplification Using Quadric Error Metrics Michael Garland Paul S. Heckbert.
4/15/04© University of Wisconsin, CS559 Spring 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
Computer Graphics Texture Mapping
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.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
TERRAIN SET09115 Intro to Graphics Programming. Breakdown  Basics  What do we mean by terrain?  How terrain rendering works  Generating terrain 
2D/3D Shape Manipulation, 3D Printing Shape Representations Slides from Olga Sorkine February 20, 2013 CS 6501.
December 4, 2014Computer Vision Lecture 22: Depth 1 Stereo Vision Comparing the similar triangles PMC l and p l LC l, we get: Similarly, for PNC r and.
Emerging Technologies for Games Alpha Sorting and “Soft” Particles CO3303 Week 15.
1 Rendering Geometry with Relief Textures L.Baboud X.Décoret ARTIS-GRAVIR/IMAG-INRIA.
Applied Mathematics 1 Do we have to see everything - all the time? …or is it at all possible? Dr. ing. Rune Aasgaard.
GPU Graftals: Stylized Rendering of Fluffy Objects Michael Lester.
Subdivision Schemes Basic idea: Start with something coarse, and refine it into smaller pieces for rendering –We have seen how subdivision may be used.
CSC505 Particle Systems. CSC505 Object Representations So far we have represented (rendered) objects with –Lines –Polygons (triangles) –Curves These techniques.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
10/23/2001CS 638, Fall 2001 Today Terrain –Terrain LOD.
Mesh Coarsening zhenyu shu Mesh Coarsening Large meshes are commonly used in numerous application area Modern range scanning devices are used.
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
BUMP-MAPPING SET09115 Intro to Graphics Programming.
- 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.
CS324e - Elements of Graphics and Visualization Fractals and 3D Landscapes.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques Presented by SooKyun Kim.
Painterly Rendering for Animation Introduction speaks of focus and detail –Small brush strokes focus and provide detail –Large strokes are abstract and.
Outline ● Introduction – What is the problem ● Generate stochastic textures ● Improve realism ● High level approach - Don't just jump into details – Why.
Rendering Large Models (in real time)
Outline ● Introduction – What is the problem ● Generate stochastic textures ● Improve realism ● High level approach - Don't just jump into details – Why.
APE'07 IV INTERNATIONAL CONFERENCE ON ADVANCES IN PRODUCTION ENGINEERING June 2007 Warsaw, Poland M. Nowakiewicz, J. Porter-Sobieraj Faculty of.
Processing Images and Video for An Impressionist Effect Automatic production of “painterly” animations from video clips. Extending existing algorithms.
Introduction to Parametric Curve and Surface Modeling.
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.
Ying Zhu Georgia State University
CIS 781 Fractal Terrains.
Week 12 - Thursday CS361.
CS475 3D Game Development Level Of Detail Nodes (LOD)
CSE 381 – Advanced Game Programming Terrain
CS679 - Fall Copyright Univ. of Wisconsin
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 Terrain Rendering and Level of Detail Week 7 Advanced Programming for 3D Applications CE

22Terrain Terrain is important to many games Terrain is important to many games As a model, it is very large As a model, it is very large Creating every point explicitly by hand is not feasible, so automated terrain generation methods are common Creating every point explicitly by hand is not feasible, so automated terrain generation methods are common When rendering, some of the terrain is close, and other parts are far away, leading to terrain LOD algorithms When rendering, some of the terrain is close, and other parts are far away, leading to terrain LOD algorithms

33Terrain A terrain mesh is nothing more than a triangle grid, with has heights of each vertex in the grid specified in such a way that the grid models a smooth transition from mountain to valley, simulating a natural terrain. To make it realistic we apply a nice texture showing sandy beaches, grassy hills, and snowy mountains

44Terrain To generate terrain a simple solution consists in using a brute force approach. – –it simply stores the entire terrain vertex/index data and then renders it. – –For games requiring a small terrain, this approach is workable with modern graphics cards that support hardware vertex processing. However, for games requiring larger terrains, you have to do some kind of level of detail or culling because the enormous amount of geometry data needed to model such huge terrains can be overwhelming for a brute force approach.

55 What is the Problem? Terrains tend to be huge Terrains tend to be huge Visualizing a terrain of x samples (164 x 164 km, samples 10 m apart) requires drawing 536,805,378 triangles (268,435,456 vertices) Visualizing a terrain of x samples (164 x 164 km, samples 10 m apart) requires drawing 536,805,378 triangles (268,435,456 vertices) Adding a 32 bit RGBA texture and having 16 bit heights, the total memory consumption is above 1.5 Gb! Adding a 32 bit RGBA texture and having 16 bit heights, the total memory consumption is above 1.5 Gb!

66 Terrain Generation Methods Paint the height field (artist generated) Paint the height field (artist generated) Various pseudo-random processes Various pseudo-random processes –Independent random height at each point –Fault generation methods (based on random lines) –Particle deposition –Fractal terrain from meshes Triangulated point sample methods Triangulated point sample methods Plenty of research and commercial tools for terrain generation Plenty of research and commercial tools for terrain generation –

77 Surface Attributes Rather than painting texture and color directly, paint attributes Rather than painting texture and color directly, paint attributes –E.g. Grass, Trees, Water, … –Features can have game-play characteristics: speed of motion, impassable, … Then automatically generate colors/textures Then automatically generate colors/textures –Care must be taken at the boundaries of the regions Can also work for the terrain itself Can also work for the terrain itself –E.g. Maps that have a finite number of possible heights, with ramps between them

88 Terrain Representation Terrains are often represented using elevation maps Terrains are often represented using elevation maps An elevation map is a 2D array of regularly spaced height samples An elevation map is a 2D array of regularly spaced height samples

99 Painted Terrain Example Height Color Texture

1010 Representing Terrain The base representation for terrain is usually a height field The base representation for terrain is usually a height field –z=f(x,y) for (x,y) within the limits of the space There are two common ways to represent the function f(x,y) There are two common ways to represent the function f(x,y) –Explicitly store the value of f(x,y) for a discrete grid of (x,y) locations Generally interpolate or triangulate to get points not on the grid Generally interpolate or triangulate to get points not on the grid Easy to figure out what the height of the terrain is at any given (x,y) Easy to figure out what the height of the terrain is at any given (x,y) Expensive to store the entire terrain Expensive to store the entire terrain –Store a polygonal mesh Cheaper if the terrain has large flat areas Cheaper if the terrain has large flat areas Harder to figure out what the height is under the player (have to know which triangle they are in) Harder to figure out what the height is under the player (have to know which triangle they are in)

1111Heightmaps We use a heightmap to describe the hills and valleys of the terrain. A heightmap is an array where each element specifies the height of a particular vertex in the terrain grid. One of the possible graphical representations of a heightmap is a grayscale map, where darker values reflect portions of the terrain with low altitudes and whiter values reflect portions of the terrain with higher altitudes.

1212 Create Heightmap as Grayscale Heightmaps can be generated either : -procedurally or -In an image editor such as Adobe Photoshop. Using an image editor is probably the easiest way to go, and it allows you to create the terrain interactively and visually as you want it. In addition, you can take advantage of your image editor features, such as filters, to create interesting heightmaps.

1313 Random Processes Generation The claim is that real terrain looks “random” over many scales The claim is that real terrain looks “random” over many scales Hence, random processes should generate realistic terrain Hence, random processes should generate realistic terrain –The catch is knowing which random processes Some advantages: Some advantages: –Lots of terrain with almost no effort –If the random values are repeatable, the terrain can be generated on the fly, which saves on storage Some disadvantages: Some disadvantages: –Very poor control over the outcome –Non-intuitive parameter settings

1414 Random Points Randomly choose a value for each grid point Randomly choose a value for each grid point –Can make each point independent (don’t consider neighbors) –Can make points dependent on previous points - a spatial Markov process Generally must smooth the resulting terrain Generally must smooth the resulting terrain –Various smoothing filters could be used Advantage: Relatively easy to generate on the fly Advantage: Relatively easy to generate on the fly

1515 Fault Formation Claimed to model real fault lines, but not at all like real faults Claimed to model real fault lines, but not at all like real faults Process 1: Process 1: –Generate a random line and lift everything on one side of the line by d –Scale d and repeat Process 2: Process 2: –Generate a random line and lift the terrain adjacent to the line –Repeat (maybe with a scale function) Smoothing is important Smoothing is important

1616 Fault Formation Example Initial Smoothed

1717 Particle Deposition Supposed to model lava flow (or glacial drumlins!) Supposed to model lava flow (or glacial drumlins!) Process: Process: –Drop a particle onto the terrain –Jiggle it around until it is at most one unit higher than each of its neighbors –Repeat –Occasionally move the drop point around To do volcanoes, invert everything above a plane To do volcanoes, invert everything above a plane To do sinkholes, invert the hill To do sinkholes, invert the hill To do rows of hills, move the drop point along a line To do rows of hills, move the drop point along a line

1818 Particle Deposition Process ? ? In 3D, more scope for random choices on jiggling particles

1919 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

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

2121 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

2222 Subdivision Method No 3 Assume quadrilateral meshes Assume quadrilateral meshes

2323 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

2424 Fractal Terrains Very jagged terrain

2525 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…)

2626 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

2727 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

2828 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

2929 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

3030 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

3131 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