1
by Discarding Sample Taps Robert Toth Intel, Advanced Rendering - - PowerPoint PPT Presentation
by Discarding Sample Taps Robert Toth Intel, Advanced Rendering - - PowerPoint PPT Presentation
Avoiding Texture Seams by Discarding Sample Taps Robert Toth Intel, Advanced Rendering Technology 2014-03-15 1 Part I Seams: Atlases and Ptex Texture Seams Atlas Source: Microsoft DirectX SDK Visual & Parallel Computing Group 3
Part I Seams: Atlases and Ptex
3
Visual & Parallel Computing Group
Texture Seams
Atlas
Source: Microsoft DirectX SDK
4
Visual & Parallel Computing Group
Texture Seams
Atlas
Source: Microsoft DirectX SDK
Connected Connected Connected
5
Visual & Parallel Computing Group
Texture Seams
Atlas
Source: Microsoft DirectX SDK
Texture filter
6
Visual & Parallel Computing Group
Texture Seams
Ptex
7
Visual & Parallel Computing Group
Texture Seams
Ptex Connected Connected
8
Visual & Parallel Computing Group
Texture Seams
Ptex Texture filter
9
Visual & Parallel Computing Group
Realtime Ptex implementations
Algo gorith ithm Wide de filt lter Mem emory
- ry
Loo
- okup
kups McDonald, Burley: SIGGRAPH 2011
Real-time Ptex (Per-Face Texture Mapping)
Yes Large 1 Kim, Hillesland, Hensley: SIGGRAPH Asia 2011
A Space-efficient and hardware-friendly Implementation of Ptex
No Small 1 McDonald: GDC 2013
Eliminating Texture Waste: Borderless Ptex
Yes* Small 5/10 *: over edges only, not corners
Part II Analysis: What, and Why?
11
Visual & Parallel Computing Group
Goal
Need to determine pixel colors
- Scene is a continuous signal
- Display has finite number of pixels
12
Visual & Parallel Computing Group
Two interpretations
Interpretation 1:
- This is a sampling and reconstruction problem!
Interpretation 2:
- This is an error minimization problem!
Regardless: integrate scene modulated by filter function, f(x)
13
Visual & Parallel Computing Group
Integrate
π = π’π ππ π π π ππ
Ξ©π π
14
Visual & Parallel Computing Group
Integrate
π = π’π ππ π π π ππ
Ξ©π π
Pixel color value
15
Visual & Parallel Computing Group
Integrate
π = π’π ππ π π π ππ
Ξ©π π
Integrate over each contributing surface
16
Visual & Parallel Computing Group
Integrate
Pixel filter function π = π’π ππ π π π ππ
Ξ©π π
17
Visual & Parallel Computing Group
Integrate
Texture Texcoords π = π’π ππ π π π ππ
Ξ©π π
18
Visual & Parallel Computing Group
Integrate
π = π’π ππ π π π ππ
Ξ©π π
19
Visual & Parallel Computing Group
Integrate
πβ² = ππ π π ππ
Ξ©π π
MSAA: π = π’π ππ π π π ππ
Ξ©π π
20
Visual & Parallel Computing Group
Integrate
Resolve filter MSAA: Manyβ visibility samples
- > Riemann integral
β a few
π = π’π ππ π π π ππ
Ξ©π π
πβ² = ππ π π ππ
Ξ©π π
21
Visual & Parallel Computing Group
Integrate
Pixel shader MSAA: Pass the problem on to the developer ο Pass the problem on to the texture sampler π = π’π ππ π π π ππ
Ξ©π π
πβ² = ππ π π ππ
Ξ©π π
22
Visual & Parallel Computing Group
Solution
πβ² = ππ π π ππ
Ξ©π π
23
Visual & Parallel Computing Group
Solution: Simple
ππ
π = π’π ππ π
π π ππ
Ξ©π
πβ² = ππ π π ππ
Ξ©π π
24
Visual & Parallel Computing Group
Solution: Simple
ππ
π = π’π ππ π
π π ππ
Ξ©π
πβ² = ππ π π ππ
Ξ©π π
Extrapolation
25
Visual & Parallel Computing Group
Solution: Simple
ππ
π = π’π ππ π
π π ππ
Ξ©π
πβ² = ππ π π ππ
Ξ©π π
πβ² = ππ
π π π ππ Ξ©π π
β π
26
Visual & Parallel Computing Group
Solution: Traverse
ππ
π = π’π ππ π
π π ππ
Ξ©π π
= π
πβ² = ππ π π ππ
Ξ©π π
27
Visual & Parallel Computing Group
Solution: Traverse
ππ
π = π’π ππ π
π π ππ
Ξ©π π
= π
πβ² = ππ π π ππ
Ξ©π π
28
Visual & Parallel Computing Group
Solution: Traverse
πβ² = ππ
π π π ππ Ξ©π π
= π π π ππ
Ξ©π π
= π ππ
π = π’π ππ π
π π ππ
Ξ©π π
= π
πβ² = ππ π π ππ
Ξ©π π
29
Visual & Parallel Computing Group
Solution: Traverse
ππ
π = π’π ππ π
π π ππ
Ξ©π π
= π πβ² = ππ
π π π ππ Ξ©π π
= π π π ππ
Ξ©π π
= π
πβ² = ππ π π ππ
Ξ©π π
30
Visual & Parallel Computing Group
Solution: Traverse
Connectivity ππ
π = π’π ππ π
π π ππ
Ξ©π π
= π πβ² = ππ
π π π ππ Ξ©π π
= π π π ππ
Ξ©π π
= π
πβ² = ππ π π ππ
Ξ©π π
31
Visual & Parallel Computing Group
Solution: Traverse
Neighboring textures ππ
π = π’π ππ π
π π ππ
Ξ©π π
= π πβ² = ππ
π π π ππ Ξ©π π
= π π π ππ
Ξ©π π
= π
πβ² = ππ π π ππ
Ξ©π π
32
Visual & Parallel Computing Group
Solution: Traverse
Curvature ππ
π = π’π ππ π
π π ππ
Ξ©π π
= π πβ² = ππ
π π π ππ Ξ©π π
= π π π ππ
Ξ©π π
= π
πβ² = ππ π π ππ
Ξ©π π
33
Visual & Parallel Computing Group
Solution: Traverse
ππ
π β π’π ππ π
π π ππ
Ξ©π π
= π πβ² = ππ
π π π ππ Ξ©π π
β π π π ππ
Ξ©π π
= π
πβ² = ππ π π ππ
Ξ©π π
34
Visual & Parallel Computing Group
New solution: Discard
ππ
πΈ =
π’π ππ π π π ππ
Ξ©π
π π ππ
Ξ©π
πβ² = ππ π π ππ
Ξ©π π
35
Visual & Parallel Computing Group
ππ
πΈ =
π’π ππ π π π ππ
Ξ©π
π π ππ
Ξ©π
New solution: Discard
πβ² = ππ π π ππ
Ξ©π π
36
Visual & Parallel Computing Group
New solution: Discard
Normalize filter weight = ππ
πΈ =
π’π ππ π π π ππ
Ξ©π
π π ππ
Ξ©π
πβ² = ππ π π ππ
Ξ©π π
37
Visual & Parallel Computing Group
New solution: Discard
ππ
πΈ =
π’π ππ π π π ππ
Ξ©π
π π ππ
Ξ©π
πβ² = ππ π π ππ
Ξ©π π
πβ² = ππ
πΈ π π ππ Ξ©π π
= π’π ππ π π π ππ
Ξ©π π
= π
38
Visual & Parallel Computing Group
New solution: Discard
ππ
πΈ =
π’π ππ π π π ππ
Ξ©π
π π ππ
Ξ©π
πβ² = ππ π π ππ
Ξ©π π
πβ² = ππ
πΈ π π ππ Ξ©π π
= π’π ππ π π π ππ
Ξ©π π
= π
39
Visual & Parallel Computing Group
New solution: Discard
Resolve filter Texture filter ππ
πΈ =
π’π ππ π π π ππ
Ξ©π
π π ππ
Ξ©π
πβ² = ππ
πΈ π π ππ Ξ©π π
= π’π ππ π π π ππ
Ξ©π π
= π
πβ² = ππ π π ππ
Ξ©π π
40
Visual & Parallel Computing Group
New solution: Discard
Local information ππ
πΈ =
π’π ππ π π π ππ
Ξ©π
π π ππ
Ξ©π
πβ² = ππ π π ππ
Ξ©π π
πβ² = ππ
πΈ π π ππ Ξ©π π
= π’π ππ π π π ππ
Ξ©π π
= π
41
Visual & Parallel Computing Group
New solution: Discard
Restrict all the edges?
42
Visual & Parallel Computing Group
New solution: Discard
Restrict all the edges?
- No, only texture boundaries
Interiors are less problematic Sampler would need edge information
43
Visual & Parallel Computing Group
John McDonald [2013] * (Traverse)
C = lookup(texture, texcoord(p)) W = lookup(one, texcoord(p)) for each neighboring patch K: C += lookup(K.texture, K.texcoord(p)) W += lookup(K.one, K.texcoord(p)) return C/W
* Eliminating Texture Waste: Borderless Ptex https://developer.nvidia.com/gdc-2013/
44
Visual & Parallel Computing Group
New solution (Discard)
C = lookup(texture, texcoord(p)) W = lookup(one, texcoord(p)) //for each neighboring patch K: // C += lookup(K.texture, K.texcoord(p)) // W += lookup(K.one, K.texcoord(p)) return C/W
Part III Really?
46
Visual & Parallel Computing Group
Assumptions
Traverse Surface is not curved Texture is not stretched Discard Resolve filter and texture filter are the same
47
Visual & Parallel Computing Group
Assumptions
Traverse Surface is not curved Texture is not stretched Discard Resolve filter and texture filter are the same
They should be!
48
Visual & Parallel Computing Group
Assumptions
Traverse Surface is not curved Texture is not stretched Discard Resolve filter and texture filter are the same
Quality factors
Traverse Discard Texture filter Resolve filter (silhouettes) Geometry/texture curvature Texture filter Resolve filter
49
Visual & Parallel Computing Group
Achilles heel
DX/GL do not specify texture content all the way to the texture boundary
- Bad for magnification
Desired appearance Appearance without texture data at border
50
Visual & Parallel Computing Group
Achilles heel
Solved by Purnomo et al., 2004 * Still not in DirectX/OpenGL APIs
* B. Purnomo, J. Cohen and S. Kumar, "Seamless Texture Atlasesβ ACM SIGGRAPH/Eurographics SGP 2004
51
Visual & Parallel Computing Group
Results
Traverse Discard
52
Visual & Parallel Computing Group
Results
Traverse Discard
53
Visual & Parallel Computing Group
Results
Traverse Discard
54
Visual & Parallel Computing Group
Results
Traverse Discard
55
Visual & Parallel Computing Group
56
Visual & Parallel Computing Group
Larger error More pixels
57
Visual & Parallel Computing Group
1 in 1000 pixels have an error β₯ 0.36
58
Visual & Parallel Computing Group
1.0 0.36
1 in 1000 pixels have an error β₯ 0.36
59
Visual & Parallel Computing Group
Traverse better
60
Visual & Parallel Computing Group
Discard better
61
Visual & Parallel Computing Group
Performance
1 2 3 4 5 1x 2x 4x 8x 0,0 0,2 0,4 0,6 0,8 1x 2x 4x 8x
Render time [ms] MSAA rate MSAA rate
NVIDIA GTX 680 195W GPU Intel Iris Pro 5200 47W CPU+GPU
McDonald 2013 Discard
62
Visual & Parallel Computing Group
ISO performance
63
Visual & Parallel Computing Group
Realtime Ptex implementations
Algo gorith ithm Wide de filt lter Mem emory
- ry
Loo
- okup
kups McDonald, Burley: SIGGRAPH 2011
Real-time Ptex (Per-Face Texture Mapping)
Yes Large 1 Kim, Hillesland, Hensley: SIGGRAPH Asia 2011
A Space-efficient and hardware-friendly Implementation of Ptex
No Small 1 McDonald: GDC 2013
Eliminating Texture Waste: Borderless Ptex
Yes* Small 5/10 *: over edges only, not corners
64
Visual & Parallel Computing Group
Realtime Ptex implementations
Algo gorith ithm Wide de filt lter Mem emory
- ry
Loo
- okup
kups McDonald, Burley: SIGGRAPH 2011
Real-time Ptex (Per-Face Texture Mapping)
Yes Large 1 Kim, Hillesland, Hensley: SIGGRAPH Asia 2011
A Space-efficient and hardware-friendly Implementation of Ptex
No Small 1 McDonald: GDC 2013
Eliminating Texture Waste: Borderless Ptex
Yes* Small 5/10 *: over edges only, not corners
65
Visual & Parallel Computing Group
Realtime Ptex implementations
Algo gorith ithm Wide de filt lter Mem emory
- ry
Loo
- okup
kups McDonald, Burley: SIGGRAPH 2011
Real-time Ptex (Per-Face Texture Mapping)
Yes Large 1 Kim, Hillesland, Hensley: SIGGRAPH Asia 2011
A Space-efficient and hardware-friendly Implementation of Ptex
No Small 1 McDonald: GDC 2013
Eliminating Texture Waste: Borderless Ptex
Yes* Small 5/10 Toth: JCGT 2013
Avoiding Texture Seams by Discarding Filter Taps