Docsity

Illumination Lighting - Computer Graphic - Lecture Notes | CAP 5705, Study notes of Computer Graphics

Toggle sidebar
bg1
Jorg’s Graphics Lecture Notes – 6. Illumination, Lighting 1
6. Illumination, Lighting
No ray tracing in OpenGL!
ray tracing: direct paths
COP
interreflection: soft shadows, color bleeding.
umbra, penumbra, shadows: Cex/cubes.c
Ray-object intersection reduces to root finding.
Illumination
Global lighting model = energy preservation:
see e.g. [Cohen,Wallace]: Radiosity and realistic image synthesis, AP
Radience:r(position, direction, wavelength) == energy flux
. (direction: expressed as 2 Euler angles; wavelength indicates spectrum)
Bidirectional Reflectance Distribution Function:
.BRDF (position, dir-in, spectrum-in,dir-out,spectrum-out) ...
polarization, delay
Radiosity:Rhemisphere rcos(θ) sin(θ)dθdφ,
where cos(θ) stands for cos(θ1) cos(θ2)
rout =remit +Zhemisphere Zspectrum
BRDF ·Radiosityin .
pf3
pf4
pf5

Partial preview of the text

Download Illumination Lighting - Computer Graphic - Lecture Notes | CAP 5705 and more Study notes Computer Graphics in PDF only on Docsity!

6. Illumination, Lighting

No ray tracing in OpenGL!

ray tracing: direct paths

COP

interreflection: soft shadows, color bleeding. umbra, penumbra, shadows: Cex/cubes.c

Ray-object intersection reduces to root finding.

Illumination

Global lighting model = energy preservation: see e.g. [Cohen,Wallace]: Radiosity and realistic image synthesis, AP

Radience: r(position, direction, wavelength) == energy flux

. (direction: expressed as 2 Euler angles; wavelength indicates spectrum) Bidirectional Reflectance Distribution Function: . BRDF (position, dir-in, spectrum-in,dir-out,spectrum-out) ... polarization, delay

Radiosity:

hemisphere r^ cos(θ) sin(θ)dθdφ, where cos(θ) stands for cos(θ 1 ) cos(θ 2 )

rout^ = remit^ +

hemisphere

spectrum

BRDF · Radiosityin^.

Finite elements: prior to rendering, split primitives into patches into elements (pieces); distribute energy from the current maximal one around scene Cost increased by smaller elements, more steps.

Problem: scene meshing required (of CSG, trimmed NURBS, procedurals, sub- division triangles, large scenes)

Monte Carlo evaluation: lazy evaluation of integral (randomized Riemann sum), during rendering Scales well

BRDF– form factors (advanced)

  • Reduction of one patch to a point (else subdivide). (transport theory: P (x) = p(x)dV ;
  • Hemi-cube instead of hemisphere: project scene onto Hemi-cube face and for every face record closest (in item buffer ) object and add its form factor.

Can use z-buffer; finite resolution; includes visibility calculation.

  • Nusselt’s analogy: Two surfaces with the same projection have the same form factor
  • Radiosity (r) Integral Equation:

Terminology: flux: energy (number of particles) per time, per area radiance: energy (number of particles) per time, per area, per solid angle dA = (rdθ)(r sin θdφ). solid angle ω subtended by a spherical area: area on unit sphere (steradi- ans=radians squared; total on sphere = 4π) Differential solid angle: dω = sin θdθdφ. Radiosity = Luminosity (photometric)

  • diffuse (Lambertian) nature, equal scattering (but still directional light source)
  • ambient (global energy) background glow, equal scattering

Question: Given a unit sphere, where is the highlight (point of highest inten- sity)? Reduce to plane through 0, e, p since n lies in that plane.

translucency refraction α = αm. (1 − α)Z 0 + α((1 − α)Z 1 + α(.. .))

Computing Normals

Surface in implicit representation p(x) = p(x, y, z) = 0.

The normal is the (normalized) gradient ∇p =

∂ ∂x ∂ p ∂y p ∂ ∂z p

 (^) 10spnor.maple

Surface in parametric representation x(u, v) =

x(u, v) y(u, v) z(u, v)

The normal is ∂ ∂ux × ∂ ∂vx.

Blackboard Examples: p(x) = x^2 + y^2 + z^2 − 1, x(u, v) =

cos(u) cos(v) cos(u) sin(v) sin(u)

GL LIGHT MODEL TWO SIDE (a look inside the teapot)

Polygonal Shading

  • flat
  • Gouraud : averaged vertex color using barycentric weights.
  • Phong: averaged vertex normal (and other lighting factors)

Color Gamut

Hue, Saturation, intensity

x

y

Intensity

Brightness

gamma correction, dithering

Actual intensity

Perceived intensity

Example programs

OPENGL/6light.c OPENGL/6colormat.c (mouse buttons = rgb diffuse) OPENGL/6movelight.c stationary, independent+moving, viewpoint-moving lights