Fast Non-Linear Projections using Graphics Hardware

54
I3D 2008 1 Fast Non-Linear Projections using Graphics Hardware Jean-Dominique Gascuel, Nicolas Holzschuch, Gabriel Fournier, Bernard Péroche I3D 2008

description

Fast Non-Linear Projections using Graphics Hardware. Jean-Dominique Gascuel, Nicolas Holzschuch, Gabriel Fournier, Bernard Péroche I3D 2008. Non-linear projections: What & Why ?. [wiki.panotools.org, Ben Kreunen]. [lensmateonline.com]. [Kautz et al., 2004] Cosine sphere for local shadows. - PowerPoint PPT Presentation

Transcript of Fast Non-Linear Projections using Graphics Hardware

Page 1: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 1

Fast Non-Linear Projections using Graphics Hardware

Jean-Dominique Gascuel, Nicolas Holzschuch, Gabriel Fournier, Bernard Péroche

I3D 2008

Page 2: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 2

Non-linear projections: What & Why ?

[lensmateonline.com][wiki.panotools.org, Ben Kreunen]

Page 3: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 3

Motivations

[Kautz et al., 2004]Cosine sphere for local shadows

[Heidrich & Seidel,1998]Introduced Parabola envmaps

[Osman et al., 2006]Dual parabola shadowmaps

Page 4: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 4

Previous work

[Kautz 2004] CPU rasterization

Close papers:[Fournier 2005] Indirect illumination

[Loyd 2006] Logarithmic shadow maps

[Hou 2006] Multi perspective reflections

[Liu 2007] Non linear beam tracing

GPU based, same rendering pipeline & FS

Page 5: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 5

Our contributions

Targeted to a specific class of non-linear projections– Single center of projection– Convex, C1, and invertible

• Each triangle maps to one simple shape.

• Simple equations for projected edges.

• Fast ~x2 to x4 times faster than cubemaps or hemicubes.

• Everything is done on the GPU

Page 6: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 6

Plan• Introduction• Case studies

– Sphere projection– Parabola projection– Other projections

• Rendering Pipeline• Triangle Based Bounding• Quad Based Bounding• Demo & Results• Conclusion

Page 7: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 7

Sphere projection 1/5

Page 8: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 8

Sphere projection 2/5

Page 9: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 9

Sphere projection 3/5

Page 10: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 10

Sphere projection 4/5

Page 11: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 11

Sphere projection 5/5

Page 12: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 12

Triangles made of known ellipses

Looking at the2D screen:

Page 13: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 13

Plan

• Introduction• Case studies

– Sphere projection– Parabola projection– Other projections

• Rendering Pipeline• Triangle Based Bounding• Quad Based Bounding• Demo & Results• Conclusion

Page 14: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 14

Parabola projection 1/3

Page 15: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 15

Parabola projection 2/3

Page 16: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 16

Parabola projection 3/3

Page 17: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 17

Parabola: 3D line 2D circle1/2

Page 18: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 18

Triangles made of arcs 2/2

Page 19: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 19

Plan

• Introduction• Case studies

– Sphere projection– Parabola projection– Other projections

• Rendering Pipeline• Triangle Based Bounding• Quad Based Bounding• Demo & Results• Conclusion

Page 20: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 20

Other projections…

Fisheyesarcs with: • single minimum in

normal direction,• possible maximum

at extremities.

Page 21: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 21

Application-driven choice

• Spherelighting solid angle x cos

• Parabolaenvmaps less distortions

• Lambertambient occlusion equal area

• Fish eye 2Ideal photographic fish-eye

Page 22: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 22

Plan

• Introduction• Case studies • Rendering Pipeline

• Triangle Based Bounding

• Quad Based Bounding

• Demo & Results

• Conclusion

Page 23: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 23

Rendering strategy

Page 24: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 24

FS: Ray-casting

FS discards pixels outside original 3D triangle• unproject: 2D fragment coordinates 3D ray direction• ray/triangle intersection

Page 25: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 25

FS: Interpolations

Mimic linear interpolation inside the 3D triangle

Non-linear interpolation in 2D screen

For all vertex varying attributes: normals, colors, texture coordinates, etc.

Ray-intersect gives barycentric coordinates α, β

dot product: (1, α, β) . (C0, C1-C0, C2-C0)

Page 26: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 26

Plan

• Introduction• Case studies • Rendering Pipeline• Triangle Based Bounding

– Basic Triangle– Near plane Clipping– Concave Covering Triangle

• Quad Based Bounding• Demo & Results• Conclusion

Page 27: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 27

Bounding triangle 1/2

Page 28: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 28

Bounding Triangle2/2

Page 29: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 29

Triangle Covering

Page 30: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 30

Plan

• Introduction• Case studies • Rendering Pipeline• Triangle Based Bounding

– Basic Triangle– Near plane Clipping– Concave Covering Triangle

• Quad Based Bounding• Demo & Results• Conclusion

Page 31: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 32

Camera Plane Clipping 1/3

Page 32: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 33

Camera Plane Clipping 2/3

Page 33: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 34

Camera Plane Clipping 3/3

Page 34: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 35

Plan

• Introduction• Case studies • Rendering Pipeline• Triangle Based Bounding

– Basic Triangle– Near plane Clipping– Concave Covering Triangle

• Quad Based Bounding• Demo & Results• Conclusion

Page 35: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 36

Concave Covering Triangle 1/2

Page 36: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 37

Concave Covering Triangle 2/2

1 input triangle 1 to 4 bounding triangles

Page 37: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 38

Plan

• Introduction• Case studies

• Rendering Pipeline

• Triangle Based Bounding

• Quad Based Bounding

• Demo & Results

• Conclusion

Page 38: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 39

Needed because

1. We don’t have easy tangents for Fisheyes projections

2. G80 geometry shader take worst case timing:

4 output triangles in some rare case x4 slowdown everywhere in GS…

Page 39: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 40

Oriented Bounding Box

“Easy” for a single ellipse.

Page 40: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 41

Quad coverage scheme

Merge extremal points into a single aaBB

Page 41: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 42

Parabola projection

…Bent triangles are made of circles… Any axis will work.

optimal axis aligned bounding box

Page 42: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 44

Plan

• Introduction

• Case studies

• Rendering Pipeline

• Triangle Based Bounding

• Quad Based Bounding

• Demo & Results

• Conclusion

Page 43: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 45

Example scenes

Lemmings

Page 44: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 46

Triangles

37% overdraw

Page 45: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 47

Aligned bbox

107% overdrawBut FASTER on G80

Page 46: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 48

Test scene2/4

Cubemaps/hemicube

Page 47: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 49

Test scene3/4

Columns = Thin triangles,With large deformations

Page 48: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 50

Test scenes 4/4

Sphere – 560K triangles« Real life »

Page 49: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 51

Inside the OpenGL pipeline

Facades

Page 50: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 52

Cubemap vs. Parabola-map

Color(ms)

Depth

(ms)

Coverage(ms)

6 x 512x512 cubemaps2x 512x512 parabola

2590716

548

157

490

121

6 x 16x16 cubemaps2 x 16x16 parabola

8.83.4

5.2

2.6

4.8

2.2

• Better quality than cubemaps

Heidrich, Laine, Osman• Lower memory footprint

• Low triangle scenes:~ x2 to x4 speedups (better on hi res)

Page 51: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 53

Hemicube vs non-linear projection

Color(ms)

Depth

(ms)

Coverage(ms)

5 × 512 × 512 hemicube

1 × 512 × 512 parabola

1 × 512 × 512 sphere map

1 × 512 × 512 Lambert

1500

375

433

396

375

79

71

80

320

61

61

67

5 × 16 × 16 hemicube

1 × 16 × 16 parabola

7.1

2.5

4.3

1.9

4.0

1.6

Low triangle scenes:~ x2.5 to x5 speedups (better on hi res)

Page 52: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 54

Plan

• Introduction

• Case studies

• Rendering Pipeline

• Triangle Based Bounding

• Quad Based Bounding

• Demo & Results

• Conclusion

Page 53: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 55

Conclusion• Implemented Non-linear projections on GPU

– Specific class of projections, useful for many applications– Tight bounding shapes– Faster than cubemaps

• Projections:– Parabola: optimal BB fast overall computations– Sphere: sub-optimal BB, still fast– Other (Lambert/Fisheye): generic BB, lots of overdraw

Full sources at http://artis.inrialpes.fr/Publications

Page 54: Fast Non-Linear Projections using Graphics Hardware

I3D 2008 56

Future Directions

• Better quad bounding for Lambert & fisheyeShould be ~ Sphere projection

• Improve GS bottleneck– Faster, not worst case based (NVidia’s job)– Multi pass triangle bounding

• Multiple layers rendering (all faces at once)

• Deferred shading

• Benchmark within a local/global lighting framework.