motivation (2) halflife 2 microsoft flighsimulator real-time … · 2019-04-03 · pipeline slides...

17
1 Real-Time Rendering Project Gotham Racing 2 (Xbox) Microsoft Flighsimulator Halflife 2 Real-time Rendering 2 Motivation (1) Many graphics applications are dynamic Simulators (surgery, flight simulators,…) 3D computer games 3D walk through’s • Minimal frame rates 10 Hz: perceived as animation 60 Hz: flicker free Real-time Rendering 3 Motivation (2) Geometry (vertex count) Elevation model of Switzerland (Endoxon AG) Brooks House (UNC Walkthru Group) Double Eagle Tanker (UNC Walkthru Group) 200 Million 0.14 Million 83 Million Display resolution (pixel count) e.g. 2000 x 1000 = 2 Million Real-time Rendering 4 Motivation (3) • Today’s best peak performance 600 M vertices/s 10 M vertices/frame! 6 G fragments/s 100 M fragments/frame! • Reality Latest hardware not available on all systems Slowdown by complex shader programs Multi pass rendering Non perfect load balancing Speedup shading & reduce geometry

Upload: others

Post on 25-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

1

Rea

l-Tim

eR

end

ering

Pro

ject Go

tha

mR

acin

g 2 (X

bo

x)

Micro

soft Flig

hsim

ula

tor

Ha

lflife2

Re

al-tim

e R

end

ering 2

Mo

tivatio

n (1)

•M

an

y gra

ph

ics ap

plica

tion

s are

dyn

am

ic

–Sim

ula

tors (su

rgery, flig

ht sim

ula

tors,…

)

–3D

com

pu

ter ga

me

s

–3D

wa

lk thro

ug

h’s

•M

inim

al fra

me

rate

s

–10

Hz: p

erceived

as a

nim

atio

n

–6

0 H

z: flicker fre

e

Rea

l-time R

end

ering 3

Mo

tivatio

n (2)

•G

eo

me

try (verte

x co

un

t)

Elevatio

n m

od

el of Sw

itzerlan

d(En

do

xon

AG

)B

roo

ks Ho

use

(UN

C W

alkth

ruG

rou

p)

Do

ub

le Ea

gle T

an

ker

(UN

C W

alkth

ruG

rou

p)

200

Millio

n0

.14 M

illion

83 M

illion

•D

ispla

y reso

lutio

n (p

ixel co

un

t)

–e

.g. 20

00

x 10

00

= 2 M

illion

Re

al-tim

e R

end

ering 4

Mo

tivatio

n (3)

•T

od

ay’s b

est

pe

ak

perfo

rma

nce

–6

00

M vertices/s →

10 M

vertices/fra

me

!

–6

G fra

gm

ents/s →

100

M fra

gm

en

ts/fram

e!

•R

eality

–La

test ha

rdw

are n

ot a

vaila

ble o

n a

ll system

s

–Slo

wd

ow

n b

y com

plex

sha

der

pro

gra

ms

–M

ulti p

ass ren

de

ring

–N

on

pe

rfect lo

ad

ba

lan

cing

→S

pe

ed

up

sha

din

g &

redu

ce g

eo

me

try

Page 2: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

2

Rea

l-time R

end

ering 5

Overview

•Sh

ad

ing

Acce

lera

tion

–O

ptim

izatio

n o

f Gra

ph

ics Pip

eline

•G

eo

me

try Re

du

ction

–S

pa

tial D

ata

Stru

cture

s

–C

ullin

g T

ech

niq

ues

–Levels o

f De

tail

Re

al-tim

e R

end

ering 6

Fram

eB

uffer

Frag

men

t P

rocesso

r

Tex

ture

Sto

rag

e+

Filtering

Ra

sterizerG

eom

etry P

rocesso

rG

eom

etry S

tora

ge

CP

U

Ve

rtices

Pix

els

Simp

lified G

rap

hics P

ipelin

e

Pip

eline slid

es co

urtesy Jo

hn

Sp

itzer -N

VID

IA

Rea

l-time R

end

ering 7

Fram

eB

uffer

Frag

me

nt

Pro

cesso

r

Tex

ture

Sto

rag

e+

Filterin

g

Ra

sterizerG

eo

me

try

Pro

cesso

rG

eo

me

try

Sto

rag

eC

PU

CP

Utra

nsfe

rtra

nsfo

rmra

ster

textu

refra

gm

ent

fram

eb

uffer

Ve

rtex

Bo

un

dP

ixe

l Bo

un

d

Po

ssible P

ipelin

e Bo

ttlenecks

CP

U/B

us

Bo

un

d

Re

al-tim

e R

end

ering 8

Ba

ttle Pla

n fo

r Better

Perfo

rma

nce

•Lo

cate

the

bo

ttlen

eck(s)

•E

limin

ate

the

bo

ttlen

eck

(if po

ssible)

–D

ecrea

se wo

rkloa

d o

fth

e b

ottle

ne

cked

stag

e

•O

the

rwise

, ba

lan

ce th

e

pip

elin

e–

Incre

ase w

orklo

ad

of th

e n

on

-bo

ttlenecked

stag

es

Page 3: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

3

Rea

l-time R

end

ering 9

Bo

ttleneck Id

entifica

tion

Ru

n A

pp

Va

ryFra

me

Bu

ffer

FPS

varies?

Fram

eB

uffe

rlim

ited

Va

ry te

xtu

resize/filterin

gFP

Sva

ries?

Va

ry reso

lutio

nFP

Sva

ries?

Tex

ture

limite

d

Va

ry

frag

me

nt

instru

ction

s

FPS

varie

s?

Va

ry v

erte

xin

structio

ns

FPS

varies?

Tra

nsfo

rmlim

ited

Va

ry v

erte

x size

/A

GP

rate

FPS

varies?

Tra

nsfe

rlim

ited

Frag

men

tlim

ited

Ra

sterlim

ited

CP

Ulim

ited

Ye

s

No

No

No

No

No

No

Ye

s

Ye

s

Ye

s

Ye

s

Ye

s

Re

al-tim

e R

end

ering 10

Fram

eB

uffer

Frag

men

t P

rocesso

r

Tex

ture

Sto

rag

e +

Filtering

Ra

sterizerG

eom

etry P

rocesso

rG

eom

etry S

tora

ge

CP

U

CP

Utra

nsfer

tran

sform

raste

rtex

ture

frag

men

tfra

me

bu

ffer

Ve

rtex

Bo

un

dP

ixe

l Bo

un

d

CP

U B

ottlen

ecks

CP

U/B

us

Bo

un

d

Rea

l-time R

end

ering 11

CP

U B

ottlen

ecks

•A

pp

licatio

n lim

ited

–sim

ula

tion

, disc I/O

slow

er th

at ren

de

ring

→tu

ne a

pp

licatio

n (p

rofilin

g to

ols)

•D

river o

r AP

I limite

d

–to

o m

an

y state ch

an

ges

–to

o m

an

y AP

I calls

→u

se a

rrays, d

ispla

y lists

Re

al-tim

e R

end

ering 12

Fram

eB

uffer

Frag

men

t P

rocesso

r

Tex

ture

Sto

rag

e+

Filtering

Ra

sterizerG

eom

etry P

rocesso

rG

eom

etry S

tora

ge

CP

U

CP

Utra

nsfer

tran

sform

raste

rtex

ture

frag

men

tfra

me

bu

ffer

Ve

rtex

Bo

un

dP

ixe

l Bo

un

d

Geo

metry T

ran

sfer B

ottlen

ecks

CP

U/B

us

Bo

un

d

Page 4: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

4

Rea

l-time R

end

ering 13

•V

erte

x d

ata

pro

ble

ms

–size issu

es (ju

st un

der o

r ove

r 32 bytes)

–n

on

-na

tive types (e.g

. do

ub

le, pa

cked b

yte no

rma

ls)

•U

sing

the

wro

ng

AP

I calls

–im

me

dia

te mo

de, n

on

-accelera

ted ve

rtex

arra

ys

→u

se vertex a

rrays +

ind

exed

prim

itives(sh

ared

vertices tra

nsfe

rred o

nly o

nce)

→a

ccess vertice

s in se

qu

entia

l (cach

e friend

ly) pa

ttern

•A

GP

misco

nfig

ured

(rare)

Geo

metry T

ran

sfer B

ottlen

ecks

Re

al-tim

e R

end

ering 14

Fram

eB

uffer

Frag

men

t P

rocesso

r

Tex

ture

Sto

rag

e+

Filtering

Ra

sterizerG

eom

etry P

rocesso

rG

eom

etry S

tora

ge

CP

U

CP

Utra

nsfer

tran

sform

raste

rtex

ture

frag

men

tfra

me

bu

ffer

Ve

rtex

Bo

un

dP

ixe

l Bo

un

d

Geo

metry T

ran

sform

B

ottlen

ecks

CP

U/B

us

Bo

un

d

Rea

l-time R

end

ering 15

Geo

metry T

ran

sform

B

ottlen

ecks •

To

o m

an

y vertices

–U

se levels of d

etail (b

ut b

ewa

re of C

PU

overh

ead

)

–U

se bu

mp

ma

ps to

fake g

eo

me

tric deta

il

•T

oo

mu

ch co

mp

uta

tion

per vertex

–M

ove

pe

r-ob

ject calcu

latio

ns to

CP

U,

save

resu

lts as co

nsta

nts

–M

ake u

se of fu

ll spectru

m o

f instru

ction

set (LIT

, DS

T, S

IN,...)

–M

ake

use

of sw

izzle a

nd

ma

sk op

era

tors

to m

inim

ize MO

Vs

Re

al-tim

e R

end

ering 16

Fram

eb

uffer

Frag

men

t P

rocesso

r

Tex

ture

Sto

rag

e+

Filtering

Ra

sterizerG

eom

etry P

rocesso

rG

eom

etry S

tora

ge

CP

U

CP

Utra

nsfer

tran

sform

raste

rtex

ture

frag

men

tfra

me

bu

ffer

Ve

rtex

Bo

un

dP

ixe

l Bo

un

d

Ra

sterizatio

nB

ottlen

ecks

CP

U/B

us

Bo

un

d

Page 5: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

5

Rea

l-time R

end

ering 17

Ra

sterizatio

nB

ottlen

ecks

•R

are

ly the

bo

ttlen

eck

•Sp

eed

influ

enced

by n

um

be

r of vertex

a

ttribu

tes to

be

inte

rpo

late

d

•B

e su

re to

ma

xim

ize d

ep

th cu

lling

efficiency

–C

lea

r dep

th a

t the b

egin

nin

g o

f each

fram

e

–C

oa

rsely so

rt ob

jects fron

t to b

ack

–C

on

strain

nea

r an

d fa

r pla

ne

s to g

eom

etry visib

le in

fram

e

Re

al-tim

e R

end

ering 18

Fram

eB

uffer

Frag

men

t P

rocesso

r

Tex

ture

Sto

rag

e+

Filtering

Ra

sterizerG

eom

etry P

rocesso

rG

eom

etry S

tora

ge

CP

U

CP

Utra

nsfer

tran

sform

raste

rtex

ture

frag

men

tfra

me

bu

ffer

Ve

rtex

Bo

un

dP

ixe

l Bo

un

d

Tex

ture B

ottlen

ecks

CP

U/B

us

Bo

un

d

Rea

l-time R

end

ering 19

Tex

ture B

ottlen

ecks

•R

un

nin

g o

ut o

f tex

ture

me

mo

ry

–T

ex

ture reso

lutio

ns o

nly a

s big

as n

ee

de

d

–A

void

exp

ensive in

tern

al fo

rma

ts (floa

ting

po

int)

–C

om

pre

ss textu

res (16

-bit co

lor d

ep

th fo

r e

nviro

nm

en

t ma

ps a

nd

sha

do

w m

ap

s)

•P

oo

r tex

ture

cach

e u

tilizatio

n

–Lo

calize

textu

re a

ccesse

s

•U

se e

xp

en

sive filtering

(trilinea

r, an

isotro

pic)

on

ly wh

en n

ee

ded

Re

al-tim

e R

end

ering

20

Fram

eB

uffer

Frag

men

t P

rocesso

r

Tex

ture

Sto

rag

e+

Filtering

Ra

sterizerG

eom

etry P

rocesso

rG

eom

etry S

tora

ge

CP

U

CP

Utra

nsfer

tran

sform

raste

rtex

ture

frag

men

tfra

me

bu

ffer

Ve

rtex

Bo

un

dP

ixe

l Bo

un

d

Frag

men

t Bo

ttlenecks

CP

U/B

us

Bo

un

d

Page 6: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

6

Rea

l-time R

end

ering 21

Frag

men

t Bo

ttlenecks

•T

oo

ma

ny fra

gm

ents

–C

on

sider u

sing

a d

epth

-on

ly first pa

ss

–sh

ad

e on

ly the

visible

frag

men

ts in su

bse

qu

ent

pa

ss(es)

•T

oo

mu

ch co

mp

uta

tion

per fra

gm

ent

–U

se a m

ix o

f tex

ture

an

d m

ath

instru

ction

s (th

ey often

run

in p

ara

llel)

–M

ove co

nsta

nt p

er-tria

ng

le calcu

latio

ns to

vertex

p

rog

ram

, send

da

ta a

s textu

re coo

rdin

ates

–D

o sim

ilar w

ith va

lue

s tha

t can

be lin

ea

r in

terpo

lated

Re

al-tim

e R

end

ering 22

Fram

eB

uffer

Frag

men

t P

rocesso

r

Tex

ture

Sto

rag

e+

Filtering

Ra

sterizerG

eom

etry P

rocesso

rG

eom

etry S

tora

ge

CP

U

CP

Utra

nsfer

tran

sform

raste

rtex

ture

frag

men

tfra

me

bu

ffer

Ve

rtex

Bo

un

dP

ixe

l Bo

un

d

Fram

ebu

fferB

ottlen

ecks

CP

U/B

us

Bo

un

d

Rea

l-time R

end

ering 23

Min

imizin

g

Fram

ebu

fferTra

ffic

•R

ed

uce

nu

mb

er of p

asse

s with

lon

ge

r sha

de

rs

•Flo

atin

g p

oin

t fram

e b

uffers o

nly w

hen

nee

ded

•U

se 16

-bit Z

-de

pth

if you

can

ge

t aw

ay w

ith it

Re

al-tim

e R

end

ering 24

Overview

•Sh

ad

ing

Accele

ratio

n

–O

ptim

izatio

n o

f Gra

ph

ics Pip

eline

•G

eom

etry R

edu

ction

–Sp

atia

l Da

ta S

tructu

res

–C

ullin

g T

ech

niq

ues

–Levels o

f De

tail

Page 7: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

7

Rea

l-time R

end

ering 25

Spa

tial D

ata

Structu

res

•K

ey to

ge

om

etry re

du

ction

:

–B

ou

nd

ing

Vo

lum

e H

ierarch

ies

–Sp

ace

Pa

rtition

ing

Tre

es

–Scen

e Gra

ph

s

Re

al-tim

e R

end

ering 26

Bo

un

din

g V

olu

mes

•B

ou

nd

ing

Vo

lum

e (B

V)

–V

olu

me

tha

t en

close

s a se

t of o

bje

cts

–Sh

ou

ld b

e mu

ch sim

ple

r ge

om

etrica

l sha

pe

tha

n

con

tain

ed

ob

jects

Sph

ereA

BB

OB

B6

-DO

PC

on

vex h

ull

qu

ality

simp

licity

Rea

l-time R

end

ering 27

Bo

un

din

g V

olu

me

Hiera

rchies

•T

ree

structu

re

•Lea

f no

des co

nta

in g

eom

etry + b

ou

nd

ing

volu

me

•In

terna

l no

des co

nta

in b

ou

nd

ing

volu

me o

f sub

tree

roo

t

Intern

al

no

de

Re

al-tim

e R

end

ering 28

Spa

ce Pa

rtition

ing

Trees

Un

iform

sub

divisio

nQ

ua

dtree

k-dtree

BSP

tree

Page 8: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

8

Rea

l-time R

end

ering 29

Bin

ary Sp

ace P

artitio

nin

g

(BSP

) Trees•

Cre

atio

n

–U

se pla

ne

to d

ivide th

e sp

ace

in tw

o su

bsp

ace

s

–So

rt geo

metry in

to th

ese two

sub

spa

ces

–D

ivide su

bsp

ace

s recursive

ly

•T

ype

s

–P

lan

e ax

is or p

olyg

on

alig

ned

•U

sed

in m

an

y ga

me

en

gin

es:

–Q

ua

ke I/II/III, Do

om

I/II, Un

real, S

in, H

alf-Life etc.

Re

al-tim

e R

end

ering

30

Ax

is-Alig

ned

BSP

Trees

0

1a1b

AC E

DBp

lan

e 1a

pla

ne

1b

plane 2

plane 0

AB

C2

DE

•k-d

trees: cycle

thro

ug

h a

xe

s

•A

pp

licatio

ns:

–R

ou

gh

fron

t-to-b

ack so

rting

–O

cclusio

n cu

lling

Rea

l-time R

end

ering 31

Po

lygo

n-A

lign

ed B

SP Trees

•A

po

lygo

n is ch

osen

as th

e divid

er

A

BC

GF

ED

A

D

E

B

V

splitting plane

C

G

F

•C

rea

tion

time co

nsu

min

g•

Ap

plica

tion

s:–

Specia

l type in

pa

inter’s a

lgo

rithm

(no

Z-b

uffer n

eed

ed)

–In

tersection

testing

–C

ollisio

n d

etectio

nR

ea

l-time

Ren

derin

g 32

Octrees

•B

ox

is split sim

ulta

neo

usly a

lon

g a

ll thre

e a

xe

s

–Sp

lit po

int m

ust b

e cen

ter o

f bo

x

–C

rea

tes e

igh

t new

bo

xe

s, hen

ce th

e n

am

e

•In

2D: Q

ua

dtre

es

•R

egu

lar stru

cture

, thu

s efficien

t

•A

pp

licatio

ns:

–V

iew fru

stum

cullin

g

–O

cclusio

n cu

lling

–E

fficient ra

y inte

rsection

s

Page 9: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

9

Rea

l-time R

end

ering 33

Scene G

rap

hs

•H

igh

er level d

ata

structu

re

–G

eom

etry, au

gm

ented

with

textu

res, tran

sform

s, le

vels-o

f-deta

il, ligh

t sou

rces

•T

ree

Rep

rese

nta

tion

–D

ep

th-first tra

versa

l for ren

de

ring

–R

oo

t no

de o

ften h

as a

BV

–Le

af sto

res g

eo

me

try

–Severa

l no

des m

ay p

oin

t to sa

me ch

ild n

od

e, thu

s th

e tre

e stru

cture

is a D

irecte

d A

cyclic Gra

ph

(DA

G)

Re

al-tim

e R

end

ering 34

Overview

•Sh

ad

ing

Accele

ratio

n

–O

ptim

izatio

n o

f Gra

ph

ics Pip

eline

•G

eom

etry R

edu

ction

–Sp

atia

l Da

ta S

tructu

res

–C

ullin

g T

ech

niq

ues

–Levels o

f De

tail

Rea

l-time R

end

ering 35

Cu

lling

Tech

niq

ues

•D

on

’t ren

de

r wh

at ca

n’t b

e se

en

–O

ff-scree

n: view-frustum

culling–

Occlu

de

d b

y oth

er o

bje

cts: occlusion culling

•W

hy in

softw

are

?

–O

ff-scree

n g

eo

me

try: solved by clipping–

Occlu

de

d g

eo

me

try: solved by Z-bufferR

ea

l-time

Ren

derin

g 36

Cu

lling

Tech

niq

ues

•Sa

ve ren

derin

g tim

e

–C

lipp

ing

an

d Z

-bu

ffering

take tim

e line

ar to

the

nu

mb

er o

f prim

itives

•C

ullin

g in

softw

are

:

–P

re-cullin

g o

f larg

e nu

mb

er o

f prim

itives

–A

pp

rox

ima

tive

–C

on

servative! K

eep

hid

den

prim

itive OK

, re

mo

ve visible p

rimitive n

ot O

K

–R

ema

ind

er is potentially visible set

or P

VS

•D

o clip

pin

g a

nd

Z-b

ufferin

g o

nly w

ith P

VS

Page 10: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

10

Rea

l-time R

end

ering 37

Visib

ility From

a P

oin

t

viewp

oin

t

occlu

de

r

occlu

de

e

sha

do

w vo

lum

e =u

mb

ra

•T

erm

ino

log

y

Re

al-tim

e R

end

ering 38

Occlu

der

Fusio

n

•O

cclud

er

Fusio

nco

mb

ine

s effe

cts of m

ultip

le o

cclud

ers

–V

isible w

itho

ut o

cclud

er

fusio

n

–In

visible w

ith o

cclud

er

fusio

n

viewp

oin

t

2 occlu

de

rs

larg

er sh

ad

ow

vo

lum

e

Rea

l-time R

end

ering 39

Visib

ility From

a R

egio

n

viewin

g

reg

ion

1 occlu

de

r

sha

do

w vo

lum

e

2 occlu

de

rs

XX

X

Re

al-tim

e R

end

ering

40

sha

do

w vo

lum

e

viewin

g

reg

ion

2 occlu

de

rs

sha

do

w vo

lum

e

Visib

ility From

a R

egio

n (2)

XX

X

Page 11: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

11

Rea

l-time R

end

ering 41

viewin

g

reg

ion

2 occlu

de

rs

Visib

ility From

a R

egio

n (3)

XX

Xsh

ad

ow

v

olu

me

•A

rea

XX

X is a

lwa

ys occlu

ded

-> com

plete sh

ad

ow

volu

me

is mo

re tha

n

the

un

ion

of in

divid

ua

l sha

do

w vo

lum

es

Re

al-tim

e R

end

ering 42

•S

ep

ara

ting

pla

ne

so

f two

con

vex

po

lyhed

raa

re pla

ne

s fo

rme

d b

y an

ed

ge

of o

ne

po

lyhed

ron

an

d a

verte

x o

f th

e o

the

r such

tha

t the

po

lyhe

dra

lie on

op

po

site sides

of th

e p

lan

e•

Bo

un

din

g p

lan

es

are

simila

r, ex

cept th

at b

oth

p

olyh

ed

ralie o

n th

e sam

e side o

f the p

lan

e

Bo

un

din

g P

lan

es an

d

Sepa

ratin

g P

lan

es

viewin

g

reg

ion

occlu

de

r

bo

un

din

g p

lan

es

sep

ara

ting

pla

ne

s

Rea

l-time R

end

ering 43

•T

he a

rea (vo

lum

e) in fu

ll sha

do

w is th

e um

bra

–S

imp

le in/o

ut cla

ssificatio

n

•T

he a

rea n

ot in

full sh

ad

ow

(gre

y) is the p

en

um

bra

–A

dd

ition

ally en

cod

es wh

ich p

art o

f the

view

ing

reg

ion

is visible

Um

bra

an

d P

enu

mb

ra

viewin

g

reg

ion

occlu

de

r um

bra

pe

nu

mb

ra

pe

nu

mb

ra

Re

al-tim

e R

end

ering 44

Occlu

sion

Cu

lling

From

a R

egio

n

•W

e w

an

t to ca

lcula

te th

e co

mp

lete um

bra

=

all re

gio

ns th

at a

re fu

lly occlu

de

d•

Um

bra

=

um

bra

for e

ach

ind

ividu

al o

cclud

er

+

all reg

ion

s wh

ere p

enu

mb

ra m

erg

es to

um

bra

viewin

g

reg

ion

occlu

de

r um

bra

pe

nu

mb

ra

pe

nu

mb

ra

Page 12: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

12

Rea

l-time R

end

ering 45

Exa

mp

le Cu

lling

Meth

od

s

•B

ackfa

cecu

lling

•V

iew fru

stum

cullin

g

•P

orta

l cullin

g

•O

cclusio

n cu

lling

Re

al-tim

e R

end

ering

46

Ba

ckface

Cu

lling

•O

n th

e su

rface

of a

close

d m

an

ifold

, p

olyg

on

s wh

ose n

orm

als

po

int a

wa

y fro

m th

e cam

era

are a

lwa

ys occlu

de

d

Vie

we

r

No

te: b

ackfa

cecu

lling

alo

ne

do

esn

’t solve

the

hid

de

n-su

rface

pro

ble

m!

Rea

l-time R

end

ering 47

Clu

stered B

ackfa

ceC

ullin

g

•G

rou

p o

bje

cts with

simila

r n

orm

al

•C

lassifica

tion

of o

bje

cts:–

All fa

ces fron

t-facin

g->

rend

er all

–A

ll faces b

ack-fa

cing

-> ren

der n

on

e

–So

me

fron

t-facin

g,

som

e b

ack-fa

cing

-> ren

der a

ll

•D

on

e w

ith n

orm

al co

ne

s

α

Co

llected

no

rma

lsfro

m

a set o

f po

lygo

ns

Min

ima

l no

rma

l con

e d

efined

by o

ne n

orm

al

na

nd

a h

alf-a

ng

le α

n

Re

al-tim

e R

end

ering 48

Hiera

rchica

lV

iew Fru

stum

Cu

lling

intersect

intersect

insid

e

insid

e

ou

tside

insid

ein

side

insid

ein

side

Bo

un

din

g V

olu

me

Hie

rarch

y

Page 13: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

13

Rea

l-time R

end

ering

49

Po

rtal C

ullin

g

•G

oa

l: wa

lk thro

ug

h a

rchitectu

ral m

od

els (b

uild

ing

s, cities, ca

taco

mb

s)

•T

he

se d

ivide

na

tura

lly into

cells

–R

oo

ms, a

lcove

s, corrid

ors…

•T

ran

spa

ren

t po

rtals

con

nect cells

–D

oo

rwa

ys, entra

nce

s, win

do

ws…

Re

al-tim

e R

end

ering

50

Po

rtal C

ullin

g (2)

•E

xa

mp

le

viewer

Rea

l-time R

end

ering 51

Po

rtal C

ullin

g (3)

•Id

ea

: –

Ce

lls form

the

ba

sic un

it of P

VS

–C

reate a

n a

dja

cency g

rap

ho

f cells

–S

tartin

g w

ith ce

ll con

tain

ing

eyepo

int,

traverse

gra

ph

, ren

derin

g visib

le ce

lls

–A

cell is on

ly visible if it ca

n b

e seen

thro

ug

h

a se

qu

en

ce of p

orta

ls•

So ce

ll visibility red

uces to

testing

po

rtal

seq

ue

nces fo

r a line of sight…

Re

al-tim

e R

end

ering 52

Occlu

sion

Cu

lling

•T

hre

e m

ain

alg

orith

ms:

–Lo

ose

fron

t-to-b

ack so

rting

•U

sing

an

octre

eo

r BS

P tre

e

•S

ortin

g ce

ntro

ids

or n

ea

r po

ints

of b

ou

nd

ing

volu

mes

–H

iera

rchica

l Z-b

uffer

•N

ed

Gre

ene

, SIG

GR

AP

H 9

3

–H

iera

rchica

l occlu

sion

ma

ps

•H

an

son

gZ

ha

ng

, SIG

GR

AP

H 9

7, no

t discu

ssed

Page 14: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

14

Rea

l-time R

end

ering 53

Hiera

rchica

l Z-b

ufferin

g

•R

ep

lace

Z-b

uffe

r with

a Z-pyram

id–

Low

est leve

l: full-re

solu

tion

Z-b

uffer

–H

igh

er levels: e

ach

pix

el rep

rese

nts th

e

ma

xim

um

dep

tho

f the

fou

r pix

els “u

nd

ernea

th”

it

•B

asic id

ea: h

iera

rchica

l rasteriza

tion

of

the p

olyg

on

, with

early term

ina

tion

w

he

re p

olyg

on

is occlu

de

d

Re

al-tim

e R

end

ering 54

Hiera

rchica

l Z-b

ufferin

g (2)

•Id

ea: te

st po

lygo

n a

ga

inst h

igh

est leve

l first–

If po

lygo

n is fu

rther th

an

dista

nce

record

ed

in

pix

el, sto

p –

it’s occlu

ded

–If p

olyg

on

is close

r, recu

rsively ch

eck a

ga

inst

nex

t low

er level

–If p

olyg

on

is visible a

t low

est leve

l, set n

ew

d

istan

ce valu

e a

nd

pro

pa

ga

te up

•U

nfo

rtun

ate

ly: no

ha

rdw

are

sup

po

rt

Rea

l-time R

end

ering 55

Overview

•Sh

ad

ing

Acce

lera

tion

–O

ptim

izatio

n o

f Gra

ph

ics Pip

eline

•G

eo

me

try Re

du

ction

–S

pa

tial D

ata

Stru

cture

s

–C

ullin

g T

ech

niq

ues

–Levels o

f De

tail

Re

al-tim

e R

end

ering 56

Level of D

etail

•W

ha

t for?

–E

ven

afte

r visibility, m

od

el ma

y con

tain

too

m

an

y po

lygo

ns

•Id

ea

: redu

ce com

ple

xity fu

rther b

y m

an

ag

ing

level o

f de

tail (LO

D)

–M

ulti-re

solu

tion

mo

de

ling

–P

olyg

on

al sim

plifica

tion

Page 15: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

15

Rea

l-time R

end

ering 57

Level of D

etail

Tra

ditio

na

l LOD

•C

rea

te levels of detail(LODs) o

f ob

jects

Co

urte

sy Sta

nfo

rd 3D

Sca

nn

ing

Rep

osito

ry

69

,451 p

olys

2,502 p

olys

251 po

lys76

po

lys

Re

al-tim

e R

end

ering 58

Level of D

etail

Tra

ditio

na

l LOD

•D

istan

t ob

jects use co

arser LO

Ds

•C

ha

ng

es nu

mb

er of ve

rtices

•N

ot n

um

be

r of fra

gm

ents

Rea

l-time R

end

ering 59

Level of D

etail

Issues

•LO

D g

en

era

tion

–Lo

ts of m

eth

od

s

•LO

D se

lectio

n–

Static (ra

ng

e/pro

jected a

rea

-ba

sed)

–R

ea

ctive (re

act to

last fra

me

s ren

de

ring

time)

–P

redictive (co

st/ben

efit mo

del)

•LO

D sw

itchin

g–

Ha

rd sw

itchin

g (p

op

pin

g a

rtifacts!)

–B

lend

ing

(ill-defin

ed b

ecau

se of Z

-bu

ffer!)

–G

eom

orp

h(fo

r con

tinu

ou

s level o

f deta

il)

Re

al-tim

e R

end

ering

60

Level of D

etail

LOD

Gen

eratio

n

•Lo

ts of m

eth

od

s

–D

ecima

tion

–V

ertex M

ergin

g (ed

ge-co

llap

sing

)

–A

da

ptive

sub

divisio

n

•In

tere

sting

: Diffe

ren

t erro

r me

trics!

Page 16: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

16

Rea

l-time R

end

ering 61

Level of D

etail

LOD

Selection

•R

an

ge

-ba

sed

–A

ssocia

te d

iffere

nt LO

Ds

with

diffe

ren

t ra

ng

es

r1

r2

r3

LOD

0LO

D1

LOD

2LO

D3

Re

al-tim

e R

end

ering 62

Level of D

etail

LOD

Selection

•P

roje

cted

are

a-b

ase

d

–P

roje

cted

are

a o

f the

bo

un

din

g vo

lum

e

–E

stima

tion

of scre

en

spa

ce co

vera

ge

–E

.g. sp

here

s:

–A

rea

of p

roje

ction

is thu

s

–H

igh

er valu

e selects a

mo

re deta

iled LO

D

)(

vc

d−

⋅=

nrp

2pπ

vdc

r

n

Rea

l-time R

end

ering 63

Level of D

etail

LOD

Switch

ing

•D

iscrete

Ge

om

etry LO

Ds

–C

reate LO

Ds

for ea

ch o

bje

ct sepa

rately

in a

pre

pro

cess

–A

t run

-time

, pick e

ach

ob

ject’s LO

D

acco

rdin

g to

the

ob

ject’s dista

nce

(or

simila

r criterio

n)

–S

ince LO

Ds

are

crea

ted

offlin

e a

t fixe

d

resolu

tion

s, we

call th

is discrete LOD–

De

cou

ple

s simp

lificatio

n a

nd

rend

erin

gR

ea

l-time

Ren

derin

g

64

Level of D

etail

LOD

Switch

ing

(2)

•C

on

tinu

ou

s LOD

s–

Crea

te d

ata

structu

re fro

m w

hich

a d

esired

level o

f de

tail ca

n b

e ex

tracted

at ru

n tim

e.

–B

etter g

ran

ula

rity b

etter fid

elity•

LOD

is spe

cified e

xa

ctly, no

t cho

sen

from

a fe

w

pre-cre

ate

d o

ptio

ns

•T

hu

s ob

jects u

se no

mo

re po

lygo

ns th

an

n

ecessa

ry, wh

ich fre

es up

po

lygo

ns fo

r oth

er o

bje

cts

•N

et result: b

etter resou

rce utiliza

tion

, le

ad

ing

to b

etter o

vera

ll fide

lity/po

lygo

n

Page 17: Motivation (2) Halflife 2 Microsoft Flighsimulator Real-Time … · 2019-04-03 · Pipeline slides courtesy John Spitzer - NVIDIA Real-time Rendering 7 Frame Buffer Fragment Processor

17

Rea

l-time R

end

ering 65

Level of D

etail

LOD

Switch

ing

(3)

•C

on

tinu

ou

s LOD

s

–B

etter gra

nu

larity ->

smo

oth

er tra

nsitio

ns

•Sw

itchin

g b

etween

trad

ition

al LO

Ds

can

in

trod

uce

visua

l “po

pp

ing

”effe

ct

•C

on

tinu

ou

s LOD

can

ad

just d

etail g

rad

ua

lly an

d

incre

men

tally, red

ucin

g visu

al p

op

s

•C

an

even g

eom

orp

hth

e fine-g

rain

ed

simp

lificatio

n o

pe

ratio

ns o

ver severa

l fram

es to

elim

ina

te p

op

s [Ho

pp

e 9

6, 9

8]

Re

al-tim

e R

end

ering

66

Level of D

etail

LOD

Switch

ing

(4)

•C

on

tinu

ou

s LOD

s(2)

–Su

pp

orts p

rog

ressive

tran

smissio

n•

Pro

gre

ssive Mesh

es [Ho

pp

e 97]

•P

rog

ressive Fo

rest Sp

lit Co

mp

ressio

n [T

au

bin

98

]

–Lea

ds to

vie

w-d

ep

en

de

nt LO

D

•U

se curre

nt vie

w p

ara

mete

rs to select b

est

rep

rese

nta

tion

for the current view•

Sing

le ob

jects ma

y thu

s spa

n se

veral leve

ls of

deta

il

Rea

l-time R

end

ering 67

Level of D

etail

Co

nclu

sion

s

•G

oo

d b

oo

k an

d w

eb

pa

ge

: lod

bo

ok.co

m

10k

20k

60

k20

0k

200

0k

Mich

ela

ng

elo

’s Da

vid

at d

ifferen

t leve

ls of d

eta

il [Pa

uly 0

2]

In p

oin

ts of th

e orig

ina

l mo

de

l, rend

ered

with

a p

oin

t spla

tter.

Re

al-tim

e R

end

ering

68

Accelera

tion

Alg

orith

ms

Co

nclu

sion

•M

ost visib

ility alg

orith

ms w

ork o

n th

e d

ata

b

efore

it ge

ts do

wn

the

gra

ph

ics pip

elin

e

–Id

ea

l op

timiza

tion

s

–P

rob

lema

tic if CP

U is b

ottlen

eck

•M

ost o

f the

wo

rk in LO

Ds

can

be

do

ne in

a p

re-p

roce

ssing

ph

ase