/
Environment Mapping CSE Environment Mapping CSE

Environment Mapping CSE - PowerPoint Presentation

sophia2
sophia2 . @sophia2
Follow
342 views
Uploaded On 2022-06-15

Environment Mapping CSE - PPT Presentation

5542 Roger Crawfis Natural illumination People perceive materials more easily under natural illumination than simplified illumination Images courtesy Ron Dror and Ted Adelson Natural illumination ID: 919494

map environment sphere reflection environment map reflection sphere basis illumination coefficients irradiance color light functions mapping diffuse texture function

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Environment Mapping CSE" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

Environment MappingCSE 5542 – Roger Crawfis

Slide2

Natural illumination

People perceive materials more easily under natural illumination than simplified illumination.

Images courtesy Ron Dror and Ted Adelson

Slide3

Natural illumination

Natural illumination is very expensive compared to using simplified

illumination (take CSE

5543).

directional source

natural illumination

Slide4

Environment MappingDetermine reflected ray.

Look-up direction from a sphere-map.

Reflection only depends

on the direction, not the position.

Slide5

Environment MappingWe can also encode

the reflected directions using several other formats.Greene, et al suggested a cube. This has the advantage that it can be constructed by six normal renderings.

Slide6

Environment MappingCreate six views from the shiny object’s centroid.When scan-converting the object, index into the appropriate view and pixel.

Use reflection vector to index.Largest component of reflection vector will determine the face.

Slide7

Environment Mapping

Problems:

Reflection is about object’s centroid.

Okay for small objects and

and distant reflections.

N

N

Slide8

Environment MappingLatitude/LongitudeToo much distortion at poles

Slide9

Environment MappingCube Maps

Can be created with GPULow distortion

Slide10

Environment MappingCube Mapping

Slide11

Sphere Mapping

Slide12

Indexing Sphere Maps

Given the reflection vector

R

(s,t) on the spherical map

Problems:

Highly non-uniform sampling

Highly non-linear mapping

Slide13

Non-linear Mapping

Linear interpolation of texture coordinates picks up the wrong texture pixels

Use small polygons!

Correct

Linear

Slide14

Sphere Mapping

Can be easily created by photographing a mirrored sphere.

Slide15

Sphere Mapping

Miller and Hoffman, 1984

Slide16

Sphere MappingExample

Slide17

Parabolic MappingDual Paraboloid

Error

Support Region

Slide18

Parabolic Mapping

Slide19

Environment MappingApplicationsSpecular highlightsMultiple light sources

Reflections for shiny surfacesIrradiance for diffuse surfaces

Slide20

Specular Highlights

Sphere map on top

Result in the middle

Standard OpenGL lighting on the bottom.

Not needed with fragment shaders, … unless …

Still a nice technique for many lights.

View dependent.

Slide21

Chrome MappingCheap environment mappingMaterial is very glossy, hence perfect reflections are not seen.

Index into a pre-computed view independent texture.Reflection vectors are still view dependent.

Slide22

Chrome MappingUsually, we set it to a very blurred landscape image.Brown or green on the bottom

White and blue on the top.Normals facing up have a white/blue color

Normals facing down on average have a brownish color.

Slide23

Chrome MappingAlso useful for things like fire.The major point, is that it is not important what actually is shown in the reflection, only that it is view dependent.

Slide24

Diffuse Reflection

radiosity

(image intensity)

reflectance

(albedo/texture)

irradiance

(incoming light)

×

=

quake light map

Slide25

Lambertian

Surface

Diffuse Scattering

specular

reflection

diffuse reflection

Light everywhere

Slide26

2-Color Hemi-sphere Model

Sky Color

Ground Color

q

The 2-color hemi-sphere model from Lab1 was a very simple environment map for diffuse reflection.

Slide27

Model Elements

Sky Color

Final Color

Ground Color

Hemisphere Model

Slide28

Distributed Light Model

Hemisphere of possible incident light directions

Surface Normal

Microfacet Normal

- defines axis of hemisphere

q

Slide29

Irradiance environment maps

Illumination Environment Map

Irradiance Environment Map

L

n

Slide30

Example Hemi-sphere

Map

Environment map

(longitude/latitude)

Irradiance map

Slide31

Cube Map And Its Integral

Slide32

Spherical HarmonicsRoger CrawfisCSE 781

Slide33

Basis Functions are pieces of signal that can be used to produce approximations to a function

Basis

f

unctions

Slide34

We can then use these coefficients to reconstruct an approximation to the original signal

Basis

f

unctions

Slide35

We can then use these coefficients to reconstruct an approximation to the original signal

Basis

f

unctions

Slide36

Orthogonal Basis Functions

Orthogonal Basis Functions

These are families of functions with special properties

Slide37

Orthogonal Basis Functions

Space to represent dataDifferent spaces often allow for compression of coefficients

Lets look at one simple example of the following piece of data

Data

Slide38

Orthogonal Basis FunctionsStandard Basis

Coefficient for each discrete position

Slide39

DCTDiscrete Cosine Transform

Use Cosine waves as basis functions

1

cos

x

cos 2x

cos 3x

Slide40

Function Reconstruction with DCT

0.15

+ 0.25

=

- 0.3

=

k

cos x

cos 3x

Slide41

Function Reconstruction with DCTOnly needed 3 coefficients instead of 20!

Remaining coefficients are all 0

Most of the time data not perfect

Obtain good reconstruction from few coefficients

Arbitrary function conversion requires projection

Slide42

Real spherical harmonics

Slide43

Reading SH

diagrams

+

Not this

direction

This

direction

Slide44

Reading SH

d

iagrams

+

Not this

direction

This

direction

Slide45

The SH functions

Slide46

The SH functions

Slide47

Spherical harmonics

-1

-2

0

1

2

0

1

2

m

l

Slide48

Examples of reconstruction

Displacement mapping on the sphere

Slide49

An example

Take a function comprised of two area light sourcesSH project them into 4 bands = 16 coefficients

Slide50

Low frequency light source

We reconstruct the signal

Using only these coefficients to find a low frequency approximation to the original light source

Slide51

SH lighting for diffuse objectsAn Efficient Representation for Irradiance Environment Maps

, Ravi Ramamoorthi

and Pat

Hanrahan

, SIGGRAPH 2001

AssumptionsDiffuse surfaces

Distant illumination No shadowing, interreflection

irradiance is a function of surface normal

Slide52

Spherical harmonic expansionExpand lighting (L), irradiance (E) in basis functions

= .67

+ .36

+ …

Slide53

Analytic irradiance formula

Lambertian surface acts like low-pass filter

0

0

1

2

cosine term

Slide54

9 parameter approximation

Exact image

Order 0

1 term

RMS error = 25 %

-1

-2

0

1

2

0

1

2

l

m

Slide55

9 Parameter Approximation

Exact image

Order 1

4 terms

RMS Error = 8%

-1

-2

0

1

2

0

1

2

l

m

Slide56

9 Parameter Approximation

Exact image

Order 2

9 terms

RMS Error = 1%

For any illumination, average

error < 3% [Basri Jacobs 01]

-1

-2

0

1

2

0

1

2

l

m

Slide57

Comparison

Incident

illumination

300x300

Irradiance map

Texture: 256x256

Hemispherical

Integration 2Hrs

Irradiance map

Texture: 256x256

Spherical Harmonic

Coefficients 1sec

Slide58

RenderingIrradiance approximated by quadratic polynomial

Surface Normal vector

column 4-vector

4x4 matrix

(depends linearly

on coefficients L

lm

)

Slide59

matrix form

c

1

L

22

c

1

L

2-2

c

1

L

21

c

2

L

11

c

1

L

2-2

-c

1

L

22

c

1

L

2-1

c

2

L

1-1

c

1

L

21

c

1

L

2-1

c

3

L

20

c

2

L

10

c

2

L

11

c

2

L

1-1

c

2

L

10

c

4

L

00 –

c

5

L

20

M =

Slide60

Complex geometry

Assume no shadowing: Simply use surface normal

Slide61

Cool!

Slide62

Slide63

IN4151 Introduction 3D graphics63

Diffuse environment shading

received radiance is function of accessability

specular reflection

diffuse reflection

Need integration over environment map

For diffuse reflection scaled by cosinus

Index in filtered versions of map

ambient occlusion

Slide64

A Skin Texture Shader

Skin appears softer than Lambertian

reflectance because of subsurface scattering

Seeliger

lighting model

I

= (N L

) / (

N

L

+ N V )

Implement as a texture shaders = N

L

t

=

N

V

C = s/(s

+t )