Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08...

42
Graphics cgvr.korea.ac.kr 1 Graphics Lab @ Korea University 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim

Transcript of Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08...

Page 1: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

Graphics

cgvr.korea.ac.kr 1 Graphics Lab @ Korea University

7. Speed-up Techniques

2002.05.08

Presented by SooKyun Kim

Page 2: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 2

CGVR

Graphics Lab @ Korea University

Overview

Impostors Nailboards Hierarchical Image Caching

Level of Detail Discrete Geometry LODs Alpha LODs Geomorph LODs LOD Management

Triangle Strips, Fans, and Meshes Strips Fans Creating Strips

Page 3: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 3

CGVR

Graphics Lab @ Korea University

Impostors

What is the Impostors? An image of a complex object that is texture-mapped onto

a rectangle Impostors are sometimes called sprites Pre-rendered images of three-dimensional objects

Faster to draw than the object Closely resemble the object

Imaging is opaque where is present

Page 4: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 4

CGVR

Graphics Lab @ Korea University

Impostors

Impostor should be reused for several viewpoints located close together

Figure 1. use impostors to accelerate cloud rendering

Page 5: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 5

CGVR

Graphics Lab @ Korea University

Impostors

Figure 2. At the left an impostor is created of the object in the bounding box. At the right the center of the impostor is equal to the center of the bounding box, and the normal points directly toward the viewpoint

Page 6: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 6

CGVR

Graphics Lab @ Korea University

Impostors

Resolution of the texture Do not exceed the screen resolution

One limit to the usefulness of an impostor is its resolution If distance impostor comes closer, the individual pixels of texture may

become obvious Illusion breaks down

distance

objsizescreenrestexres

Figure 3. the angle of a screen pixel is computed as Bscr =fov/screenres, and the angle for the texture is computed similarly

Page 7: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 7

CGVR

Graphics Lab @ Korea University

Impostors

Consider regenerating an impostor in case where the viewer moves

Figure 4. the left part illustrates the overestimate of the error angle Btrans, and the right part shows the overestimate of Bsize. when any of these angles becomes greater than Bscr, the impostor needs to be regenerated

Page 8: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

Graphics

cgvr.korea.ac.kr 8 Graphics Lab @ Korea University

Nailboards

Page 9: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 9

CGVR

Graphics Lab @ Korea University

Nailboards

What is the Nailboards ? With a depth buffer of the same size as the impostor texture

RGB + Store the depth deviation from the nailboard polygon to the correct

depth of the geometry Nailboards contain localized depth information

Page 10: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 10

CGVR

Graphics Lab @ Korea University

Nailboards

Figure 5.

a simple scene rendered with geometry

what if impostors are created and used for the cube, the cylinder, and the cone

Uses two bits for depth deviation

Uses eight bits for depth deviation

Page 11: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

Graphics

cgvr.korea.ac.kr 11 Graphics Lab @ Korea University

Hierarchical Image Caching

Page 12: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 12

CGVR

Graphics Lab @ Korea University

Hierarchical Image Caching

Hierarchical Image Caching Uses impostors arranged in a hierarchy of better performance

Basic Idea Partition the scene into a hierarchy of boxes create an impostor for each box Hierarchically create impostors for the parents in the partitioning Impostors are updated hierarchically

The scene is partitioned by a BSP tree

Page 13: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

Graphics

cgvr.korea.ac.kr 13 Graphics Lab @ Korea University

Level of Detail

Page 14: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 14

CGVR

Graphics Lab @ Korea University

Level of Detail

Basic idea Level of Detail (LODs)

Use simpler versions of an object as it gets farther from the viewer

Example Detailed car : 10,000 triangles Viewer is close to the car

detailed car (10,000 triangles) Object is farther away

Simplified car (100 triangles)

Faces: 69,451

Faces: 2,502

Faces: 251

Faces: 76

Page 15: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

Graphics

cgvr.korea.ac.kr 15 Graphics Lab @ Korea University

Discrete Geometry LODs

Page 16: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 16

CGVR

Graphics Lab @ Korea University

Discrete Geometry LODs

Figure 6. here we show three different levels of detail for a car chair

Page 17: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 17

CGVR

Graphics Lab @ Korea University

Discrete Geometry LODs

Popping Effect Switch occurs during rendering it is usually noticeable and not very

natural

Reduce the Popping Morph between two consecutive models in the LOD sequence

2,000faces 10,000faces

50,000faces

Pop Pop

Page 18: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

Graphics

cgvr.korea.ac.kr 18 Graphics Lab @ Korea University

Alpha LODs

Page 19: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 19

CGVR

Graphics Lab @ Korea University

Alpha LODs

Simple method Avoids popping altogether is to use alpha LODs User-defined distance that determines when an object shall

start to be more and more transparent

Advantage Avoids popping

Disadvantage The object totally disappears

Page 20: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 20

CGVR

Graphics Lab @ Korea University

Alpha LODs

Figure 7. The left part of this illustration shows how ranged-based LODs work. The right part shows how alpha LODs work

Page 21: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 21

CGVR

Graphics Lab @ Korea University

Alpha LODs

Figure 8. The cone in the middle is rendered using an alpha LOD. The transparency of the cone is increased when the distance to it increase, and it finally disappears.

Page 22: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

Graphics

cgvr.korea.ac.kr 22 Graphics Lab @ Korea University

Geomorph LODs

Page 23: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 23

CGVR

Graphics Lab @ Korea University

Geomorph LODs

Mesh simplification Create various LOD models from a single complex object

Approach (discrete LODs) Create a set of discrete LODs

Geomorph LODs Instead of using blending to transition from one model to

the next A set of models created by simplification Edge collapse methods

Discuss Section 9.4

Page 24: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

Graphics

cgvr.korea.ac.kr 24 Graphics Lab @ Korea University

LOD Management

Page 25: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 25

CGVR

Graphics Lab @ Korea University

LOD Management

It is feature of a rendering system to have a constant frame rate Adapts the selection of the level of detail for all visible

objects in a scene to meet the requirement of constant frame rate

Predictive Selects the detail level of the visible objects based on

desired frame rate and on which objects are visible

Page 26: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 26

CGVR

Graphics Lab @ Korea University

LOD Management

Gives (O,L) for each object Object : O Rendered at a level of detail : L

Estimate the cost of rendering an object at a certain level of detail Cost(O,L)

Estimates the benefit of an object rendered at a certain level of detail Benefit(O,L)

Page 27: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 27

CGVR

Graphics Lab @ Korea University

LOD Management

Main idea Optimize the selection of the LODs for the objects S

Under the constraint

Select for the objects the level of detail that gives us “the best image” within the desired frame rate

S

LOBenefit ),(

S

LO eTimeTargetFram),(cost

Page 28: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 28

CGVR

Graphics Lab @ Korea University

LOD Management

Cost function Estimate how long it takes to render an object (O,L) Dependent on

Graphics Hardware, number of polygons…

Coefficients c1 , c 2 and c3

Benefit function

Benefit(O,L)=Size(O)*Accuracy(O,L)*Importance(O)* Focus(O)*Motion(O)*Hysteresis(O,L)

)),(),(),((),(cost 321 LOPixcLOVertcLOPolycMaxLO

Page 29: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

Graphics

cgvr.korea.ac.kr 29 Graphics Lab @ Korea University

Triangle Strips, Fans, and Meshes

Page 30: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 30

CGVR

Graphics Lab @ Korea University

Triangle Strips, Fans, and Meshes

To increase graphics performance is to send fewer than three vertices per triangle to the graphics pipeline

Two popular methods of using less data, namely triangle strips and triangles fans Converting a triangle mesh into triangle stripes

Page 31: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

Graphics

cgvr.korea.ac.kr 31 Graphics Lab @ Korea University

Strips

Page 32: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 32

CGVR

Graphics Lab @ Korea University

Strips

How would it possible to describe a triangle with less than three vertices? Not to describe one triangle at a time, but instead to give a sequence of connected triangles

Figure 9. Here an image was rendered with different target frame rates. The target rate for the top row was 10Hz, for the middle row 20Hz, and for the bottom row 50Hz.

Page 33: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 33

CGVR

Graphics Lab @ Korea University

Strips

Figure 10. A sequence of triangles that can be represented as one triangle strip. after sending vertices v0, v1, and v2 for triangle T0, it suffices to send one vertex per triangle and reuse the previous two vertices from the previous triangle in the triangle strip

Page 34: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 34

CGVR

Graphics Lab @ Korea University

Strips

Swap Swaps the order of the two latest vertices

Triangle strips with swaps are called generalized triangle strips Implemented by resending a vertex A swap is better than restarting

Figure 11. we would have to a send to the graphics pipeline, to use these triangle as a strip.

)v,v,v,v,v,v,v,(v 65423210

)v,v,v,v,v,v,v,(v 65423210

)v,v,v,s,v,v,v,(v 6543210 wap

Page 35: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

Graphics

cgvr.korea.ac.kr 35 Graphics Lab @ Korea University

Fans

Page 36: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 36

CGVR

Graphics Lab @ Korea University

Fans

The vertex shared by all triangles is called the center vertex Another kind of set of connected triangles

Figure 12. the left figure illustrates the concept of a triangle fan. Triangle T0 sends vertices v0 (the center vertex), v1, and v2. the subsequent triangles. Ti (i>0), send only vertex vi+2

Page 37: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

Graphics

cgvr.korea.ac.kr 37 Graphics Lab @ Korea University

Creating Strips

Page 38: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 38

CGVR

Graphics Lab @ Korea University

Creating Strips

Given an arbitrary triangle mesh Decomposed efficiently into triangle strips and fans

Graphics Library pfdMeshGSet from Performer opTriStripper from Optimizer

Two methods for constructing triangle strips from polygonal models SGI algorithm STRIPE

Page 39: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 39

CGVR

Graphics Lab @ Korea University

Creating Strips

Figure 13. the left image shows some surfaces of a car in wireframe mode. The right image shows the same model, but here each triangle strip has been randomly colored.

Page 40: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 40

CGVR

Graphics Lab @ Korea University

The SGI Algorithm

Works for fully triangulated models Contains polygons with than three vertices, then

triangulated before being fed into the triangle strip creation code

Algorithms Starts by choosing an arbitrary triangle of lowest degree Degree : the number of neighbors of a polygon

Page 41: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 41

CGVR

Graphics Lab @ Korea University

The STRIPE Algorithm

Figure 14. a patch of a rectangular region of quads. The largest patch in this polygon set is marked in grey. The STRIP algorithm then turns the largest patch into a triangle strip, and finally extends the start and the end of the triangle strip as much as possible.

Page 42: Graphics Graphics Lab @ Korea University cgvr.korea.ac.kr 1 7. Speed-up Techniques 2002.05.08 Presented by SooKyun Kim.

cgvr.korea.ac.kr 42

CGVR

Graphics Lab @ Korea University

The STRIPE Algorithm

Figure 15. Each quad is triangulated in order to allow a long triangle strip to be formed.