relief clipping planes (siggraph asia 2008)

16
:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: :: 1

Upload: matthias-trapp

Post on 09-Jul-2015

521 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

1

Page 2: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

2

Matthias Trapp, Jürgen DöllnerHasso-Plattner-Institute, University of Potsdam, Germany

Relief Clipping PlanesFor Real-Time Rendering

Page 3: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

3

ResultsResults

Solid Mesh

Relief Clipping Plane

Input

Page 4: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

4

MotivationMotivation

Relief Clipping Planes (RCP):• Create more sophisticated cut-away views• Enables non-regular cut-surfaces

Contributions:• New clip plane parameterization• Automatic cap-surface generation

Implementation Goals:• Interactive configuration• Use hardware acceleration

Page 5: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

5

Relief Clip-Plane ParameterizationRelief Clip-Plane Parameterization

• O Plane Origin• U, V Direction Vectors• S = (sx,sy,sz) Scaling Vector• OM Offsetmap

( )

Vector Scaling

TexturemapOffset

Normal Plane

VectorsDirection ,

Origin

,,,,,

3

3

3

RS

OM

VUN

RVU

RO

SOMVUORCP

×=∈

=

Page 6: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

6

Clipping EquationClipping Equation

( )( )

( )( )

( ) ( )

•−⋅

•−=

⋅•−−=

<⋅+•−•

=

yN

xN

N

zsample

sV

VOPs

U

UOPT

NNOPPP

otherwisefalse

sTOMfONNPtruePRCPclip

,

0,,

Page 7: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

7

GLSL Fragment-Shader SourceGLSL Fragment-Shader Source

bool clipReliefPlane(in mat4 config, // configuration matrixin vec4 point, // position in eye-spacein sampler2D reliefSampler) // 2D relief texture

{ // calculate plane in eye space...vec3 O = (gl_ModelViewMatrix * vec4(config[0].xyz, 1.0)).xyz; vec3 A = normalize( gl_NormalMatrix * normalize(config[1].xyz) );vec3 B = normalize( gl_NormalMatrix * normalize(config[2].xyz) );vec3 N = cross(A, B);// project current fragment coordinate on planevec3 pV = point.xyz - dot(point.xyz - O, N) * N;// calculate clip texture coordinatesfloat s = dot(pV - O, A) / length(config[1].xyz);float t = dot(pV - O, B) / length(config[2].xyz);// fetch height... maybe zerofloat height = texture2D(reliefSampler, vec2(s,t) * config[3].st).x;// calculate reference plane float plane = dot(point.xyz, N) - dot(N, O) + (height * config[3].z );return (plane < 0.0 && bool(config[3].w)); // perform clipping }

Page 8: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

8

Multiple Clipping PlanesMultiple Clipping Planes

Page 9: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

9

Capping Openings – The Goal…Capping Openings – The Goal…

http://www.bmbikes.co.uk/photos/museumphotos/Broken 20R60-6 Crank.jpg

Assumption: Input Mesh is SOLID.

Page 10: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

10

Capping – The ProcessCapping – The Process

Goals:• Convey material / inner structure of the input solid• Enable assisted modeling of cap-surface appearance Solution: Polygonal Cap-Surface• Directly derived from relief-clipping plane• Rendering after the clipping pass

=+Clipped Mesh Cap-Surface Final Result

Page 11: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

11

Generating the Cap-SurfaceGenerating the Cap-Surface

A B

RCP Derived Surface Clipped Surface

Phase A:• Dynamic Mesh Refinement on GPU [Boubekeur05]• Perform displacement, shading, texturing,…Phase B:• Clip away “outside” parts of the cap-surface

Page 12: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

12

Decision ProblemDecision Problem

Which point P of the cap-surface is inside a solid S ?

Solution: Volumetric depth test

Needed: Additional data structure• Layered Depth Image (LDI) [Shade98]• Image-based representation of shape• Computed in pre-processing [Everitt01]

( )

∉∈

=SPOutside

SPInsideSPVDT ,

Page 13: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

13

Example of Layered Depth ImageExample of Layered Depth ImageDepth Layers LDI = (LDI0,…,LDI7)

3D LDI Texture Space [0,1]3

Non-Convex Polygonal Mesh S with d = 8

3D World Space IR3

s

t

x

y

Depth-Peeling

z

O O

Page 14: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

14

Volumetric Depth TestVolumetric Depth Test

r

t

Tr

(s,1,0)

(s,0,1)

Ray R

Inside

Outside

d0 d1 d2 d3

(s,0,0)

(Ts ,Tt ,0)(Ts ,Tt ,1)pT =0 pT =1 pT =0 pT =1

S

(s,1,1)

[Trapp08]

Page 15: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

15

ConclusionsConclusions

Summary• Advanced clipping approach• Real-time rendering technique• Fully implemented on GPU

Drawbacks• Needs additional data structure• Needs high-tessellated cap-surface

Future Work• Generalized approach for clipping

Page 16: Relief Clipping Planes (SIGGRAPH ASIA 2008)

:: :: :: Relief Clipping Planes For Real-Time Rendering :: Matthias Trapp :: ::

16

Thank You ! - Questions ? Thank You ! - Questions ?

Contact:Matthias [email protected]

Jürgen Dö[email protected]

Computer Graphics Systems Grouphttp://www.hpi.uni-potsdam.de/doellner/