- 307 Views
- Uploaded on

Download Presentation
## Practical Logarithmic Shadow Maps

**An Image/Link below is provided (as is) to download presentation**

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

### Practical Logarithmic Shadow Maps

Brandon Lloyd UNC-CH

Naga Govindaraju UNC-CH

David Tuft UNC-CH

Steve Molnar Nvidia

Dinesh Manocha UNC-CH

Motivation

- Interactive shadow computation remains a challenge
- increasing scene complexity
- large, open environments
- user expect high quality

Shadow maps

- Simple two pass algorithm
- Supports wide range of geometric representations
- Cheap to render
- Disadvantage:Aliasing artifacts at shadow edges

Increase sample density where needed by reparametrizing the shadow mapWarping algorithms

Light-space perspective shadow maps (LSPSMs) [Wimmer et al. 2004]

Perspective shadow maps(PSMs) [Stamminger and Drettakis 2002]

Trapezoidal shadow maps(TSMs) [Martin and Tan 2004]

Main results

- Logarithmic parameterization for directional and point lights
- Error analysis for point lights
- Hardware architecture enhancements for logarithmic rasterization

Outline

- Related work
- Aliasing error
- Logarithmic parameterization
- Hardware architecture
- Results

Separate shadow maps for different parts of the scene

Includes cascaded shadow maps

Plural sunlight buffers [Tadamura et al. 1999,2001]

Partitioning algorithmsAdaptive shadow maps [Fernando et al. 2001; Lefohn et al. 2006]

Tiled shadow maps [Arvo 2004]

Warping + partitioning

- 4x4 matrix
- Lixel for every pixel[Chong and Gortler 2004]
- PSM with cube maps[Kozlov 2004]
- Warping + various frustum partitioning schemes [Lloyd et al. 2006]
- Dual paraboloid [Brabec et al. 2002]

Specialized representations

Silhouette shadow maps[Sen et al. 2004]

Irregular shadow maps[Johnson et al. 2004,2005; Aila and Laine 2004]

- Solves the aliasing problem
- GPU support requires major changes

Outline

- Related work
- Aliasing error
- Logarithmic parameterization
- Hardware architecture
- Results

wi

wi

wl

'

'

'

'

cos θi

wl

m=

≈

wi

cos θl

θl

wl

Perspectivealiasing

θi

wi

cos θi

Projectionaliasing

cos θl

Aliasing errorlight

beam

wl

image

beam

wi

wi

wl

wl

'

'

'

'

cos θi

wl

m=

≈

wi

cos θl

θl

wl

Perspectivealiasing

θi

wi

cos θi

Projectionaliasing

cos θl

Aliasing errorlight

beam

wl

image

beam

wi

To eliminate perspective aliasing:wl ≤wi

Light beam width depends on:

Shadow map resolution

Parameterization

Controlling aliasing errorlight

beam

image

beam

wl

wi

Outline

- Related work
- Aliasing error
- Logarithmic parameterization
- Directional light
- Point light
- Hardware architecture
- Results

Directional light

light

1. Light beam widths

2. Texel spacing function

1

t

light image

plane

z

3. Parameterization

wl

wi

imagebeam

[Wimmer et al. 04]

Directional light

With 4x4 matrix

With logarithm

Uniform

beam width

Linear

z

beam width

Quadratic

z

beam width

z

10

6

10

4

Shadow maptexels / image texels

10

2

10

0

10

1

2

3

4

10

10

10

10

f / n

ComparisonStandard

Perspective

Logarithmic

frustum fov = 60○

Parameterization for exact function is complicated

Fit two parabolas:

Parameterization:

Fitting the spacing function - zPoint light spacing function

0

z

vc = Pv

vn= vc /wc

To screen coordinates

s = a0ln( a1xn + a2 ) + a3

t = b0ln( b1zn + b2 ) + b3

4x4 matrix + logarithmvc : [xc zc ycwc]T - clip coordinate

vn : [xn zn yn 1]T - normalized device coordinate

v : [x z y 1]T - world coordinate

P : perspective or orthographic projection matrix

a0-a3 : constants

b0-b3 : constants

Parameterization summary

Spacing functions from4x4 matrix + log

Actual spacing functions

Directional

Point

without log

with log

x:

ortho.

z:

persp.

Outline

- Related work
- Aliasing error
- Logarithmic parameterization
- Hardware architecture
- Results

Vertex program

- Transform vertices on the GPU
- Requires finely tesselated model
- Increases burden on vertex processor
- Adaptive tesselation complicated
- Easier with DX10 geometry shaders

Brute force rasterization

Render bounding primitive

Transform fragments to original triangle

Discard if not inside

10x slow down

Computing bounding primitive is complicated

Easier with DX10 geometry shaders

Fragment programGraphics pipeline

vertex processor

memory

interface

clip & back-face cull

rasterizer

fragment processor

alpha, stencil,

& depth tests

depth

compression

color

compression

blending

Coverage determination

use sign of edge distance equations

Attribute interpolation

depth, color, texture coordinates, etc.

Rasterizing equationsFeasibility

- Current hardware trend
- Computational power increasing rapidly
- Bandwidth lags behind
- Log shadow maps
- Increase computation
- Reduce memory/bandwidth consumption

Nonlinear rasterization

- Configurable rasterizer
- Other rasterization functions are possible
- Might be useful for other effects
- Reflections, refractions, caustics, general multi-view perspective [Hou et al. 06]

Outline

- Previous work
- Aliasing error
- Logarithmic parameterization
- Hardware implementation
- Results

10

k=1

6

10

Shadow map texels / image texels

k=2

4

10

k=4

2

10

k=8

0

10

1

2

3

4

10

10

10

10

f / n

Comparison to z-partitioningPerspective with kz-partitions

Logarithmic

Advantages

- Logarithmic shadow maps require less bandwidth and storage
- Smoother parameterization than z-partitioning

Disadvantages

- Does not handle projection aliasing
- Requires multiple shadow maps
- Up to 5 directional light
- Up to 4 per frustum face for point light
- Warped depth values

Conclusion

- Logarithmic parameterization
- Lower error than previous methods
- Hardware architecture for log rasterization
- Requires only small enhancements to current graphics hardware
- Exploits current hardware trends

Future work

- More details for hardware implementation
- precision requirements
- filtering
- shadow map bias
- Other applications for nonlinear rasterization

Acknowledgements

- Aaron Lefohn for the town model
- Supported in part by:
- NSF Graduate Fellowship
- ARO Contracts DAAD19-02-1-0390 and W911NF-04-1-0088
- NSF awards 0400134 and 0118743
- ONR Contract N00014-01-1-0496
- DARPA/RDECOM ContractN61339-04-C-0043
- Intel

Directional light - general case

light

- Highest error (wl/wi) occurs at the faces
- Partition frustum to handle each face separately

t

shadow map

wl

z

Download Presentation

Connecting to Server..