rendering geometry with relief textures

52
1 Rendering Geometry with Relief Textures L.Baboud X.Décoret L.Baboud X.Décoret ARTIS-GRAVIR/IMAG-INRIA ARTIS-GRAVIR/IMAG-INRIA

Upload: milton

Post on 05-Jan-2016

39 views

Category:

Documents


1 download

DESCRIPTION

Rendering Geometry with Relief Textures. L.Baboud X.Décoret ARTIS-GRAVIR/IMAG-INRIA. Height-field representation. What can we represent? How to render it? Fast ? Exact? Previous work Our contributions. Height-field. Function from [0,1] 2 to [0,1] Represents a surface - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Rendering Geometry with Relief Textures

1

Rendering Geometry withRelief Textures

L.Baboud X.DécoretL.Baboud X.DécoretARTIS-GRAVIR/IMAG-INRIAARTIS-GRAVIR/IMAG-INRIA

Page 2: Rendering Geometry with Relief Textures

2

Height-field representationHeight-field representation

What can we represent?What can we represent? How to render it?How to render it?

Fast ?Fast ? Exact?Exact?

Previous workPrevious work Our contributionsOur contributions

Page 3: Rendering Geometry with Relief Textures

3

Height-fieldHeight-field

Function from [0,1]2 to [0,1] Represents a surface Sampled in a texture

Memory/GPU efficient

(a) Height texture (b) Reconstructed surface

Page 4: Rendering Geometry with Relief Textures

4

Height-fieldHeight-field

Function from [0,1]2 to [0,1] Represents a surface Sampled in a texture

Memory/GPU efficient

Theory: How do you reconstruct?

Practice: Which interpolation for texture lookups?

Refer to the paper for details

(a) nearest

(b) linear

Page 5: Rendering Geometry with Relief Textures

5

How to render?How to render?

PolygonalizePolygonalize Simple & naturalSimple & natural Costly, not output sensitiveCostly, not output sensitive Aliasing -> LODAliasing -> LOD

Small coverage

Large coverage

What if the object is not the “main” one? Bump Small objects

Page 6: Rendering Geometry with Relief Textures

6

How to render?How to render?

PolygonalizePolygonalize Simple & naturalSimple & natural Costly, not output sensitiveCostly, not output sensitive Aliasing -> LODAliasing -> LOD

Ray-tracingRay-tracing Slow? Feasible on GPU!Slow? Feasible on GPU! Output sensitiveOutput sensitive

Page 7: Rendering Geometry with Relief Textures

7

Ray-tracingRay-tracing

Existing solution : VDM Existing solution : VDM [Wang 2003][Wang 2003]

Sampling in all viewing directionsSampling in all viewing directions Memory costly Memory costly (4 Mb compressed for 128x128)(4 Mb compressed for 128x128)

Use GPU capabilities insteadUse GPU capabilities instead

Page 8: Rendering Geometry with Relief Textures

8

Principle (1/2)Principle (1/2)

Top view

2D slice

Page 9: Rendering Geometry with Relief Textures

9

Principle (2/2)Principle (2/2)

Comparing heightsComparing heights Along rayAlong ray In the heightfieldIn the heightfield

Until we pass belowUntil we pass below

Page 10: Rendering Geometry with Relief Textures

10

Policarpo Policarpo [I3D 05][I3D 05]

How many iterations?

Is it correct?

Binarysearch

Page 11: Rendering Geometry with Relief Textures

11

Policarpo Policarpo [I3D 05][I3D 05]

Missed intersection

Page 12: Rendering Geometry with Relief Textures

12

Policarpo Policarpo [I3D 05][I3D 05]

Fixed sizesteps

Binarysearch

Better but still potentially false

Page 13: Rendering Geometry with Relief Textures

13

Policarpo Policarpo [I3D 05][I3D 05]

Fixed sizesteps

Binarysearch

Amounts to vertical slicing

Size of steps along the ray depends on ray tilt

Missedintersection

Page 14: Rendering Geometry with Relief Textures

14

Policarpo Policarpo [I3D 05][I3D 05]

Page 15: Rendering Geometry with Relief Textures

15

Tatarchuk Tatarchuk [I3D06][I3D06]

Varying size steps (between two bounds) Depending on ray tilt

Page 16: Rendering Geometry with Relief Textures

16

Conclusion on existing methodsConclusion on existing methods

Advantages : speed Drawbacks : missed intersections

(at grazing angles)

Use it for bump

Policarpo05 Tatarchuk06

Page 17: Rendering Geometry with Relief Textures

17

Being exact, what for?Being exact, what for?

Intellectually rewarding Intellectually rewarding Usability large scale geometryUsability large scale geometry

Terrain, buildings, architectural detailsTerrain, buildings, architectural details Objects (cars, etc.)Objects (cars, etc.)

How many polygons ?

Page 18: Rendering Geometry with Relief Textures

18

Being exact, what for?Being exact, what for?

Intellectually rewarding Intellectually rewarding Usability large scale geometryUsability large scale geometry

Terrain, buildings, architectural detailsTerrain, buildings, architectural details Objects (cars, etc.)Objects (cars, etc.)

Only 6 quads !

Page 19: Rendering Geometry with Relief Textures

19

Being exact, is it hard?Being exact, is it hard?

Problem with constant stepsProblem with constant steps Can always miss intersectionsCan always miss intersections

Page 20: Rendering Geometry with Relief Textures

20

Being exact, is it hard?Being exact, is it hard?

Problem with constant stepsProblem with constant steps Can always miss intersectionsCan always miss intersections Travel slowly above empty spaceTravel slowly above empty space

Page 21: Rendering Geometry with Relief Textures

21

Being exact, is it hard?Being exact, is it hard?

Problem with constant stepsProblem with constant steps Can always miss intersectionsCan always miss intersections Travel slowly above empty spaceTravel slowly above empty space

Our contributionsOur contributions Amanatides based approach Amanatides based approach Failsafe approachFailsafe approach

But requires preprocessBut requires preprocess

solves

Page 22: Rendering Geometry with Relief Textures

22

Adapted Amanatides traversalAdapted Amanatides traversal

We run along the ray on texel edges

Page 23: Rendering Geometry with Relief Textures

23

Adapted Amanatides traversalAdapted Amanatides traversal

We run along the ray on texel edges Advantages :

very simple iterations exact intersection

fragment shader main loop

Page 24: Rendering Geometry with Relief Textures

24

Adapted Amanatides traversalAdapted Amanatides traversal

We run along the ray on texel edges Advantages :

very simple iterations exact intersection

Drawbacks : potentially many iterations texture resolution dependent

Page 25: Rendering Geometry with Relief Textures

25

Adapted Amanatides traversalAdapted Amanatides traversal

Texture resolution dependentTexture resolution dependent Double resolution Double resolution half speed half speed Ideally should depend on “variations” of Ideally should depend on “variations” of

heightfield, not sampling frequencyheightfield, not sampling frequency Binary search doesn’t have this drawbackBinary search doesn’t have this drawback

Constant number of texture lookupsConstant number of texture lookups

Page 26: Rendering Geometry with Relief Textures

26

Analysis of binary searchAnalysis of binary search

At the moment we pass belowAt the moment we pass below At leastAt least one intersection one intersection But potentially severalBut potentially several ?

2D slice

Page 27: Rendering Geometry with Relief Textures

27

Analysis of binary searchAnalysis of binary search

At the moment we pass belowAt the moment we pass below At leastAt least one intersection one intersection But potentially severalBut potentially several Ideally : Ideally : at mostat most one intersection one intersection

How can we guarantee this?

Precompute safety radius

2D slice

?

Page 28: Rendering Geometry with Relief Textures

28

What is safety radius ?What is safety radius ?

Local informationLocal information

Top view

T

?

Which step ?

For any possible viewingray passing above T

Precomputed radius

Page 29: Rendering Geometry with Relief Textures

29

What is safety radius ?What is safety radius ?

Local informationLocal information

Safety radius

Viewing direction

considered texel

Page 30: Rendering Geometry with Relief Textures

30

What is safety radius ?What is safety radius ?

Local informationLocal information In 3D : for each texel :In 3D : for each texel :

Scan every directionScan every direction Keep the minimum radiusKeep the minimum radius

Page 31: Rendering Geometry with Relief Textures

31

Failsafe binary searchFailsafe binary search

Page 32: Rendering Geometry with Relief Textures

32

Failsafe binary searchFailsafe binary search

Page 33: Rendering Geometry with Relief Textures

33

Failsafe binary searchFailsafe binary search

Page 34: Rendering Geometry with Relief Textures

34

Failsafe binary searchFailsafe binary search

Page 35: Rendering Geometry with Relief Textures

35

Failsafe binary searchFailsafe binary search

Page 36: Rendering Geometry with Relief Textures

36

Failsafe binary searchFailsafe binary search

Page 37: Rendering Geometry with Relief Textures

37

Failsafe binary searchFailsafe binary search

Page 38: Rendering Geometry with Relief Textures

38

Failsafe binary searchFailsafe binary search

Page 39: Rendering Geometry with Relief Textures

39

Failsafe binary searchFailsafe binary search

Page 40: Rendering Geometry with Relief Textures

40

Failsafe binary searchFailsafe binary search

Page 41: Rendering Geometry with Relief Textures

41

Various detailsVarious details

TexturesTextures Can have different resolutionsCan have different resolutions

Normal, color, heightNormal, color, height Can be packed/compressedCan be packed/compressed

Needs recent fragment shaders supporting Needs recent fragment shaders supporting dynamic loopsdynamic loops

Page 42: Rendering Geometry with Relief Textures

42

ResultsResults

Fast and exact Height-field regularity dependent Correct interaction with Z-bufferCorrect interaction with Z-buffer Output sensitiveOutput sensitive

Page 43: Rendering Geometry with Relief Textures

43

Height-field representationHeight-field representation

What can we represent?What can we represent? How to render it?How to render it?

Fast ?Fast ? Exact?Exact?

Previous workPrevious work Our contributionsOur contributions

Page 44: Rendering Geometry with Relief Textures

44

More than bumpMore than bump

Previous methods : small scale bumpPrevious methods : small scale bump Curved surfaces : warping considerationsCurved surfaces : warping considerations

VDM [Wang 03]VDM [Wang 03] [Policarpo05][Policarpo05]

We want to do large scaleWe want to do large scale Problem : limited expressivenessProblem : limited expressiveness

orthogonal height-fieldsorthogonal height-fields

Page 45: Rendering Geometry with Relief Textures

45

Expressiveness of heightfieldsExpressiveness of heightfields

Lack of samples on vertical sidesLack of samples on vertical sides

Page 46: Rendering Geometry with Relief Textures

46

Projective height-fieldsProjective height-fields

Page 47: Rendering Geometry with Relief Textures

47

Projective height-fieldsProjective height-fields

Similar to “cubist images” Similar to “cubist images” [Hanson 98][Hanson 98]

Projective transforms preserve linesProjective transforms preserve lines Unmodified algorithmUnmodified algorithm

Page 48: Rendering Geometry with Relief Textures

48

Projective height-fieldsProjective height-fields

Wasted fillrateWasted fillrate Many eventually discarded fragmentsMany eventually discarded fragments Easy to solve : clip the bounding boxEasy to solve : clip the bounding box

(a) not clipped (b) clipped

Page 49: Rendering Geometry with Relief Textures

49

Multiple height-fieldsMultiple height-fields

Page 50: Rendering Geometry with Relief Textures

50

ConclusionConclusion

Remember fast and exact is possible! Efficient representation

Small memory footprint Automatic LOD

Two useful methods (dynamic/static)Two useful methods (dynamic/static)

Page 51: Rendering Geometry with Relief Textures

51

FutureFuture

Geometry representable with heightfieldsGeometry representable with heightfields Because we are exactBecause we are exact

Model directly with heightfieldsModel directly with heightfields Photoshop 3D [Mok01]Photoshop 3D [Mok01]

Apply to judicious situationsApply to judicious situations

Page 52: Rendering Geometry with Relief Textures

52

FutureFuture

Thank you!Thank you! Questions?Questions?