by cliff lindsay - wpiweb.cs.wpi.edu/~emmanuel/courses/cs563/s05/talks/...high dynamic range texture...

49
CS 563 Advanced Topics in Computer Graphics Texture Mapping Effects by Cliff Lindsay Top Ten List” Courtesy of David Letterman’s Late Show and CBS

Upload: others

Post on 17-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

CS

56

3 A

dvan

ced

Topi

cs in

C

ompu

ter

Gra

phic

sTe

xtur

e M

appi

ng E

ffec

ts

by C

liff

Lind

say

“Top

Ten

Lis

t” C

ourt

esy

of D

avid

Let

term

an’s

Lat

e Sh

ow a

nd C

BS

Page 2: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Talk

For

mat

List

of

T

extu

re M

appi

ng

Effe

cts

from

G

ood

to S

pect

acu

lar

(my

bias

ed o

pin

ion

):

Hig

hlig

hts:

Def

ine

Each

Eff

ect

Des

crib

e Ea

ch E

ffec

t Br

iefly

: Th

eory

and

Pra

ctic

e.

Talk

abo

ut h

ow e

ach

effe

ct e

xten

ds t

he id

ea o

f ge

nera

l Te

xtur

e M

appi

ng (

prev

ious

tal

k) in

clud

ing

Pros

and

Con

s.

Dem

os o

f se

lect

ed T

extu

re M

appi

ng E

ffec

ts

Page 3: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Map

pin

g Ef

fect

#1

0

Ligh

t M

appi

ng

Mai

n id

ea:

Stat

ic d

iffus

e lig

htin

g co

ntrib

utio

n fo

r a

surf

ace

can

be c

aptu

red

in a

tex

ture

and

ble

nded

w

ith a

noth

er t

extu

re r

epre

sent

ing

surf

ace

deta

il.

Hig

h lig

hts :

Elim

inat

e lig

htin

g ca

lcul

atio

n ov

erhe

adLi

ght

map

s ar

e lo

w r

esol

utio

nLi

ght

map

s ca

n be

app

lied

to m

ultip

le t

extu

res

*=

[Im

ages

cou

rtes

y of

flip

code

.com

]

Page 4: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Ligh

t M

appi

ng

Belo

w is

a n

ight

sce

ne o

f a

cast

le. N

o lig

htin

g ca

lcul

atio

n is

bei

ng p

erfo

rmed

at

all i

n th

e sc

ene.

Rig

ht:

Ligh

t M

ap a

pplie

dLe

ft:

No

Ligh

t M

ap a

pplie

d

[Im

ages

cou

rtes

y of

ww

w.g

amas

utra

.com

]

Page 5: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Map

pin

g Ef

fect

#9

Non

-Ph

otor

ealis

tic

Ren

deri

ng

Mai

n id

ea:

Rec

reat

ing

an e

nviro

nmen

t th

at is

foc

used

on

dep

ictin

g a

styl

e or

com

mun

icat

es a

mot

if as

ef

fect

ivel

y as

pos

sibl

e. T

his

is in

con

tras

t to

Ph

otor

ealis

tic w

hich

trie

s to

cre

ate

as r

eal a

sce

ne a

s po

ssib

le.

[Rob

oM

odel

with

and

with

out

Toon

Shad

ing,

Imag

e co

urte

sy o

f M

icha

el A

rias]

Hig

h lig

hts

of N

PR:

Toon

Sha

ding

Artis

tic s

tyle

s (in

k, w

ater

co

lor,

etc

.)Pe

rcep

tual

ren

derin

g

Page 6: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Non

-Pho

tore

alis

ticRe

nder

ing

Non

-Ph

otor

ealis

tic

Ren

deri

ng

Sim

ple

Exam

ple:

Bla

ck O

utlin

e*

Stor

e a

blac

k st

ripe

in a

cube

map

at

the

90 d

egre

e an

gle

By

usin

g th

e ve

rtex

norm

al in

vie

w

spac

e to

inde

x th

e C

ube

map

, yo

u ge

t a b

lack

out

line

*Man

y ot

her

met

hods

exi

st t

hat

don’

t us

e te

xtur

e ha

rdw

are

Page 7: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Non

-Pho

tore

alis

ticRe

nder

ing

Non

-Ph

otor

ealis

tic

Ren

deri

ng

Vis

ual

Exa

mpl

e:

[Im

age

cour

tesy

of

ww

w.h

ighe

nd3d

.com

]

Page 8: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Map

pin

g Ef

fect

#8

Pro

cedu

ral T

extu

rin

g

Mai

n I

dea:

“Pr

oced

ural

ly o

r an

alyt

ical

ly v

aryi

ng t

he

surf

ace

prop

ertie

s fr

om p

oint

to

poin

t in

ord

er t

o gi

ve

the

appe

aran

ce o

f su

rfac

e de

tail

that

is n

ot a

ctua

lly

pres

ent

in t

he g

eom

etry

of

the

surf

ace.

”[ad

apte

d fr

om

ptm

:apa

, pg.

7]

Hig

h lig

hts:

Noi

se (

fire,

sm

oke)

Frac

tals

(te

rrai

n)An

alyt

ical

(m

arbl

e, w

ood)

Gra

mm

ars

(tre

es, l

eave

s)[B

lue

Mar

ble

Proc

edur

al T

extu

re, t

am:a

pa]

Page 9: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Pro

cedu

ral T

extu

re M

appi

ng

Hig

h lig

hts:

Psue

do-r

ando

m n

umbe

r ge

nera

tion

with

rep

eata

bilit

y in

Sm

ooth

Band

-lim

ited

(low

-pas

s fil

ter)

, i.e

.ro

lling

hill

s vs

. sha

rp p

eaks

.

Noi

se F

un

ctio

ns:

Per

linno

ise

(mos

t po

pula

r fu

nctio

n)

prod

uces

noi

se w

ith t

he d

esira

ble

prop

erty

tha

t th

e tr

ansi

tion

from

one

poi

nt t

o an

othe

r w

ithin

the

fun

ctio

n is

a s

moo

th o

ne.

[Vas

e w

ith P

erlin

nois

e, Im

age

cour

tesy

of g

raph

ics.

lcs.

mit.

edu]

3 R

Page 10: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Pro

cedu

ral T

extu

re M

appi

ng

Frac

tals

(sta

tistic

al s

elf-

sim

ilarit

y):

A co

mpl

ex o

bjec

t,

the

com

plex

ity o

f w

hich

aris

es f

rom

the

rep

etiti

on o

f a

give

n sh

ape

at a

var

iety

of

scal

es.”

[tam

:apa

, pg.

571

]

[imag

e co

urte

sy o

f Pa

ul B

ourk

e@

ast

rono

my.

swin

.edu

.au]

Frac

tal T

erra

in G

ener

atio

n(B

asic

idea

):1.

Star

t w

ith a

cou

rse

mod

el (

squa

re)

2.Su

bdiv

isio

n of

sur

face

s (2

x2)

3.Ve

rtic

ally

per

turb

eac

h of

the

5 n

ew v

ertic

es

by a

ran

dom

am

ount

4.

Rep

eat

until

don

e

Page 11: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Pro

cedu

ral T

extu

re M

appi

ng

Frac

tal E

xam

ples

:

[Rig

ht:

Ridg

ed m

ulti-

frac

tal,

Left

: A

Frac

tal G

ener

ated

Ter

rain

, Tex

turin

g an

d M

odel

ing:

A P

roce

dura

l App

roac

h ]

Page 12: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Pro

cedu

ral T

extu

re M

appi

ng

Anal

ytic

al E

xam

ples

:M

arbl

e

Woo

d -

Ver

tica

l cyl

inde

rs

[Pro

cedu

ral w

ood,

bot

h co

urte

sy

of h

ttp:

//re

nder

man

.ru]

[Pro

cedu

ral m

arbl

e]

),

4,4(

),

,(

22

rt

snoise

ts

rts

f+

+=

∑ =

−+

=N i

ii

ii

rt

snoise

rr

ts

f0

)2,

2,2(

2)

,,

( *ico

ntin

ually

incr

ease

s th

e no

ise

ampl

itude

ani

mat

es t

heFo

rmat

ion

of t

he v

eins

*s,t

,rar

e so

lid t

extu

re c

oord

inat

es, t

hese

are

use

d to

do

aco

lor

map

look

up

for

the

text

ure.

Page 13: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Map

pin

g Ef

fect

#8

Pro

s: Mem

ory

requ

irem

ent

is m

inim

al, p

roce

dura

l or

anal

ytic

al

repr

esen

tatio

n is

ver

y co

mpa

ctN

o fix

ed r

esol

utio

n, in

finite

zoo

m-in

and

zoo

m-o

ut

Occ

upy

infin

ite s

pace

or

area

Con

s: Diff

icul

t to

bui

ld a

nd d

ebug

Slow

er t

hat

text

ure

fetc

hing

Alia

sing

can

be

mor

e di

ffic

ult

than

a r

egul

ar t

extu

rePr

oced

ures

ten

d to

be

prob

lem

spe

cific

(fr

acta

l ter

rain

, etc

.),

not

gene

raliz

ed

Page 14: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Map

pin

g Ef

fect

#7

Hig

h D

ynam

ic R

ange

Tex

ture

Map

pin

g

Mai

n id

ea:

“Vis

ualiz

ing

HD

R im

age-

base

d sc

enes

in

grap

hics

har

dwar

e w

ithou

t co

mpr

essi

ng t

he d

ynam

ic

rang

e.”[

HD

RTM

]

Hig

hlig

hts :

Usi

ng t

extu

re h

ardw

are

for

HD

R re

nder

ing

HD

R T

exur

e co

mpr

ised

of

mul

tiple

reg

ular

tex

ture

sM

ulti-

text

urin

g su

ppor

t to

co

mbi

ne t

extu

res

[Fre

snel

refle

ctio

n on

the

mon

olith

in

cath

edra

l, im

age

from

HD

RTM

]

Page 15: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

HD

R T

extu

re M

appi

ng

Hig

h D

ynam

ic R

ange

Tex

ture

Map

pin

g

Wha

t is

dyn

amic

ran

ge?:

Mea

sure

of

lum

inan

ce r

ange

sSu

n on

the

ord

er 1

Mill

ion

Lum

ens

TV o

n th

e or

der

of a

100

-200

Lum

ens

[16

imag

es o

f a

cath

edra

l at

vario

us e

xpos

ures

, for

m R

ecov

erin

g H

DR R

adia

nce

Map

s fr

om P

hoto

grap

hs]

Page 16: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

HD

R T

extu

re M

appi

ng

Hig

h D

ynam

ic R

ange

Tex

ture

Map

pin

g

How

to

enco

de H

DR in

8 b

it te

xtur

es:

))*

*25

6(

)*

((

)(

10

ve

clamp

ve

clamp

clamp

vI

+=

[Flo

w o

f te

xtur

e da

ta, i

mag

e fr

om H

DRTM

]

The

low

ord

er b

its a

re

stor

ed in

tex

ture

v0

and

the

high

ord

er a

re s

tore

d in

te

xtur

e v1

Expo

sure

par

amet

er is

eSu

rfac

e ap

pear

ance

is I

Page 17: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

HD

R T

extu

re M

appi

ng

Visu

al D

iffer

ence

s Be

twee

n LD

R a

nd H

DR

Hig

h D

ynam

ic R

ange

Low

Dyn

amic

Ran

ge

[Im

ages

fro

m H

DRTM

]

Page 18: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Map

pin

g Ef

fect

#6

Text

ure

Bom

bin

g

Mai

n id

ea:

Div

ide

the

UV

text

ure

spac

e in

to g

rids

or

cells

the

n ra

ndom

ly p

lace

an

imag

e w

ithin

sel

ecte

d ce

lls g

ivin

g th

e te

xtur

e a

colla

ge lo

ok.

[Tex

ture

bom

bed

elep

hant

in

Ren

derm

onke

y, c

ourt

esy

of A

TI]

Hig

h lig

hts:

Com

posi

ting

can

be w

ith

imag

es o

r pr

oced

ural

lyM

ultip

le im

ages

per

cel

l (o

verla

ppin

g im

ages

)M

any

way

s to

pic

k ce

lls

Page 19: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Bom

bing

Text

ure

Bom

bin

g

Tech

niqu

e:

Find

a c

ell t

o pl

ace

imag

e (u

sual

ly a

ran

dom

pro

cess

)Co

py o

r dr

aw t

he im

age

in t

heCe

ll pr

oced

ural

lyCo

nsid

er a

djac

ent

cells

(o

verla

pp?)

[Tex

ture

bom

bing

Im

ages

, cou

rtes

y of

w

ww

.web

natio

n.co

m]

*Pla

cem

ent

is u

sual

ly im

port

ant

depe

ndi

ng

on e

ffec

t

Page 20: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Bom

bing

Text

ure

Bom

bin

g

Tech

nica

l Exa

mpl

e: f

indi

ng a

3D

cel

l:

for(

i = -

1, i

<=

0;

i++

){

for(

j = -

1, j

<=

0;

j++

){

for(

k =

-1,

k <

= 0

; k+

+)

{ cell_

t =

cel

l + f

loat

3(i,j

,k);

offs

et_t

= o

ffse

t –

float

3(i,j

,k);

rand

omU

V =

cel

l_t.

xy *

flo

at2(

.037

, .11

9) +

cel

l_t.

z *

.003

;… }

}} [C

ode

exam

ple

from

GPU

Gem

s]

Page 21: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Map

pin

g Ef

fect

#5

Text

ure

Sh

adin

g

Mai

n I

dea:

Tex

ture

Sha

ding

pre

com

pute

s co

mpl

ex

surf

ace

and

light

ing

mod

els,

suc

h as

BRD

Fs, i

nto

a lo

okup

tex

ture

for

rea

l-tim

e ap

plic

atio

ns w

ith f

ixed

pi

pelin

es.

Hig

h lig

hts:

Com

plex

BRD

Fs a

re u

sual

ly

prec

ompu

ted

in t

his

fash

ion

Mul

ti-pa

ss r

ende

ring

or m

ulti-

fetc

h te

xtur

e lo

okup

sFa

ctor

izat

ion

[Fac

tore

d BR

DFs

: La

Fort

une

mod

el, I

mag

es

from

Sig

grap

h Pa

per

(see

ref

eren

ces)

]

Page 22: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Sh

adin

g

Pre

com

puti

ng

Mos

t BR

DFs

can

be

fact

ored

or

brok

en u

p w

ith t

he p

arts

bei

ng

fact

orab

le.

Fact

or o

ver

2 va

riabl

es:

φθ,

A)As

hikh

min

-Shi

rley

B)Po

ulin

-Fou

rnie

rC)

Viny

l (m

easu

red)

D)A

lum

. Foi

l (m

easu

red)

Page 23: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Shad

ing

Text

ure

ref

eren

ce(p

reco

mpu

te&

ru

n t

ime)

Prec

ompu

te:

Incr

emen

t th

roug

h s

torin

g th

e ev

alua

ted/

mea

sure

d va

lues

in t

he

appr

opria

te t

extu

re c

oord

inat

e

φθ,

φ

θRun

Tim

e:Ca

lcul

ate

the

inco

min

g an

d ou

t go

ing

vect

or t

o ge

t In

dex

into

tex

ture

per

φ

θ,

[Pre

com

pute

dre

flect

ance

tex

ture

s,

Freq

uenc

y En

viro

nmen

t M

appi

ng]

Page 24: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Shad

ing

Mor

e Ex

ampl

es

A)As

hikh

min

-Shi

rley

B)Po

ulin

-Fou

rnie

rC)

Viny

l (m

easu

red)

D)A

lum

. Foi

l (m

easu

red)

Page 25: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Map

pin

g Ef

fect

#4

Vol

um

e R

ende

rin

g

Mai

n id

ea:

“Vol

ume

rend

erin

g m

etho

ds g

ener

ate

imag

es o

f a

3D v

olum

etric

dat

a se

t w

ithou

t ex

plic

itly

extr

actin

g ge

omet

ric s

urfa

ces

from

the

dat

a”[g

puge

ms]

Hig

hlig

hts:

Stac

ks o

f 2D

tex

ture

slic

esVo

xel(

anal

ogus

to p

ixel

,te

xel)

Rec

onst

ruct

ion

(inte

rpol

atio

n be

twee

nvo

xels

)

[Scr

een

shot

fro

m T

extu

re V

isua

lizer

Sof

twar

e]

Page 26: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Vol

um

e R

ende

rin

g

Vol

um

e R

ende

rin

g Si

mpl

e Ex

ampl

e

Cond

ense

d St

eps

For

Ren

derin

g:1.

Set

up t

extu

re d

ata,

fra

gmen

t pr

ogra

m, M

odel

view

and

Pro

ject

ion

mat

rices

.

2.En

able

Alp

ha b

lend

ing.

gl

Enab

le(G

L_BL

END

);

glBl

endF

unc(

GL_

ON

E ,

GL_

ON

E_M

INU

S_SR

C_AL

PHA

);

1.D

isab

le li

ghts

and

dep

th t

est.

gl

Dis

able

(GL_

LIG

HTI

NG

);

glD

isab

le(G

L_D

EPTH

_TES

T);

1.Bi

nd t

extu

re d

ata

and

frag

men

t pr

ogra

m.

2.D

raw

tex

ture

d qu

ads.

X

YZ

[ste

ps p

rovi

ded

in G

PU G

ems,

ch3

9.3.

1, p

g 67

3]

Page 27: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Vol

um

e R

ende

rin

g

Cg

Frag

men

t P

rogr

am F

or S

impl

e V

olu

me

Ren

deri

ng

void

mai

n (

unifo

rm f

loat

3em

issi

veco

lor,

un

iform

sam

pler

3dda

taTe

x,

float

3te

xCoo

rd :

TEX

COO

RD

0,

float

4co

lor

: CO

LOR)

{//

read

vol

ume

data

float

a =

tex

3d(t

exCo

ord,

dat

aTex

);

//m

ultip

ly c

olor

and

opac

aity

colo

r =

a *

em

issi

veCo

lor;

}

[Cg

code

sam

ple

from

GPU

Gem

s, c

h 39

, pg.

673

]

Page 28: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Vol

um

e R

ende

rin

gV

isu

al E

xam

ples

2D t

extu

res(

axis

-alig

ned

slic

es)

3D t

extu

res(

view

-alig

ned

Slic

es),

imag

es c

ourt

esy

of S

iggr

aph/

Euro

grap

hics

text

urin

g(b

iline

arin

terp

olat

ion)

text

urin

g(b

iline

arin

terp

olat

ion)

com

posi

ting

(ble

ndin

g)co

mpo

sitin

g(b

lend

ing)

text

urin

g(tr

iline

arin

terp

olat

ion)

text

urin

g(tr

iline

arin

terp

olat

ion)

com

posi

ting

(ble

ndin

g)co

mpo

sitin

g(b

lend

ing)

Page 29: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Map

pin

g Ef

fect

#3

Text

ure

Atl

as

Mai

n I

dea:

Sto

re m

ultip

le s

mal

ler

text

ures

into

a

larg

er s

ingl

e te

xtur

e.

[Im

age

cour

tesy

of

Cat

Mot

her]

Hig

h lig

hts:

Pres

erve

sur

face

det

ails

Com

bine

mul

tiple

tex

ture

sCa

n ev

en c

ompu

te li

ghtin

g!?

Page 30: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Atl

as

Text

ure

Atl

as

Use

d Ex

ten

sive

ly in

Gam

es:

Hig

h re

solu

tion

mes

hes

gene

rate

mor

e de

tail

whe

n sh

aded

, we

can

pres

erve

tha

t de

tail

and

appl

y to

low

er r

esol

utio

ns m

eshe

s. T

his

is

grea

tfo

r ga

me

char

acte

rs!

An in

tern

al n

Vidi

asu

rvey

of

four

Dire

ctX9

titl

es r

evea

ls t

hat

the

follo

win

g re

nder

-sta

te c

hang

es o

ccur

mos

t fr

eque

ntly

[nsd

k]:

SetT

extu

re()

// b

ad n

ews!

!!SetVertexShaderConstantF()

SetPixelShader()

SetStreamSource()

SetVertexDeclaration()

SetIndices()

[Im

ages

cou

rtes

y of

Gar

age

Gam

es]

Page 31: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Atl

as

Text

ure

Atl

as

Pro

s: Cons

erve

mem

ory

-te

xtur

e m

emor

y is

sca

rce

even

w

ith t

oday

's g

raph

ics

card

sRed

uce

com

puta

tion

at r

un t

ime

Com

plex

ity r

educ

tion,

mod

el h

as o

ne t

extu

re

Con

s: Seem

s an

d te

xtur

e po

llutio

n fr

omH

ow d

o w

e la

yout

the

mes

h(no

n-tr

ivia

l)?

Page 32: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Map

pin

g Ef

fect

#2

Envi

ron

men

t M

appi

ng

Mai

n id

ea:

“Env

ironm

ent

Map

s ar

e te

xtur

es t

hat

desc

ribe

for

all d

irect

ions

the

inco

min

g or

out

goi

ng

light

at

a po

int

in s

pace

.”[r

t_sh

ade,

pg.

49]

Thre

e m

ain

type

s:Cu

be M

appi

ngSp

here

map

ping

Para

bolo

id M

appi

ng

No

Map

app

lied

Map

App

lied

[Im

ages

cou

rtes

y of

Mic

roso

ft, m

sdn.

mic

roso

ft..c

om]

Page 33: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Envi

ron

men

t M

appi

ng

Cu

bic

Map

pin

gCa

mer

a ta

kes

orth

ogra

phic

pic

ture

s in

six

axi

s

(-X,

X, Y

, -Y,

Z, -

Z)Lo

ok u

p is

def

ined

cal

cula

ting

a re

flec

tion

vect

or

[imag

e co

urte

sy o

f nV

idia

.com

]

* In

dex

into

the

Neg

ativ

e Z

regi

on (

dark

blu

e)

I.E.

: R =

(3.

14, .

21, -

8.7)

X, Y,

Z

Z is

larg

est

& n

egat

ive

Page 34: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Envi

ron

men

t M

appi

ng

Sph

ere

Map

pin

gG

ener

ated

fro

m p

hoto

grap

hing

a r

efle

ctiv

e sp

here

Capt

ures

who

le e

nviro

nmen

t

[Dia

gram

and

Sph

ere

Map

imag

e of

a C

afe

in P

alo

Alto

, CA

, Hei

dric

h]

Page 35: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Envi

ron

men

t M

appi

ng

Sph

ere

Map

pin

g

Obt

ain

the

refle

ctio

n ve

ctor

:)

(0.2

IN

NI

Rr

rr

rr

•⋅

⋅−

= [imag

e co

urte

sy o

f nV

idia

.com

](

)(

)2

22

12

21

,

21

++

+=

+=

+=

zy

x

yx

RR

Rm

mRt

mRsIn

dex

into

the

Sph

ere

map

:

Page 36: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Envi

ron

men

t M

appi

ng

Par

abal

oid

Map

pin

g

()

22

2121

),

(y

xy

xf

+−

=1

22

≤+y

x, w

here

Hig

h Li

ghts

:Tw

o te

xtur

es, o

ne f

or

each

hem

isph

ere

No

artif

acts

at

pole

sReq

uire

s 2

pass

es o

r tw

o te

xtur

e fe

tche

s to

re

nder

[Sha

ded

area

s of

Par

abol

oid

Map

, im

age

adap

ted

from

[ph

d]]

Page 37: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Envi

ron

men

t M

appi

ng

Cons

: Sphe

re m

aps

have

a s

ingu

larit

y of

the

pa

ram

eter

izat

ion

of t

his

met

hod,

we

mus

t fix

vi

ewin

g di

rect

ion,

vie

w-d

epen

dent

(m

eani

ng if

you

w

ant

to c

hang

e th

e vi

ewer

s di

rect

ion

you

have

to

rege

nera

te t

he S

pher

e m

ap).

Para

bolo

id m

aps

requ

ires

2 pa

sses

Pros

: Bett

er s

ampl

ing

of t

he t

extu

re e

nviro

nmen

t fo

r Pa

rabo

loid

map

ping

, vie

w-in

depe

nden

t,Cu

be m

aps

can

be f

ast

if im

plem

ente

d in

har

dwar

e (r

eal-t

ime

gene

ratio

n), v

iew

inde

pend

ent,

Page 38: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Text

ure

Map

pin

g Ef

fect

#1

Bu

mp

Map

pin

g

Mai

n id

ea:

“Com

bine

s pe

r-fr

agm

ent

light

ing

with

su

rfac

e no

rmal

per

turb

atio

ns s

uppl

ied

by a

tex

ture

, in

orde

r to

sim

ulat

elig

ht in

tera

ctio

ns o

n a

bum

py

surf

ace.

”[Cg

Tut

oria

l, pg

199

]”

Whe

re C

an I

get

the

se m

aps?

:N

orm

al M

aps

from

Hei

ght

Fiel

ds (

mos

t co

mm

on)

Vect

or O

ffse

t M

aps

[tex

ture

atla

s an

d no

rmal

map

of

an M

16

rifle

, im

ages

cou

rtes

y of

cat

mot

her]

Page 39: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Bu

mp

Map

pin

g

Bu

mp

Map

P=

orig

inal

Sur

face

loca

tion/

heig

htN

= S

urfa

ce N

orm

alF

= D

ispl

acem

ent

Func

tion

P’=

New

Sur

face

loca

tion/

heig

ht

*),

()

,(

),

()

,(

vu

Fv

uN

vu

Pv

uP

r+

=′

),

(v

uP

),

()

,(

),

(v

uF

vu

Nv

uP

r+

Imag

e Ad

apte

d fr

om [

pbrt

]

* As

sum

es is

nor

mal

ized

.Nr

Page 40: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Bu

mp

Map

pin

g

Bu

mp

Map

The

new

Nor

mal

N’ f

or P

’ can

be

calc

ulat

ed f

rom

th

e cr

oss

prod

uct

of it

’s p

artia

l der

ivat

ives

[Blin

n].

∂∂×

∂∂+

∂∂

×∂∂

+≈

∂′

∂×

∂′

∂=′

vPN

vFuP

NuF

NvP

uPN

rr

rr

Dif

fere

ntia

l Mat

h!!!

Page 41: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Bu

mp

Map

pin

g

Bu

mp

Map

s

Pros

:Pr

oduc

es t

he a

ppea

ranc

e of

hig

h de

tail

w/

out

the

cost

Can

be d

one

in h

ardw

are

Cons

:N

o se

lf sh

adow

ing

(nat

ivel

y)Ar

tifac

ts o

n th

e si

lhou

ette

s

Page 42: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Bu

mp

Map

pin

g

Cg

Bu

mp

Map

pin

gflo

at4

mai

n( float

2 de

tailC

oord

s: T

EXC

OO

RD

0,

float

2 bu

mpC

oord

s: T

EXC

OO

RD

1,

float

3 lig

htV

ecto

r: C

OLO

R0,

un

iform

floa

t3am

bien

tCol

or,

unifo

rm sa

mpl

er2D

deta

ilTex

ture

: TEX

UN

IT0,

un

iform

sam

pler

2Dbu

mpT

extu

re: T

EXU

NIT

1): C

OLO

R{

float

3de

tailC

olor

= te

x2D

(det

ailT

extu

re,d

etai

lCoo

rds)

.rgb;

//

Unc

ompr

ess v

ecto

rs ([

0, 1

] ->

[-1,

1])

flo

at3

light

Vec

torF

inal

= 2.

0 *

(ligh

tVec

tor.r

gb-0

.5);

float

3bu

mpN

orm

alV

ecto

rFin

al

= 2.

0 *

(tex2

D(b

umpT

extu

re,b

umpC

oord

s).rg

b-0

.5);

// C

ompu

te d

iffus

e fa

ctor

flo

at d

iffus

e =

dot(b

umpN

orm

alV

ecto

rFin

al,l

ight

Vec

torF

inal

); re

turn

floa

t4(d

iffus

e *

deta

ilCol

or+

ambi

entC

olor

, 1.0

); }

Page 43: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Hon

orab

le M

enti

on

Som

e O

ther

Tex

ture

Rel

ated

Alg

orith

ms:

Text

ure

Map

ping

Har

dwar

eAn

ti-Al

iasi

ng3D

Tex

ture

Map

ping

Anim

ated

Tex

ture

sAl

pha

Map

ping

Proj

ectiv

e Te

xtur

esTe

xtur

e An

imat

ion

Page 44: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Sum

mar

y

As y

ou c

an s

ee f

rom

the

slid

es, t

extu

re m

appi

ng

goes

bey

ond

the

gene

ral d

efin

ition

of

text

ure

map

ping

.

All o

f th

ese

exci

ting

adva

ncem

ents

in t

extu

re

map

ping

hav

e co

me

abou

t fr

om t

he h

ardw

are’

s co

mpa

nies

des

ire t

o m

ake

text

ure

map

ping

fas

t.

The

effe

cts

show

n he

re a

re p

roba

bly

the

mos

t re

spon

sibl

e fo

r m

akin

g re

al-t

ime

grap

hics

look

and

fe

el m

ore

real

istic

.

Page 45: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Ref

eren

ces

#1

Bum

p M

appi

ng:

A Pr

actic

al a

nd R

obus

t Bum

p-m

appi

ng T

echn

ique

for

Toda

y’s

GPU

s, M

ark

J. K

ilgar

d, N

VID

IA C

orpo

ratio

n, G

DC

2000

: Ad

vanc

edO

pneG

LG

ame

Dev

elop

men

t.Si

mul

atio

n of

Wrin

kled

Sur

face

s,Bl

inn,

Jim

, Int

erna

tiona

l Co

nfer

ence

on

Com

pute

r G

raph

ics

and

Inte

ract

ive

Tech

niqu

es, 1

978

The

Cg T

utor

ial,

Fern

ando

, Ran

dim

a, K

ilgar

d, M

ark,

Add

ison

-W

esle

y, 2

003

Cg B

ump

Map

ping

, Sur

dule

scu,

Raz

van,

ht

tp:/

/ww

w.g

amed

ev.n

et/r

efer

ence

/art

icle

s/ar

ticle

1903

.asp

, 4/

15/2

003,

Gam

edev

.net

Cour

se S

lide

from

“In

tera

ctiv

e Sh

adin

g Co

urse

”, B

rad

Gra

ntha

m, S

iggr

aph

1999

, ht

tp:/

/ww

w.o

peng

l.org

/res

ourc

es/t

utor

ials

/sig

99/s

hadi

ng99

/cou

rse_

slid

es/S

hadi

ng1/

sld0

02.h

tmPh

ysic

ally

Bas

ed R

ende

ring,

Pha

rr, M

att,

Hum

phre

ys, G

reg,

El

sevi

erIn

c./M

orga

n-Ka

ufm

an, 2

004

Page 46: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Ref

eren

ces

#2

Envi

ronm

ent

Map

ping

Rea

l-tim

e Sh

adin

g,O

lano

, Mar

c, H

art,

C.,

John

,Hei

dric

h,

Wol

fgan

g,M

cCoo

l, M

icha

el,A

.K. P

eter

s, 2

002.

cube

dia

gram

fro

m:

http

://m

sdn.

mic

roso

ft.c

om/li

brar

y/de

faul

t.as

p?ur

l=/li

brar

y/en

- us/d

irect

x9_c

/dire

ctx/

grap

hics

/Tut

oria

lsAn

dSam

ples

/Tut

oria

ls/

HLS

LWor

ksho

p/En

viro

nmen

tMap

2.as

pPe

rfec

t Ref

lect

ions

and

Spec

ular

Ligh

ting

Effe

cts

With

Cub

e En

viro

nmen

t M

appi

ng,n

Vidi

aTe

chni

cal B

rief,

ww

w.n

vidi

a.co

m,G

efor

ce25

6 G

PU.

Not

es f

rom

ope

ngls

ite

http

://w

ww

.ope

ngl.o

rg/r

esou

rces

/tut

oria

ls/s

ig99

/adv

ance

d99/

note

s/no

de18

3.ht

ml

Hig

h-qu

ality

Sha

ding

and

Lig

htin

g fo

r H

ardw

are-

acce

lera

ted

Ren

derin

g,he

idric

h, W

olfg

ang,

PhD

the

sis,

Uni

vers

ity o

fEr

lang

en-N

iirnb

erg,

Apr

il 19

99

Page 47: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Ref

eren

ces

#3

Text

ure

Atla

sIm

prov

e Ba

tchi

ng U

sing

Tex

ture

Atla

ses

-N

vidi

aSD

Kw

hite

pape

r.G

arag

e G

ames

, Tor

que

Gam

e En

gine

.Rea

l-tim

e Sh

adin

g,O

lano

, Mar

c, H

art,

C.,

John

,Hei

dric

h, W

olfg

ang,

McC

ool,

Mic

hael

,A.K

. Pet

ers,

200

2.

#4

Volu

me

Ren

derin

gKl

aus

Enge

l, M

artin

Kra

us, T

hom

asEr

tl, S

iggr

aph/

Euro

grap

hics

Wor

ksho

p on

Gra

phic

s H

ardw

are,

200

1, P

ower

Poi

nt S

lides

GPU

Gem

s, C

hapt

er 3

9 Vo

lum

e Ren

derin

g Te

chni

ques

, Fer

nand

o,Ran

dim

a, A

ddis

on-w

esle

yan

dnV

idia

, 200

4.Te

xtur

e Vi

sual

izer

Soft

war

e,W

eiLi

, Sto

ny B

rook

Uni

vers

ity,

http

://w

ww

.cs.

suny

sb.e

du/.

../Te

xtur

eVis

ualiz

er.h

tm

Page 48: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Ref

eren

ces

#5

Text

ure

Shad

ing

Effic

ient

BRD

F Im

port

ance

Sam

plin

g U

sing

a F

acto

red

Rep

rese

ntat

ion,

Jas

on L

awre

nce,

Szym

on R

usin

kiew

icz,

Rav

i Ram

amoo

rthi

, Sig

grap

h, 2

004

Freq

uenc

y Sp

ace

Envi

ronm

ent

Map

Ren

derin

g,Rav

i Ram

amoo

rthi

, Pa

tH

anra

han,

Sig

grap

h 20

02Rea

l-tim

e Sh

adin

g,O

lano

, Mar

c, H

art,

C.,

John

,Hei

dric

h, W

olfg

ang,

McC

ool,

Mic

hael

,A.K

. Pet

ers,

200

2

#6

Text

ure

Bom

bing

Text

ure

bom

bing

, Cha

pter

20

of G

PU G

ems,

Fer

nand

o,Ran

dim

a,

Addi

son-

wes

ley

and

nVid

ia, 2

004,

pg.

323

#7

Hig

h D

ynam

ic R

ange

Tex

ture

Map

ping

Rea

l-tim

e H

DR T

extu

re M

appi

ng, J

onat

han

Cohe

n, C

hris

Tcho

u,

Tim

Haw

kins

, and

Pau

lDeb

evec

,Eur

ogra

phic

s w

rksh

opon

re

nder

ing,

200

1Rec

over

ing

Hig

h D

ynam

ic R

ange

Rad

ianc

e M

aps

from

Ph

otog

raph

s, P

aul E

.Deb

evec

Jite

ndra

Mal

ik, S

iggr

aph

1997

Page 49: by Cliff Lindsay - WPIweb.cs.wpi.edu/~emmanuel/courses/cs563/S05/talks/...High Dynamic Range Texture Mapping Main idea: “Visualizing HDR image-based scenes in graphics hardware without

Ref

eren

ces

#8

Proc

edur

al T

extu

ring

Text

urin

g an

d M

odel

ing:

A p

roce

dura

l App

roac

h, t

hird

add

ition

, Eb

ert,

Dav

id,M

usgr

ave,

F,P

each

ey,D

arw

yn,P

erlin

, Ken

, Wor

ley,

St

even

, Mor

gan

Kauf

man

, 200

3Rea

l-tim

e Sh

adin

g,O

lano

, Mar

c, H

art,

C.,

John

,Hei

dric

h, W

olfg

ang,

McC

ool,

Mic

hael

,A.K

. Pet

ers,

200

2.

#9

Non

-Pho

tore

alis

ticRe

nder

ing

The

Cg T

utor

ial,

Fern

ando

,Ran

dim

a,Ki

lgar

d, M

ark,

Add

ison

-W

esle

y, 2

003

Non

-Pho

tore

alis

ticCo

mpu

ter

Gra

phic

s, T

hom

asSt

roth

otte

, Ste

fan

Schl

echt

weg

, Mor

gan

Kauf

man

200

2G

PU T

oon

Shad

ing,

D.S

imD

ietr

ich

Jr.,

nVid

iaIn

c., G

DC

Talk

20

02#

10 L

ight

Map

ping

Not

es f

rom

ope

ngl.o

rg

tuto

rials

/adv

ance

d/ad

vanc

ed98

/not

es/n

ode1

03.h

tml

Rea

l-tim

e Ren

derin

g 2n

dEd

ition

, tom

as A

keni

ne-M

olle

r, E

ric h

aine

s,

A.K.

Pet

ers,

200

2Va

rious

Art

icle

s, h

ttp:

//w

ww

.gam

asut

ra.c

om