27
Representation and modelli ng 3 – landscape specialis ations 4.1 Introduction 4.2 Simple height field landscapes 4.3 Procedural modeling of landscap es- fractals 4.4 Terrain LODs: triangle bintrees 4.5 Rendering of landscapes by ray casting

Representation and modelling 3 – landscape specialisations

  • Upload
    fifi

  • View
    57

  • Download
    0

Embed Size (px)

DESCRIPTION

Representation and modelling 3 – landscape specialisations. 4.1 Introduction 4.2 Simple height field landscapes 4.3 Procedural modeling of landscapes- fractals 4.4 Terrain LODs: triangle bintrees 4.5 Rendering of landscapes by ray casting. 4.1 Introduction. - PowerPoint PPT Presentation

Citation preview

Page 1: Representation and modelling 3  –  landscape specialisations

Representation and modelling 3 – landscape specialisations

4.1 Introduction

4.2 Simple height field landscapes

4.3 Procedural modeling of landscapes- fractals

4.4 Terrain LODs: triangle bintrees

4.5 Rendering of landscapes by ray casting

Page 2: Representation and modelling 3  –  landscape specialisations

4.1 Introduction Landscapes or terrains are a common entity in

computer games. Their total extent in screen space is large and this

means that ideally size of a landscape polygon needs to decrease as a function of viewing distance.

LOD should ideally vary not only as a function of the local surface curvature but globally across the model.

Page 3: Representation and modelling 3  –  landscape specialisations

4.1 Introduction

Page 4: Representation and modelling 3  –  landscape specialisations

4.1 Introduction The most popular form of landscape model is a height field

based on a uniform grid. A classic procedural method for terrain generation – fractals –

which generates a triangle mesh. LOD approaches to terrain exploit the normal height field

representation of landscape data and the approaches are generally more straightforward than for arbitrary polygon meshes.

An important consideration of landscape models is their ease of following.

Landscapes in computer games have to be continually accessed if objects are to be animated and checked for collision with the terrain.

Page 5: Representation and modelling 3  –  landscape specialisations

4.2 Simple height field landscapes The easiest way to generate a height field is to use a painting

package with the understanding that the grey scale is to represent height.

Example

Page 6: Representation and modelling 3  –  landscape specialisations

4.2 Simple height field landscapes The height field values can be mapped into a suitable colour, dependi

ng on the nature of the landscape, and a texture map applied. Example :

Ground texture A view of the rendered landscape

Page 7: Representation and modelling 3  –  landscape specialisations

4.3 Procedural modelling of landscapes - fractals Fractal geometry is a term coined by Benoit

Mandlebrot(1997,1982). The term was used to describe the attributes of certain

natural phenomena, for example coastlines. Fractal geometry provides a description for certain

aspects of this ubiquitous phenomenon in nature and its tendency towards self-similarity.

Page 8: Representation and modelling 3  –  landscape specialisations

4.3 Procedural modelling of landscapes - fractals Fractal techniques have commonly been used to generate

terrain models and the easiest techniques involve subdividing the facets of the objects.

Subdivision in this context means taking the midpoint along the edge between two vertices and perturbing it along a line normal to the edge.

Most subdivision algorithms are based on a formulation by Fournier et al.(1982) that recursively subdivides a single line segment.

Page 9: Representation and modelling 3  –  landscape specialisations

4.3 Procedural modelling of landscapes – fractals (subdivision example) A procedure recursively subdivides a line (t1,f), (t2,f2) generating a scalar

displacement of the midpoint of the line in a direction normal to the line.

Page 10: Representation and modelling 3  –  landscape specialisations

4.3 Procedural modelling of landscapes – fractals (subdivision example) Triangles or quadrilaterals in 3D space, we treat each in tern, generating a

displacement along a midpoint vector that is normal to the plane of the original facet.

Page 11: Representation and modelling 3  –  landscape specialisations

4.3 Procedural modelling of landscapes - fractals Fournier categorises two problems in this method – internal a

nd external consistency. Internal consistency

Requires that the shape generated should be the same whatever the orientation in which it is generated

That coarser details should remain the same if the shape is replotted at greater resoluiton.

External consistency External consistency is harder to maintain. Within the mesh of triangles, every triangle shares each of its sides wi

th another; thus the same random displacements must be generated for corresponding points of different connecting triangles.

Page 12: Representation and modelling 3  –  landscape specialisations

4.3 Procedural modelling of landscapes - fractals If the displacements are along the surface normal of the polygo

n under consideration, then adjacent polygons which have different normals will have their midpoints displaced into different positions. This causes gaps to open up.

A solution is to displace the midpoint along the average of the normals to all the polygons. This technique would create an unsatisfactory skyline .

A better skyline is obtained by making all the displacements of points internal to the original polygon in a direction normal to the plane of the original polygon.

Page 13: Representation and modelling 3  –  landscape specialisations

4.4 Terrain LODs: triangle bintrees A uniform height field is conveniently triangulated b

y a representation known as a triangle bintree. Each triangle is a right-angled isosceles triangles. The children of any node are formed by splitting the

triangle along an edge formed by joining the right-angled apex to the base to form two more right-angled child triangles.

Page 14: Representation and modelling 3  –  landscape specialisations

4.4 Terrain LODs: triangle bintrees Triangle bintree.

Page 15: Representation and modelling 3  –  landscape specialisations

4.4 Terrain LODs: triangle bintrees This structure is employed in the work of Duchaineau et

al.(1997) and Lindstrom et al.(1996) The key idea is that a particular LOD representation for a

terrain database is a single level in the triangle bintree. The vertices in the bintree level are associated with corre

sponding height field data z (x, y) this association is conveniently defined as : w (v) = (x,y,z(x,y))

where: z (x, y) is the value of the height field at the point (x,y)

the bintree domani coordinates of v

Page 16: Representation and modelling 3  –  landscape specialisations

4.4 Terrain LODs: triangle bintrees

Page 17: Representation and modelling 3  –  landscape specialisations

4.4 Terrain LODs: triangle bintrees(Duchaineau et al.’s approach) The root of the tree contains two triangles The leaves contain triangles whose vertices are formed fr

om adjacent vertices in the height field grid. Any triangle in the structure has a base, and right and left

neighbours. Either the neighbours are form the same level, or form th

e next coarsest level (base neighbours), or from the next finer level (left and right neighbours).

Page 18: Representation and modelling 3  –  landscape specialisations

4.4 Terrain LODs: triangle bintrees(Duchaineau et al.’s approach) A split an d merge operation defines a transition down or up a

level. For example, when a triangle and its base neighbour are from th

e same level a simple split operation is possible by adding a new vertex.

Page 19: Representation and modelling 3  –  landscape specialisations

4.4 Terrain LODs: triangle bintrees(Duchaineau et al.’s approach) Triangle cannot be split as shown in the previous fig

ure if its base neighbour is from a coarser level. Such situation, requires that the base triangle must b

e split first in a recursive sequence. Duchaineau et al. refer to such splits as forced splits

and they use them subsequently in an optimisation procedure.

Page 20: Representation and modelling 3  –  landscape specialisations

4.4 Terrain LODs: triangle bintrees(Duchaineau et al.’s approach)

Page 21: Representation and modelling 3  –  landscape specialisations

4.4 Terrain LODs: triangle bintrees

Page 22: Representation and modelling 3  –  landscape specialisations

4.4 Terrain LODs: triangle bintrees The overall scheme consists of a pre-processing phase an

d an on-line phase. on-line phase

Consists of an algorithm that updates the previous frame’s bintree by split and merge operations, stopping when a geometric screen space (view-depending) error criterion is satisfied.

pre-processing Constructs a set of view-dependent error bounds which are use

d by the on-line phase.

Page 23: Representation and modelling 3  –  landscape specialisations

4.4 Terrain LODs: triangle bintrees

Page 24: Representation and modelling 3  –  landscape specialisations

4.4 Terrain LODs: triangle bintrees As the triangulation is built a priority queue is

maintained and the following operations are carried out as long as the screen space projection is inaccurate: Find the highest-priority triangle T in the queue. Force split T. Update the queue by removing T and other split triangles. Add any new triangles to the queue.

Page 25: Representation and modelling 3  –  landscape specialisations

4.5 Rendering of landscapes by ray casting Textured mapped uniform height fields are similar to vo

xel-based data. We can consider each cell as a voxel with a variable z di

mension, and use a voxel rendering algorithm to produce the projected image.

The work that we now describe is typical of voxel rendering and is due to Cohen-Or et al. (1996)

Page 26: Representation and modelling 3  –  landscape specialisations

4.5 Rendering of landscapes by ray casting The basic algorithm is called ray casting and as the name

implies, a ray is generated from ten viewpoint through each pixel and cast into world space.

The hit point on the terrain then gives the colour for pixel from which the ray has emanated.

Page 27: Representation and modelling 3  –  landscape specialisations

4.5 Rendering of landscapes by ray casting