1 rendering geometry with relief textures l.baboud x.décoret artis-gravir/imag-inria

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: clifton-harrison

Post on 02-Jan-2016

218 views

Category:

Documents


1 download

TRANSCRIPT

1

Rendering Geometry withRelief Textures

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

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

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

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

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

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

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

8

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

Top view

2D slice

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

10

Policarpo Policarpo [I3D 05][I3D 05]

How many iterations?

Is it correct?

Binarysearch

11

Policarpo Policarpo [I3D 05][I3D 05]

Missed intersection

12

Policarpo Policarpo [I3D 05][I3D 05]

Fixed sizesteps

Binarysearch

Better but still potentially false

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

14

Policarpo Policarpo [I3D 05][I3D 05]

15

Tatarchuk Tatarchuk [I3D06][I3D06]

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

16

Conclusion on existing methodsConclusion on existing methods

Advantages : speed Drawbacks : missed intersections

(at grazing angles)

Use it for bump

Policarpo05 Tatarchuk06

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 ?

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 !

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

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

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

22

Adapted Amanatides traversalAdapted Amanatides traversal

We run along the ray on texel edges

23

Adapted Amanatides traversalAdapted Amanatides traversal

We run along the ray on texel edges Advantages :

very simple iterations exact intersection

fragment shader main loop

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

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

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

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

?

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

29

What is safety radius ?What is safety radius ?

Local informationLocal information

Safety radius

Viewing direction

considered texel

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

31

Failsafe binary searchFailsafe binary search

32

Failsafe binary searchFailsafe binary search

33

Failsafe binary searchFailsafe binary search

34

Failsafe binary searchFailsafe binary search

35

Failsafe binary searchFailsafe binary search

36

Failsafe binary searchFailsafe binary search

37

Failsafe binary searchFailsafe binary search

38

Failsafe binary searchFailsafe binary search

39

Failsafe binary searchFailsafe binary search

40

Failsafe binary searchFailsafe binary search

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

42

ResultsResults

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

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

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

45

Expressiveness of heightfieldsExpressiveness of heightfields

Lack of samples on vertical sidesLack of samples on vertical sides

46

Projective height-fieldsProjective height-fields

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

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

49

Multiple height-fieldsMultiple height-fields

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)

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

52

FutureFuture

Thank you!Thank you! Questions?Questions?