컴퓨터 그래픽스 2002-2 advanced lighting and shading 2002. 10. 14

38
컴컴컴 컴컴컴컴 2002-2 Advanced Lighting and Shading 2002. 10. 14

Upload: damon-dalton

Post on 17-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Advanced Lighting and Shading

2002. 10. 14

Page 2: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Radiometry and Photometry : Definition

Radiometry Radiometry deal with the measurement of radiation throughout the

electromagnetic spectrum This range includes the infrared( 적외선 ), visible( 가시선 ), and ultr

aviolet( 자외선 ) regions of the electromagnetic spectrum wavelength from 1000 to 0.01 micrometer (=10-6 meter =10-3 millimeter)

Photometry Photometry is like radiometry except that it weights everything by th

e sensitivity of the human eye deals with only the visible spectrum (=visible band) a wavelength range of about 380 to 780 nanometer (=10-9 meter)

do not deal with the perception of color itself, but rather the perceived strength of various wavelengths

Page 3: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Radiometry and Photometry: Difference

Conversion & difference The result of radiometric computations are converted to phot

ometric units by multiplying by the CIE photometirc curve The conversion curve and the units of measurement are the

only difference between the theory of photometry and the theory of radiometry (Figure 6.1)

Page 4: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Radiometry and Photometry: Radiometry (1/6)

Radiometry radiant energy(Q)

• basic unit of energy, measured joules(J)

• the number of photon per joule :

radiant flux P or (= radiant power) of a light source• the number of joules per second emitted (=watt(W))

elengthphoton wav the

10034.5 15

Page 5: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Radiometry and Photometry: Radiometry (2/6)

radiant flux density• After photons leave a light source, the next step is to measure h

ow they arrive at a surface

• the radiant flux per unit area on a surface (=watts per square meter)

• irradiance E (= radiant flux density)– when flux arrives at a surface

• radiant exitance M (= radiosity B)– the amount of flux leaving a surface

dA

dΦu

Page 6: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Radiometry and Photometry: Radiometry (3/6)

Solid angle (Figure 6.2)• the concept of a two-dimensional angle extended to three dime

nsions

• measured in steradians (sr)

• 4 steradians would cover the whole area of the unit sphere

radiance L• the most important radiometric unit for computer graphics

• radiance is what we store in a pixel

• The amount of radiant flux coming from that direction and hitting the surface at a given point

Page 7: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Radiometry and Photometry: Radiometry (4/6)

incoming radiance at a surface

• defined as the amount of power (watt) per unit area, per unit solid angle

surface independent form of the radiance equation

)cos(

2

ddA

dLsurf

dAd

dL

2

Page 8: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Radiometry and Photometry: Radiometry (5/6)

radiance distribution • The radiance in an environment can be thought of as a function

of five {six} variables

• a location (three), direction (two) { + wavelength }

• an environment map of everything in the scene represents the incoming radiance for all directions

• Image based rendering – lightfield, plenoptic function

Page 9: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Radiometry and Photometry: Radiometry (6/6)

An object's radiance value is not affected by distance• a surface will have the same luminance regardless of its

distance from viewer– this seems in contradiction to the basic law that a light's intensity

drops off with the square of the distance.– only number of pixels that changes in relationship to the distance

from the light

• radiance remains constant

Page 10: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Radiometry and Photometry: Photometry

Photometry luminous energy (talbots) radiant energy (joules) lumen (lm) the watt (W) (radiant flux 의 측정단위 ) Illumination (the luminous flux density) irradiance luminance radiance candela (cd) a measure of luminous power per solid an

gle lux (lx) lumens(=luminous power) per square meter candelas per square meter (nit)

Page 11: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Definition (1/2)

Colorimetry Light is perceived in the visible band

• from 380 to 780 nm

distribution of wavelengths (light's spectrum) Human distinguish 10 million different colors three different types of cone receptors in the retina Standard condition for measuring color (CIE) Figure 6.4

Page 12: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Definition (2/2)

Page 13: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Color Model (1/12)

Color Matching (Color Models) RGB Color Model (Figure 6.5)

• Primary colors: RED, GREEN, BLUE.

• Secondary colors: YELLOW = red + green, CYAN = green + blue, MAGENTA = blue + red.

• WHITE = red + green + blue.

• BLACK = no light.

• Disadv– cannot directly represent all visibl

e colors (negative weights)

Page 14: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Color Model (2/12)

Greyscale• BLACK = 0% brightness, 100% grey.

• WHITE = 100% brightness, 0% grey.

• NTSC phosphors (older)– Y=0.30R+0.59G+0.11B

• CRT and HDTV phosphors (modern)– Y=0.2125R+0.7154G+0.0721B

Page 15: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Color Model (3/12)

CIE XYZ Color Model (Figure 6.6)

Page 16: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Color Model (4/12)

chromaticity diagram • curved line color of the spectrum• purple line line connecting the

ends of the spectrum• white point x=y=z=1/3• Saturation The relative distance

of the color point compared to the distance to the edge of the region

• Hue the point on the region edge

Page 17: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Color Model (5/12)

gamut

Page 18: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Color Model (6/12)

Disadvantage• the 2D diagram failed to give a uniformly-spaced visual

representation of what is actually a three-dimensional color space

Page 19: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Color Model (7/12)

CIE LUV

CIE LUV CIE LU’V’

Page 20: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Color Model (8/12)

CIE LAB retinal color stimuli are translated into distinctions

• between light and dark

• between red and green

• between blue and yellow.

CIELAB indicates these values

with three axes: L*, a*, and b*.

Page 21: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Color Model (9/12)

HSV (=HSB) Hue, Saturation, Value (=Brightness) HUE is the actual color.

• measured in angular degrees around the cone

– red = 0 or 360 (so yellow = 60, green = 120, etc.).

SATURATION is the purity of the color • measured in percent from the center of

the cone (0) to the surface (100). • At 0% saturation, hue is meaningless.

BRIGHTNESS • measured in percent from black (0) to

white (100). • At 0% brightness, both hue and saturation

are meaningless.

Page 22: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Color Model (10/12)

HLS Hue, Lightness, Saturation is similar to the HSV cone

• but with the primary colors located at L = 0.5 and with the colors of black and white acting as ends of the cones.

Page 23: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Color Model (11/12)

CMYK Primary colors: CYAN, MAGENTA,

and YELLOW. Secondary colors: BLUE = cyan +

magenta, RED = magenta + yellow, GREEN = yellow + cyan.

BLACK = cyan + magenta + yellow (in theory).

BLACK (K) INK is used in addition to C,M,Y to produce solid black.

WHITE = no color (on white paper, of course).

Standard Color Printer

Page 24: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Colorimetry: Color Model (12/12)

YIQ Used by US commercial color television broadcasting (Used

by NTSC standard) Y: encodes luminance I, Q: encode color (chromaticity) For black and white TV, only the Y channel is used People are more sensitive to the illuminance difference

• We can use more bits (bandwidth) to encode Y and less bits to encode I and Q

Page 25: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

BRDF Theory: Definition (1/2)

BRDF Bidirectional Reflectance Distribution Function Describe how lights reflected from a surface (Material properties) Input

• incoming and outgoing azimuth and elevation angles, wavelength of incoming light (Hue and saturation remain constant)

The relative amount of energy reflected in the outgoing direction, given the incoming direction

Page 26: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

BRDF Theory: Definition (2/2)

Helmholtz reciprocity• I/O angles can be switched and the function alue will be same

Normalization• Total amount of out going energy must always be less than or e

qual to incoming energy It is an approximation of BSSRDF

• Bidirectional Surface Scattering Reflectance Distribution Function

– Include the scattering of light within the surface» position change

– Adding incoming and outgoing locations as inputs» Travel along the incoming direction» From one point to the other of the surface» Along the outgoing direction

Page 27: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

BRDF Theory: Reflectance equation (1/2)

Reflectance equation Given a BRDF and an incoming radiance distribution The outgoing radiance for a given viewing direction Integrating the incoming radiance from all directions on the

hemisphere above surface

• Determine the incoming radiance

• Multiply it by BRDF for this direction and the outgoing direction

• Scale by the incoming angle to the surface

• integrate

),()cos(),(),,,(),( iiiiiiioooo dLfL

Page 28: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

BRDF Theory: Reflectance equation (1/2)

Single Point light source

Simplify the notation• Replace the azimuth and elevation

• The cosine term for light using the surface normal n

• More than one light, computed and summed together

For diffuse surface, The BRDF is trivial

)cos(),(),,,(),( iiiiioooo LfL

)cos()(),()( iiioo LfL n

i

ms

iophong

shikf

n

hn )(),(

Page 29: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

BRDF Theory: Theoretical models of BRDF (1/3)

Theoretical models of BRDF How surfaces behave

• Microfacets– Tiny, flat mirror on the surface, with random size and angle

» Gaussian distribution of sizes and angles– Specular reflection

» Direct reflections from some micro facets– Diffuse reflection

» Interreflection off several facets, scattering with in the surface material itself (shadow, mask)

• Height correlation– Microfacets have size near the wavelength of the light– Diffraction can be simulated

Page 30: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

BRDF Theory: Theoretical models of BRDF (2/3)

Fresnel reflectance (Figure 6.11)• Importance for non-conductive or dielectric, matrials such as pl

astic, glass, and water

• All materials become fully reflective at the shallowest grazing angle

• Describes the reflectance of a given surface at various angles

conductive dielectric

Page 31: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

BRDF Theory: Theoretical models of BRDF (3/3)

Limitation of BRDF theoretical model• Do not account for anisotropy

– If the viewer and the light source do not move and a flat sample of the material changes its appearance when it is rotated about its normal

– Brushed metal, vanished wood, woven cloth, fur, hair– Anisotropic BRDF

» Both iand o are needed to evaluate the BRDF (four angles)

– Isotropic BRDF

» Relative angle = i o (three angles)

• Not necessarily useful for representing some given material sample

Page 32: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

BRDF Theory: Another approach (1/3)

Another approach to represent BRDF• Acquire BRDF data from the actual surface

• With basis summation techniques– Capture the BRDF’s surface as the weighted sum of a set of functi

ons– Phong/Blinn lighting model represent BRDF by just two functions

» A diffuse component and a specular lobe

Page 33: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Implementing BRDFs

Implementing BRDFs To save on computation

• To store data for a large number of elevations and azimuths• Memory intensive• Care needs to be taken, as measured data is usually noisy and

have gaps in the set Compact representation

• Advantages– Avoid the evaluation costs for precise theoretical models– Avoid storage requirements and noisiness of acquired datasets

• Two approaches– Factorization– Environment map filtering

Page 34: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Implementing BRDFs: Factorization (1/2)

Factorization Convert a BRDF into a set of pairs of 2D textures

• One texture is accessed by the incoming direction

• The other by outgoing

(Figure 6.13)

n

jojijoi qpf

1

)()(),(

Page 35: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Implementing BRDFs: Factorization (2/2)

Forming the texture pairs1. The incoming and outgoing direction vectors are evaluated at e

ach vertex of the model2. Two pairs of texture coordinates are then used generated using

the same reparameterization3. These texture coordinates are then used to access the textures

on the surface4. Multiply the two resulting pixel colors together5. Successive pairs of textures are multiplied in the same fashion

and added to the final pixel color. Limitation

• At least two texture accesses are needed for every light source in the scene

• Only point and directional light sources can be used

Page 36: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Implementing BRDFs: Environment Mapping Filtering (1/3)

Environment Mapping Filtering Environment map

• Render a perfectly shiny surface

• Extended to glossy and diffuse surfaces (reflection map)

Fuzzy reflection• Uniformly blur the EM

• Use the phong specular equation– Weighted contribution

Page 37: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Implementing BRDFs: Environment Mapping Filtering (2/3)

Irradiance environment map• Gives the diffuse and ambient lighting for that direction

– Lumped into a single ambient term (Phong lighting model)– Quickly and accurately

• Two ways to store and access lighting– Sphere map

» Photograph a sphere painted with flat white paint» valid for only one eye direction

– Cube map

• Advantage– Eliminating per vertex lighting calculation from pipeline

• Limitations– Lights and reflected object are distant– Do not change with location of objected viewed

Page 38: 컴퓨터 그래픽스 2002-2 Advanced Lighting and Shading 2002. 10. 14

컴퓨터 그래픽스 2002-2

Implementing BRDFs: Environment Mapping Filtering (3/3)

Problem with environment mapping• The dynamic range of the light captured is usually limited to 8

bits per color channel– Not enough to simultaneously capture the full range of incident

illumination

• Solution– High Dynamic Range Image (HDRI)– Reference HDR Shop