ambient occlusion and edge cueing for enhancing real time molecular visualization marco tarini,...

32
Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

Upload: anna-hurst

Post on 27-Mar-2015

221 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization

Marco Tarini, Paolo Cignoni, Claudio Montani

Page 2: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

2

Background:Molecular Graphics

The discipline and philosophy of studying molecules and their properties through graphical representations

Stereotypical Scientific Visualization task• 3D shape Molecule functionality

Long story• Long bibliography• Many established techniques and principles

[ Capstone after lunch by Jane Richardson! ]

image courtesy of Accelrys

Hemagglutinin

image courtesy of Riumplus

Page 3: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

3

Background:Molecular Graphics

Many 3D Metaphors: Ball and Sticks "Licorice" modes Space Fill (CPK)

Solvent Excluded Surfaces (Connolly's) Various kind of isosurfaces

• (electron density, potential...)

Higher level abstractions: • e.g. ribbons

images(animations,

stereo images...)

insight,

understanding

3D

molecular

structure

3D represen-

tation(s)

modelling rendering

Page 4: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

4

Background:Molecular Graphics

insight,

understanding

images(animations,

stereo images...)

Problems:

Readability:• Unfamiliar, awkward 3D structures• Hard to understand 3D shapes (spatial relationships, etc)

Efficiency:• Geometric complexity (need for real time)

(e.g. for very large proteins)

3D

molecular

structure

3D represen-

tation(s)

modelling rendering

Page 5: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

5

Background:Molecular Graphics

insight,

understanding

images(animations,

stereo images...)

The content of this talk:

Advanced rendering techniques can be of great help here!

Advanced rendering techniques can be adapted to the specific case of molecular rendering

3D

molecular

structure

3D represen-

tation(s)

modelling rendering

Page 6: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

6

The rest of this talk:ad-hoc Advanced Rendering Techniques

Impostors for spheres, cylindersAmbient occlusion (for impostors)

Depth aware borders (for impostors)Localized depth cueing effect (for impostors)

Page 7: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

7

Impostor based rendering

For each primitive (sphere or cylinder): render a screen-oriented impostor quad

• per vertex:• displace vertex in screen space• preprocess all common sub-expressions

• for each fragment:• test membership (discard outliers fragments)• compute

– z – normal – lighting– texture coords (as we will see)

Page 8: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

8

The rest of this talk:ad-hoc Advanced Rendering Techniques

Impostors for spheres, cylindersAmbient occlusion (for impostors)

Depth aware borders (for impostors)Localized depth cueing effect (for impostors)

Page 9: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

9

Ambient Occlusion Global lighting technique

• Approximation of global illumination Concept:

• light each point p with normal np

with the irradiance I(p) (quantity of light directly reaching p from any direction)

dnLpI p

)()()(

in our case, L is:

k (a constant) if p visible from ω,

0 if p shadowed Effect:

• “lighted by daylight under a cloudy sky”:

Page 10: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

10

Ambient Occlusion:why

Known to conceive realism (but, we don’t care)

Local lighting Ambient Occlusion

Page 11: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

11

Ambient Occlusion:why

Known to conceive 3D shape understanding• perceptual study in [Langer & Bulthoff, TechRep 99]

Especially in our case (molecules)• large scale structures composed by multitudes of tiny shapes

→ normals ≈ noise

• see also: particle systems by [Bigler etAl. VCGT06]

Page 12: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

12

Ambient Occlusion:why

Local lighting Ambient Occlusion

Page 13: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

13

Ambient Occlusion:how

Store computed Irradiance of each point on molecule surface• (fast precomputation)

use it during rendering

PROBLEM: where do we store it?• use a texture…• for impostors!

Page 14: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

14

Texturing the molecule

A B

DCG H

FE

A

B

C

D

x,y,z gnomicprojection

unfolding

y,z gnomicprojection

unfolding

x,y,z object space u,v texture space

[Praun and

Hoppe. TG03]

Page 15: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

15

Texturing the molecule

A B

DCG H

FE

A

B

C

D

x,y,z object space u,v texture space

Page 16: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

16

Texturing the molecule

A B

DCG H

FE

ABCD

x,y,z object space u,v texture space

texel replicationsbilinear filetering

Page 17: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

17

Texturing the molecule

Global Texture for the molecule:

one texture patch for each:• atom (sphere) or• bond (cylinder)

in the scene

pack together all texture patches

(trivial)

ATOM1

BOND1

ATOM2

ATOM3

ATOM4

BOND2

ATOM5

ATOM6

ATOM7

BOND4

BOND2

BOND5

BOND6

BOND7

ATOM8

BOND8

ATOM9

ATOM10

ATOM11

BOND9

BOND10

BOND11

ATOM12

u

v

(unused)

Page 18: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

18

Texturing the moleculeFor example:

small molecule:• ~80 patches

• ~40 atoms• ~40 bonds

• texture size: 512x512 texels• patch size: 50x50 texels

large molecule:• 120.000+ patches

• 60.000+ atoms• 60.000+ bonds

• texture size: 2048x2048 texels• patch size: 6x6 texels

u

v

IRRADIANCEMAP

Page 19: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

19

Computing irradiance map on the GPU Get N directions w1..N sampling the unit sphere

For each i in (1..N) :1. render new depth-map

from view direction wi

2. render over irradiance-map: for each patch:

for each fragment (texel) f :1. invert (u,v) map

get pos p, normal np

2. project p over depth-map& check visibility (compare depths)

3. if visibile, accumulate light K(np∙wi) (if >0)

at f (with alpha blending)

project

depth-map wi

irradiance-map

Page 20: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

20

Computing irradiance map on the GPU Get N directions w1..N sampling the unit sphere

For each i in (1..N) :1. render new depth-map

from view direction wi

2. render over irradiance-map: for each patch:

for each fragment (texel) f :1. invert (u,v) map

get pos p, normal np

2. project p over depth-map& check visibility (compare depths)

3. if visibile, accumulate light K(np∙wi) (if >0)

at f (with alpha blending)

depth-map wi

irradiance-map

Renderflat impostors!- mid z (better result)- no z-displacing (much faster)

Page 21: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

21

Computing irradiance map on the GPU Get N directions w1..N sampling the unit sphere

For each i in (1..N) :1. render 2 new depth-map

from view directions wi & -wi

2. render over irradiance-map: for each patch:

for each fragment (texel) f :1. invert (u,v) map

get pos p, normal np

2. project p over depth-map& check visibility (compare depths)

3. if visibile, accumulate light K(np∙wi) (if >0)

at f (with alpha blending)

depth-map wi

irradiance-map

depth-map -wi

Page 22: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

22

The rest of this talk:ad-hoc Advanced Rendering Techniques

Impostors for spheres, cylindersAmbient occlusion (for impostors)

Depth aware borders (for impostors)Localized depth cueing effect (for impostors)

Page 23: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

23

Depth aware borders

Example• See demo

Page 24: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

24

Depth aware borders:how

Single pass technique!

A

depth

impo

stor C

B

Page 25: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

25

Depth aware borders:how

Single pass technique!

A

depth

impo

stor C

B

Page 26: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

26

Depth aware borders:how

Single pass technique!

A

depth

impo

stor C

B

Page 27: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

27

Depth aware borders:how

Single pass technique!

A

depth

impo

stor C

B

Page 28: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

28

The rest of this talk:ad-hoc Advanced Rendering Techniques

Impostors for spheres, cylindersAmbient occlusion (for impostors)

Depth aware borders (for impostors)Localized depth cueing effect (for impostors)

Page 29: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

29

Localized depth cueing (“halos”)Depth cueing (“fog”) common technique to visually separate far from near BUT:

1. far parts lose contrast (global loss of contrast)

2. cannot discriminate between too many planes

Our alternative: localized depth cueing (“halos”) like fog, but concentrate effects near depth jumps!

Similar to: [T.Luft, C.Colditz, O.Deussen. SIGGRAPH 2006] (parallel result)

See Demo!

Dal

ì

Pic

asso

Seu

ret

Mat

isse

Page 30: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

30

Localized depth cueing (“halos”)

First pass:• render geometry and depth buffer

Second pass: (alpha blended)

• render coronas around each atom• choose alpha according to

• screen distance to atom• distance of current fragment depth

from destination depth

Page 31: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

31

Putting all together

Combining:• Impostors for spheres, cylinders.• Ambient occlusion (for impostors)

• Depth aware borders (for impostors)• Localized depth cueing effect (for impostors)

with standard techniques• Direct light (Lambertian + Phong)

• Cast shadow• Standard depth cueing (fog)

• Toon shading (for illustrative renderings)

• Antialiasing (render to 2x, resample to screen)

Page 32: Ambient Occlusion and Edge Cueing for enhancing Real Time Molecular Visualization Marco Tarini, Paolo Cignoni, Claudio Montani

32

Implementation

OpenSource project win installer unix, mac versions coming up reads PDB files exports hi res. images

(e.g. for print publications)

…and small animations (e.g. for web sites, presentations)

Just Google for

GIF animation