DOC PREVIEW
Princeton COS 426 - Illumination

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1IlluminationAdam FinkelsteinPrinceton UniversityCOS 426, Spring 2003Ray CastingImage RayCast(Camera camera, Scene scene, int width, int height){Image image = new Image(width, height);for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel(camera, i, j);Intersection hit = FindIntersection(ray, scene);image[i][j] = GetColor(scene, ray, hit);}}return image;}Image RayCast(Camera camera, Scene scene, int width, int height){Image image = new Image(width, height);for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel(camera, i, j);Intersection hit = FindIntersection(ray, scene);image[i][j] = GetColor(scene, ray, hit);}}return image;}WireframeRay CastingImage RayCast(Camera camera, Scene scene, int width, int height){Image image = new Image(width, height);for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel(camera, i, j);Intersection hit = FindIntersection(ray, scene);image[i][j] = GetColor(scene, ray, hit);}}return image;}Image RayCast(Camera camera, Scene scene, int width, int height){Image image = new Image(width, height);for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel(camera, i, j);Intersection hit = FindIntersection(ray, scene);image[i][j] = GetColor(scene, ray, hit);}}return image;}Without IlluminationRay CastingImage RayCast(Camera camera, Scene scene, int width, int height){Image image = new Image(width, height);for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel(camera, i, j);Intersection hit = FindIntersection(ray, scene);image[i][j] = GetColor(scene, ray, hit);}}return image;}Image RayCast(Camera camera, Scene scene, int width, int height){Image image = new Image(width, height);for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { Ray ray = ConstructRayThroughPixel(camera, i, j);Intersection hit = FindIntersection(ray, scene);image[i][j] = GetColor(scene, ray, hit);}}return image;}With IlluminationIllumination• How do we compute radiance for a sample ray?Angel Figure 6.2image[i][j] = GetColor(scene, ray, hit);Goal• Must derive computer models for ...o Emission at light sourceso Scattering at surfaceso Reception at the camera• Desirable features …o Conciseo Efficient to computeo “Accurate”2Overview• Direct Illuminationo Emission at light sourceso Scattering at surfaces• Global illuminationo Shadowso Refractionso Inter-object reflectionsDirect IlluminationModeling Light Sources•IL(x,y,z,θ,φ,λ) ... o describes the intensity of energy, o leaving a light source, …o arriving at location(x,y,z), ...o from direction (θ,φ), ...o with wavelength λ(x,y,z)LightEmpirical Models• Ideally measure irradiant energy for “all” situationso Too much storageo Difficult in practiceλOpenGL Light Source Models• Simple mathematical models:o Point lighto Directional lighto Spot lightPoint Light Source• Models omni-directional point sourceo intensity (I0), o position (px, py, pz), o factors (kc, kl, kq) for attenuation with distance (d)2qlc0kkkIddIL++=dLight(px, py, pz) Directional Light Source• Models point light source at infinityo intensity (I0), o direction (dx,dy,dz) 0IIL=(dx, dy, dz)No attenuationwith distance3Spot Light Source• Models point light source with directiono intensity (I0), o position (px, py, pz), o direction (dx, dy, dz)o attenuation2qlc0kkk)(IddLDIL++•=dLight(px, py, pz) DLγOverview• Direct Illuminationo Emission at light sourceso Scattering at surfaces• Global illuminationo Shadowso Refractionso Inter-object reflectionsDirect IlluminationModeling Surface Reflectance•Rs(θ,φ,γ,ψ,λ) ... o describes the amount of incident energy, o arriving from direction (θ,φ), ...o leaving in direction (γ,ψ), …o with wavelength λSurface(θ,φ)(ψ,λ)λEmpirical Models• Ideally measure radiant energy for “all” combinations of incident angles o Too much storageo Difficult in practiceSurface(θ,φ)(ψ,λ)λOpenGL Reflectance Model• Simple analytic model: o diffuse reflection +o specular reflection +o emission +o “ambient”SurfaceBased on modelproposed by PhongBased on modelproposed by PhongOpenGL Reflectance Model• Simple analytic model: o diffuse reflection +o specular reflection +o emission +o “ambient”SurfaceBased on Phong illumination modelBased on Phong illumination modelBased on modelproposed by PhongBased on modelproposed by Phong4Diffuse Reflection• Assume surface reflects equally in all directionso Examples: chalk, claySurfaceDiffuse Reflection• How much light is reflected?o Depends on angle of incident lightSurfaceθDiffuse Reflection• How much light is reflected?o Depends on angle of incident lightSurfacedLΘ= cosdAdLdAθDiffuse Reflection• Lambertian modelo cosine law (dot product)LDDILNKI )(•=SurfaceNLθOpenGL Reflectance Model• Simple analytic model: o diffuse reflection +o specular reflection +o emission +o “ambient”SurfaceSpecular Reflection• Reflection is strongest near mirror angleo Examples: mirrors, metalsNLRθθ5Specular ReflectionHow much light is seen?Depends on: o angle of incident lighto angle to viewerNLRVViewerαθθSpecular Reflection• Phong Modelo cos(α)nLnSSIRVKI )( •=NLRVViewerαθθThis is a physically-motivated hack!OpenGL Reflectance Model• Simple analytic model: o diffuse reflection +o specular reflection +o emission +o “ambient”SurfaceEmissionEmission ≠ 0Emission ≠ 0• Represents light eminating directly from polygonOpenGL Reflectance Model• Simple analytic model: o diffuse reflection +o specular reflection +o emission +o “ambient”SurfaceAmbient TermThis is a total hack (avoids complexity of global illumination)!• Represents reflection of all indirect illumination6OpenGL Reflectance Model• Simple analytic model: o diffuse reflection +o specular reflection +o emission +o “ambient”SurfaceOpenGL Reflectance Model• Simple analytic model: o diffuse reflection +o specular reflection +o emission +o “ambient”SurfaceOpenGL Reflectance Model• Sum diffuse, specular, emission, and ambientLeonard McMillan, MITSurface Illumination Calculation• Single light source:LnSLDALAEIRVKILNKIKII )()( •+•++=NLRVViewerαθθSurface Illumination Calculation• Multiple light sources:))()((∑•+•++=iiniSiiDALAEIRVKILNKIKIINL2VViewerL1Overview• Direct Illuminationo Emission at light


View Full Document

Princeton COS 426 - Illumination

Documents in this Course
Lecture

Lecture

35 pages

Lecture

Lecture

80 pages

Boids

Boids

25 pages

Exam 1

Exam 1

9 pages

Curves

Curves

4 pages

Lecture

Lecture

83 pages

Load more
Download Illumination
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Illumination and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Illumination 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?