Shading and Shadows

cathamAI and Robotics

Oct 23, 2013 (3 years and 1 month ago)

72 views

SIGGRAPH ASIA 2011 Preview seminar

Shading and Shadows

Shading and Shadows

1.
Image
-
space Bidirectional Scene
Reprojection

2.
A Shading Reuse Method for Efficient
Micropolygon

Ray
Tracing

3.
Genetic Programming for
Shader

Simplification

4.
An Efficient Alias
-
free Shadow Algorithm for
Opaque and Transparent Objects using per
-
triangle Shadow Volumes

Image
-
space Bidirectional Scene
Reprojection


Real
-
time
temporal
upsampling

through

image
-
based
reprojection

of adjacent frames

L.
Yang,
Y
-
C.
Tse
,
P.
Sander,
J.
Lawrence,
D.
Nehab
,
H.
Hoppe,
C.
Wilkins

Rendered frame
t

Rendered frame
t+1

Interpolated frame
t+α

Flow field

Flow field





Image
-
space Bidirectional Scene
Reprojection

Scene
-
assisted interpolation

Image
-
based interpolation

Rendered

t

Rendered

t+1

Rasterized

t+α

Rendered

t

Rendered

t+1

Interpolated
t+α

Reverse
reprojection

at each pixel

Displacement

Scene flow estimation at each pixel

Interpolated
t+α

No geometry

infomation

t+α

Image
-
space Bidirectional Scene
Reprojection


Scene flow estimation






Partial computation of I
-
frames

Event!

Time
lag...

Image
-
space Bidirectional Scene
Reprojection


Additional search initialization


Increasing accuracy


Dual initialization, Latest
-
frame initialization


User study : simple game


To analyze effect on user and experience of the
tradeoff between the higher
framerates

and
increased latency

Question

-

Enjoyed the game?

-

Game was responsive?

-

Animation was smooth?

Simple game

Genetic Programming for
Shader

Simplification


GP for optimizing
shader

code


Mutation operation


Error metrics


Performance measure


Advantage


Possibly better than manual
optimization


P.
Sitthi
-
amorn
,
N.
Modly
,
W.
Weimer,
J.
Lawrence

Original
shader

Simplified
shader

Genetic Programming for
Shader

Simplification

1.
Population initialization


Mutating original
shader

2.
Fitness evaluation


Timing and quality

3.
Ranking and Diversity


Retain low
-
ranked variants

4.
Mating selection


Tournament selection

5.
Crossover and Mutation

6.
Selection for next iteration


same as Ranking and Diversity

+

a

sin

b

c

*

+

a

sin

b

c

*

mutation

1
st

2
nd

3
rd

5
th

4
th

6
th

crossover

Selection


(random)

2
nd

4
th

AST

AST

Replace

by average

Crossover

Swap

Remove

Add

Genetic Programming for
Shader

Simplification


Error model


L2
-
RGB error / structural similarity index over frames


Sampling small patches on G
-
buffer
(modify pix
-
shader
)


Cross
-
correlation 0.84 (actual error
-

predicted error)


Performance model


Sampling small patches on render target


minutes

1
-
2
secs

cross
-
correlation 0.95 (error)

An Efficient Alias
-
free Shadow Algorithm for Opaque and
Transparent Objects Using Per
-
triangle Shadow Volumes


A shadow volume algorithm


Cast shadow


Point
(& directional?)

light


Advantage


Screen
-
space anti
-
aliasing


Transparent shadow
-
caster
& receiver


Small memory footprint


No load
-
balancing issue


Deferred shading pipeline

E.
Sintorn,
O.
Olsson,
U.
Assarsson

An Efficient Alias
-
free Shadow Algorithm for Opaque and
Transparent Objects Using Per
-
triangle Shadow Volumes

Common shadow volume


Caster : silhouette edge


Preprocessing



Depth + stencil buffer


Hardware support


Opaque model



Proposed algorithm


Caster: each triangle


No adjacency info.


No preprocessing


Depth +
shadow

buffer


CUDA implementation


Compatible with screen
-
space anti
-
aliasing,
textured
-
shadow caster,
stochastic transparency

Light

Model

Caster

Caster =

all faces

Shadow mapping


Resolution of shadow map


Aliasing

point light

camera

1. Clip space

2. Depth buffer

min&max

depth

caster


(triangle)

receiver

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

3. Shadow Buffer

4. Rendered image

Shadow
rasterization



test against each plane



of shadow frustum


AABB

shadow

frustum

An Efficient Alias
-
free Shadow Algorithm
for Opaque and Transparent Objects
Using Per
-
triangle Shadow Volumes

1

1

1

1

An Efficient Alias
-
free Shadow Algorithm for Opaque and
Transparent Objects Using Per
-
triangle Shadow Volumes


Hierarchical depth buffer and shadow buffer







Colored, transparent shadow
-
caster


Floating point value shadow buffer


Stochastically setting shadow bit


Screen
-
space anti
-
aliasing
(MSAA, CSAA, SSAA)


# of shadow bits & depth derivative

0

1

1

0

1

1

1

0

1

1

1

0

0

1

1

0

0

1

1

0

0

1

1

0

0

0

1

1

0

0

0

0

0

0

0

0

Shading and Shadows

1.
Image
-
space Bidirectional Scene
Reprojection

2.
A Shading Reuse Method for Efficient
Micropolygon

Ray Tracing

3.
Genetic Programming for
Shader

Simplification

4.
An Efficient Alias
-
free Shadow Algorithm for
Opaque and Transparent Objects using per
-
triangle Shadow Volumes