Digital Image Synthesis Yung-Yu Chuang 12/6/2007

Slides:



Advertisements
Similar presentations
Week 9 - Monday.  What did we talk about last time?  BRDFs  Texture mapping and bump mapping in shaders.
Advertisements

Light Visible electromagnetic radiation Power spectrum Polarization Photon (quantum effects) Wave (interference, diffraction) From London and Upton.
Computer graphics & visualization Pre-Computed Radiance Transfer PRT.
Illumination Model How to compute color to represent a scene As in taking a photo in real life: – Camera – Lighting – Object Geometry Material Illumination.
UFCEKT-20-33D Modelling and Animation 3D Modelling & Animation Lighting.
Texture Turk, 91.
Photometric Stereo & Shape from Shading
Digital Image Synthesis Yung-Yu Chuang
CS348B Lecture 4Pat Hanrahan, 2005 Light Visible electromagnetic radiation Power spectrum Polarization Photon (quantum effects) Wave (interference, diffraction)
Computer Graphics Inf4/MSc Computer Graphics Lecture 7 Texture Mapping, Bump-mapping, Transparency.
Geometry and Transformations Digital Image Synthesis Yung-Yu Chuang 9/28/2006 with slides by Pat Hanrahan.
Surface Integrators Digital Image Synthesis Yung-Yu Chuang with slides by Peter Shirley, Pat Hanrahan, Henrik Jensen, Mario Costa Sousa and Torsten Moller.
Monte Carlo Integration II Digital Image Synthesis Yung-Yu Chuang with slides by Pat Hanrahan and Torsten Moller.
Film Digital Image Synthesis Yung-Yu Chuang 11/5/2008 with slides by Pat Hanrahan and Matt Pharr.
Texture Digital Image Synthesis Yung-Yu Chuang 11/15/2005 with slides by Pat Hanrahan and Mario Costa Sousa.
Real-Time Relighting Digital Image Synthesis Yung-Yu Chuang 1/10/2008 with slides by Ravi Ramamoorthi, Robin Green and Milos Hasan.
Textures Repeated patterns Texture can be uniform or irregular Ex:fabric,soil,brick Surface finish also known as surface texture T = P 1 * V 1 * V c T=
Digital Image Synthesis Yung-Yu Chuang
Materials Digital Image Synthesis Yung-Yu Chuang 11/19/2008 with slides by Robin Chen.
Shapes Digital Image Synthesis Yung-Yu Chuang with slides by Pat Hanrahan.
Announcements Office hours today 2:30-3:30 Graded midterms will be returned at the end of the class.
Reflection models Digital Image Synthesis Yung-Yu Chuang 11/01/2005 with slides by Pat Hanrahan and Matt Pharr.
XNA Basic Displaying Image & Collision Detect. What’s format image that XNA support? XNA support only.bmp.png and.jpg image..PNG have transparent region.
Reflection models Digital Image Synthesis Yung-Yu Chuang 11/22/2007 with slides by Pat Hanrahan and Matt Pharr.
Shapes Digital Image Synthesis Yung-Yu Chuang 10/05/2006 with slides by Pat Hanrahan.
Jaroslav Křivánek, MFF UK
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Illumination Model How to compute color to represent a scene As in taking a photo in real life: – Camera – Lighting – Object Geometry Material Illumination.
Materials Digital Image Synthesis Yung-Yu Chuang 11/08/2005 with slides by Robin Chen.
Volume and Participating Media Digital Image Synthesis Yung-Yu Chuang 12/21/2006 with slides by Pat Hanrahan and Torsten Moller.
Go Back > Question 1 Describe this transformation. A reflection in the line y = x. ? Object Image.
The idea (in 2D) texture index position from visible position (float) Geometry positions that corresponds to integer texel positions Change surface position.
Color and Radiometry Digital Image Synthesis Yung-Yu Chuang 10/25/2007 with slides by Pat Hanrahan and Matt Pharr.
Cameras Digital Image Synthesis Yung-Yu Chuang 11/01/2005 with slides by Pat Hanrahan and Matt Pharr.
Monte Carlo Integration II Digital Image Synthesis Yung-Yu Chuang with slides by Pat Hanrahan and Torsten Moller.
A Practical Analytic Single Scattering Model for Real Time Rendering
- photometric aspects of image formation gray level images
Digital Image Synthesis Yung-Yu Chuang 10/8/2009
Digital Image Synthesis Yung-Yu Chuang 11/16/2006
Monte Carlo Integration
Digital Image Synthesis Yung-Yu Chuang 12/24/2008
Real-time environment map lighting

Digital Image Synthesis Yung-Yu Chuang
Metropolis light transport
Digital Image Synthesis Yung-Yu Chuang 11/16/2006
Volume and Participating Media
Previous lecture Reflectance I BRDF, BTDF, BSDF Ideal specular model
null, true, and false are also reserved.
Monte Carlo Integration II
Monte Carlo Integration II
Illumination Model How to compute color to represent a scene
Digital Image Synthesis Yung-Yu Chuang 10/4/2005
Homework #3 Environment Lights
Digital Image Synthesis Yung-Yu Chuang 9/27/2005
Digital Image Synthesis Yung-Yu Chuang 11/01/2005
Digital Image Synthesis Yung-Yu Chuang 10/19/2006
Digital Image Synthesis Yung-Yu Chuang 9/28/2006
Digital Image Synthesis Yung-Yu Chuang 10/22/2009
Geometry and Transformations
Geometry and Transformations
Digital Image Synthesis Yung-Yu Chuang 12/3/2008
Digital Image Synthesis Yung-Yu Chuang 11/30/2006
Geometry and Transformations
Game Programming Algorithms and Techniques
Digital Image Synthesis Yung-Yu Chuang 9/24/2009
Digital Image Synthesis Yung-Yu Chuang 10/04/2007
Digital Image Synthesis Yung-Yu Chuang 11/8/2007
Jaroslav Křivánek, MFF UK
Monte Carlo Path Tracing and Caching Illumination
Presentation transcript:

Digital Image Synthesis Yung-Yu Chuang 12/6/2007 Lights Digital Image Synthesis Yung-Yu Chuang 12/6/2007 with slides by Stephen Chenney

Lights An abstract interface for lights. Pbrt only supports physically-based lights, not including artistic lighting. core/light.* lights/* Essential data members: Transform LightToWorld, WorldToLight; int nSamples; Essential functions: Spectrum Sample_L(Point &p, Vector *wi, VisibilityTester *vis); Spectrum Power(Scene *); bool IsDeltaLight(); wi p returns wi and radiance due to the light assuming visibility=1; initializes vis approximate total power point/directional lights can’t be sampled

Point lights Isotropic Located at the origin

Point lights PointLight::PointLight(const Transform &light2world, const Spectrum &intensity) : Light(light2world) { lightPos = LightToWorld(Point(0,0,0)); Intensity = intensity; } Spectrum PointLight::Sample_L(Point &p, Vector *wi, VisibilityTester *visibility) { *wi = Normalize(lightPos - p); visibility->SetSegment(p, lightPos); return Intensity / DistanceSquared(lightPos, p); Spectrum Power(const Scene *) const { return Intensity * 4.f * M_PI;

Spotlights (0,0,0) falloffStart totalWidth +z

Spotlights SpotLight::SpotLight(const Transform &light2world, const Spectrum &intensity, float width, float fall) : Light(light2world) { lightPos = LightToWorld(Point(0,0,0)); Intensity = intensity; cosTotalWidth = cosf(Radians(width)); cosFalloffStart = cosf(Radians(fall)); } Spectrum SpotLight::Sample_L(Point &p, Vector *wi, VisibilityTester *visibility) { *wi = Normalize(lightPos - p); visibility->SetSegment(p, lightPos); return Intensity * Falloff(-*wi) /DistanceSquared(lightPos,p);

Spotlights float SpotLight::Falloff(const Vector &w) const { Vector wl = Normalize(WorldToLight(w)); float costheta = wl.z; if (costheta < cosTotalWidth) return 0.; if (costheta > cosFalloffStart) return 1.; float delta = (costheta - cosTotalWidth) / (cosFalloffStart - cosTotalWidth); return delta*delta*delta*delta; } Spectrum Power(const Scene *) const { return Intensity * 2.f * M_PI * (1.f - .5f * (cosFalloffStart + cosTotalWidth)); an approximation

Texture projection lights Like a slide projector y (0,0) fov p z p’ x

Goniophotometric light Define a angular distribution from a point light

Goniophotometric light GonioPhotometricLight(const Transform &light2world, Spectrum &I, string &texname):Light(light2world) { lightPos = LightToWorld(Point(0,0,0)); Intensity = I; int w, h; Spectrum *texels = ReadImage(texname, &w, &h); if (texels) { mipmap = new MIPMap<Spectrum>(w, h, texels); delete[] texels; } else mipmap = NULL; Spectrum Sample_L(const Point &p, Vector *wi, VisibilityTester *visibility) const { *wi = Normalize(lightPos - p); visibility->SetSegment(p, lightPos); return Intensity * Scale(-*wi) / DistanceSquared(lightPos, p);

Goniophotometric light Spectrum Scale(const Vector &w) const { Vector wp = Normalize(WorldToLight(w)); swap(wp.y, wp.z); float theta = SphericalTheta(wp); float phi = SphericalPhi(wp); float s = phi * INV_TWOPI, t = theta * INV_PI; return mipmap ? mipmap->Lookup(s, t) : 1.f; } Spectrum Power(const Scene *) const { return 4.f * M_PI * Intensity * mipmap->Lookup(.5f, .5f, .5f);

Point lights The above four lights, point light, spotlight, texture light and goniophotometric light are essentially point lights with different energy distributions.

Directional lights DistantLight::DistantLight(Transform &light2world, Spectrum &radiance, Vector &dir):Light(light2world) { lightDir = Normalize(LightToWorld(dir)); L = radiance; } Spectrum DistantLight::Sample_L(Point &p, Vector *wi, VisibilityTester *visibility) const { wi = lightDir; visibility->SetRay(p, *wi); return L; Spectrum Power(const Scene *scene) { Point wldC; float wldR; scene->WorldBound().BoundingSphere(&wldC, &wldR); return L * M_PI * wldR * wldR;

Area light Defined by a shape Uniform over the surface Single-sided Sample_L isn’t straightforward because a point could have contributions from multiple directions (chap15).

Infinite area light morning skylight area light+distant light environment light

Infinite area light midday skylight sunset skylight

Infinite area light InfiniteAreaLight(Transform &light2world,Spectrum &L, int ns, string &texmap) : Light(light2world, ns) { radianceMap = NULL; if (texmap != "") { int w, h; Spectrum *texels = ReadImage(texmap, &w, &h); if (texels) radianceMap = new MIPMap<Spectrum>(w, h, texels); delete[] texels; } Lbase = L; Spectrum Power(const Scene *scene) const { Point wldC; float wldR; scene->WorldBound().BoundingSphere(&wldC, &wldR); return Lbase * radianceMap->Lookup(.5f, .5f, .5f) * M_PI * wldR * wldR;

Infinite area light Spectrum Le(const RayDifferential &r) { Vector w = r.d; Spectrum L = Lbase; if (radianceMap != NULL) { Vector wh = Normalize(WorldToLight(w)); float s = SphericalPhi(wh) * INV_TWOPI; float t = SphericalTheta(wh) * INV_PI; L *= radianceMap->Lookup(s, t); } return L; for those rays which miss the scene