Interactive Volumetric Lighting Simulating Scattering and Shadowing

29
Interactive Volumetric Lighting Simulating Scattering and Shadowing Timo Ropinski Christian D¨ oring Christof Rezk-Salama Slides & Presentation: Marc Sunet November 14, 2014

Transcript of Interactive Volumetric Lighting Simulating Scattering and Shadowing

Page 1: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Interactive Volumetric Lighting SimulatingScattering and Shadowing

Timo RopinskiChristian Doring

Christof Rezk-Salama

Slides & Presentation: Marc Sunet

November 14, 2014

Page 2: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Table of contents

Introduction and Related Work

Volumetric Illumination Model

Light Volume Calculation

Rendering

Results

Future Work

Page 3: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Volumetric Lighting

Simple case: gradient-based Phong local illumination model.

I Relies on a well-defined gradient as a substitute for surface normal.

I Does not take neighbourhood information into account.

Illumination model in this paper (not physically correct):

I Diffuse scattering effects.

I Shadow computation decoupled from scattering, resulting in hardshadows → optimal for perception.

I Surface-like reflection.

I Direct control over surface-like reflection and scattering.

Page 4: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Paper’s volumetric illumination model

Page 5: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Lighting Model: Emission + Attenuation

L(~x , ~ωo) =

∫ ~x

~x0

Le(~x ′) · T (~x ′, ~x)d~x ′

ωo

x

x0

x′

Page 6: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Lighting Model: + Point or Directional Light

L(~x , ~ωo) =

∫ ~x

~x0

(Le(~x ′) + s(~x ′, ~ωi , ~ωo) · Li (~x ′, ~ωi )) · T (~x ′, ~x)d~x ′

Li (~x , ~ωi ) = LL · T (~x , ~xL) s(~x , ~ωi , ~ωo) = τ(~x) · p(~x , ~ωi , ~ωo)

ωo

x

x0

ωi

xL, LL

x′

Page 7: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Lighting Model: + Background Light

L(~x , ~ωo) =

∫ ~x

~x0

(Le(~x ′) + s(~x ′, ~ωi , ~ωo) · Li (~x ′, ~ωi )) · T (~x ′, ~x)d~x ′

+ L0 · T (~xo , ~x)

ωo

x

x0

ωi

xL, LL

L0x′

Page 8: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Lighting Model: + Scattering effects

x

x0

x′

Page 9: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Lighting Model: + Scattering effects

So far:

L(~x , ~ωo) =

∫ ~x

~x0

(Le(~x ′) + s(~x ′, ~ωi , ~ωo) · Li (~x ′, ~ωi )) · T (~x ′, ~x)d~x ′

Indirect light should be integrated along all directions ~ωi′ in the unit

sphere:

L(~x , ~ωo) =

∫ ~x

~x0

((Le(~x ′) +

∫Ω

s(~x ′, ~ωi′, ~ωo) · Li (~x ′, ~ωi

′)dω′i ))· T (~x ′, ~x)d~x ′

But this is an overkill for most scientific applications.

Plus, hard shadows are better from a perception point of view.

Page 10: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Lighting Model: + Scattering with Hard Shadows

L(~x , ~ωo) =

∫ ~x

~x0

(Le(~x ′) + q(~x ′, ~ωi , ~ωo)) · T (~x ′, ~x)d~x ′ + L0 · T (~xo , ~x)

ωo

x

x0

ωi

xL, LL

L0x′

Blurs incoming light

Page 11: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Lighting Model: + Scattering with Hard Shadows

L(~x , ~ωo) =

∫ ~x

~x0

(Le(~x ′) + q(~x ′, ~ωi , ~ωo)) · T (~x ′, ~x)d~x ′ + L0 · T (~xo , ~x)

q(~x , ~ωi , ~ωo) = t(~x) · c(~x , ~ωo) · li (~x , ~ωi )

c(~x , ~ωo) =

∫Ω

τ(~x) · p(~x , ~ωi′, ~ωo) · c(~x , ~ωi

′)d~ωi′

p(~x , ~ωi′, ~ωo) =

C · (~ωi

′ · ~ωo)β : if ~ωi′ · ~ωo < θ(~x)

0 : otherwise

Page 12: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Light Volume Calculation

We avoid casting secondary rays when rendering (massive overhead)→ lighting computation brought from image to volume space

Page 13: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Light Volume Calculation

Two pass algorithm:

1. Compute c(~x , ~ωo) and li (~x , ~ωi ) → light-dependent

2. Blend in outgoing light scattering → view-dependent

ωo

x

x0

ωi

xL, LL

L0x′

Blurs incoming light (1)

Blurs outgoing light (2)

Page 14: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Light Volume Calculation

Light propagation done directly in volume space, slice by slice:

Page 15: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Light Volume Calculation

Direction in which light is propagated must be chosen:

Sort visible faces Fi using ~nFi · (~xl − ~cFi ).

~dirmax = −~nF0 , where F0 is the face that maximises the projection onto ~xl .

Page 16: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Light Volume Calculation: Incoming Light

Compute c(~x , ~ωo) and li (~x , ~ωi ), moving front to back and away from thelight source:

c(~xi , ~ω) = (1− voxel.a) · c(~xi−1, ~ω) + voxel.a · voxel.rgb

li (~xi , ~ω) = (1− voxel.a) · li (~xi−1, ~ω) + voxel.a

xi

ωi

xi−1

c(~xi−1, ~ω) obtained by samplingneighbours around ~xi−1.

li (~xi , ~ω) obtained with a single tex-ture fetch.

Page 17: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Light Volume Calculation: Outgoing Light

Compute c(~x , ~ωo) and li (~x , ~ωi ) using the same formula, but moving backto front and towards the viewer. Blend chromaticities and chooseminimum luminance.

xixi−1

ωo

Page 18: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Implementation issues

I Rendering to 3D texture is only possible along z-axis.

I If ~dirmax is not z-axis, a permutation is required.

I If light position is inside volume, there is no single light propagationdirection.

I Project ~xl onto F0 and apply the described algorithm.

I Four channel illumination volume is expensive for large data sets.

I Chromaticity variations are not as noticeable as variations inluminance.

I Apply chroma subsampling.I 1 downscaled RGB texture for c(~x , ~ωo).I 1 R texture for li (~x , ~ωi ) of original size.

I Changes in light position produces popping when switching lightpropagation directions.

I Use blend direction from face F1 to avoid popping.

Page 19: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Avoiding popping

Perform additional pass along blend direction −~nF1 , given by F1 (thesecond face that maximises projection):

Page 20: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Rendering

Input: light volume calculated in previous pass.→ 3D RGBA texture, or R + RGB with chroma subsampling.

RGB : chromaticity c(~x , ~ω)

A : attenuated luminance li (~x , ~ω)

Apply standard compositing, based on

t(~x) transport colour, given by transfer function.

c(~x , ~ω) chromaticity.

li (~x , ~ω) attenuated luminance.

Le(~x) Emissive colour.

Page 21: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Rendering

To simulate materials with a high degree of specularity:

1. Compute achromatic specular intensity cs(~x) as in thegradient-based Phong model.

2. Compute gradient magnitude | 5 τ(~x)|

3. Compute intensity I = | 5 τ(~x)| · cs(~x) · li (~x , ~ω)

Page 22: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Rendering

Final note:

When using chroma subsampling, two texture fetches are required:

I One into original shadow volume to get li (~x).

I One into downsampled scattering volume to get c(~x , ~ω).

Page 23: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Results

Phong (left) vs paper’s method (right)

Scattering provides more realistic lighting.

Hard shadows enhance structure perception.

Page 24: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Results

Phong (left) vs paper’s method (right)

Poor spatial comprehension when applying Phong to volumes with lowsignal to noise ratios vs paper’s model.

Page 25: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Results

Frame rates measured over 1000 frames and then averaged.

Rendered object rotated about its local up vector.

”No regen”: light position is static and illumination volume need not be(and is not) regenerated (view-dependent pass not performed?).

”Regen”: light position is dynamic and illumination volume isregenerated every frame.

Page 26: Interactive Volumetric Lighting Simulating Scattering and Shadowing

User Study

Illumination model is not physically correct, so user study is performed toevaluate its quality:

I User study focused on depth perception.

I Images of Phong illumination and paper’s model are shown to andevaluated by users.

I In a first test, circular markers were shown per image. Users had todecide which one was closer to them. Time taken to decide onmarker is also measured.

I In a second test, users had to estimate depth of shown marker.

I In a third test, users were shown pairs of images side by side, oneusing Phong and another one using paper’s method. Users had todecide which of two images was more visually appealing.

Page 27: Interactive Volumetric Lighting Simulating Scattering and Shadowing

User Study

Page 28: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Future Work

I Integrate light sources into illumination model by projecting themonto volume’s border and then propagating light.

I Investigate the influence of multiple light sources.I Model’s hard shadows vs ground truth.I Evaluate influence of chroma subsampling.

Page 29: Interactive Volumetric Lighting Simulating Scattering and Shadowing

Links

Interactive Volumetric Lighting Simulating Scattering and Shadowing

http://www.voreen.org/Publication-2010-RDR10a.html