games101-note-L12 Geometry 3

Mesh Operations: Geometry Processing

• Mesh subdivision
• Mesh simplification
• Mesh regularization

Mesh Subdivision (upsampling)

Mesh Subdivision

Increase resolution

Loop Subdivision

Loop 是作者的名字

• Split each triangle into four

Loop Subdivision

• Assign new vertex positions according to weights - New / old vertices updated differently

Loop Subdivision

Loop Subdivision — Update

新的点:

for new vertices

已有的点:

for old vertices

Catmull-Clark Subdivision (General Mesh)

Each subdivision step:
Add vertex in each face
Add midpoint on each edge
Connect all new vertices

一次细分后,增加了非四边形数量的奇异点(因为四边形中心加入的点不是奇异点),之后再也没有改变奇异点的数量

Extraordinary vertex (degree != 4)

Catmull-Clark Subdivision

Mesh Simplification

Goal: reduce number of mesh elements
while maintaining the overall shape

Mesh Simplification

Collapsing An Edge

• Suppose we simplify a mesh using edge collapsing

Collapsing An Edge

Quadric Error Metrics (⼆次误差度量)

• How much geometric error is introduced by simplification?
• Not a good idea to perform local averaging of vertices
• Quadric error: new vertex should minimize its sum of square distance (L2 distance) to previously related triangle planes!

点距离和它相关的边的距离

Simplification via Quadric Error

由于一条边的坍缩会影响其他边的二次度量误差

利用堆结构每次坍缩二次度量误差最小的边

Iteratively collapse edges
Which edges? Assign score with quadric error metric*
• approximate distance to surface as sum of distances to
planes containing triangles
• iteratively collapse edge with smallest score
• greedy algorithm… great results!

example

Shadows

How to draw shadows using rasterization? - Shadow mapping!

Shadow Mapping

在很多早期电影和游戏里的主要技术

• An Image-space Algorithm

-no knowledge of scene’s geometry during shadow computation

-must deal with aliasing artifacts

• Key idea:

  • the points NOT in shadow must be seen both by the light and by the camera

在点光源下使用

Pass 1: Render from Light

• Depth image from light source 记录光源看到的深度图

Render from Light

Pass 2A: Render from Eye

Standard image (with depth) from eye

Pass 2B: Project to light

Project visible points in eye view back to light source

比较实际深度和记录深度(shadow map),深度相等,光线能照射到,反之则光线被阻挡

(Reprojected) depths match for light and eye. VISIBLE

visible

(Reprojected) depths from light and eye are not the same. BLOCKED!!

BLOCKED

会存在的问题:

1.数值精度:会比较实际深度和记录深度,会有浮点误差

2.会记录光源看到的shadow map:shadow map的分辨率有需求,太低的话会导致阴影又锯齿

• Hard shadows (point lights only)
• Quality depends on shadow map resolution (general problem with image-based techniques)
• Involves equality comparison of floating point depth values means issues of scale, bias, tolerance