Digital Image Synthesis Yung-Yu Chuang

Slides:



Advertisements
Similar presentations
Retrospect Digital Image Synthesis Yu-Ting Wu. So far we have learned: Geometry and transforms Shapes Accelerators Color and radiometry Cameras Sampling.
Advertisements

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.
Photon Tracing with Arbitrary Materials Patrick Yau.
Texture Turk, 91.
© 2005 University of Wisconsin
Digital Image Synthesis Yung-Yu Chuang
Surface Integrators Digital Image Synthesis Yung-Yu Chuang with slides by Peter Shirley, Pat Hanrahan, Henrik Jensen, Mario Costa Sousa and Torsten Moller.
Computer Graphics Inf4/MSc Computer Graphics Lecture 7 Texture Mapping, Bump-mapping, Transparency.
01/24/05© 2005 University of Wisconsin Last Time Raytracing and PBRT Structure Radiometric quantities.
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.
02/25/05© 2005 University of Wisconsin Last Time Meshing Volume Scattering Radiometry (Adsorption and Emission)
Monte Carlo Integration II Digital Image Synthesis Yung-Yu Chuang with slides by Pat Hanrahan and Torsten Moller.
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.
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.
Jaroslav Křivánek, MFF UK
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
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.
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.
CIS 681 Distributed Ray Tracing. CIS 681 Anti-Aliasing Graphics as signal processing –Scene description: continuous signal –Sample –digital representation.
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
Metropolis light transport
Digital Image Synthesis Yung-Yu Chuang 11/16/2006
© 2003 University of Wisconsin
Volume and Participating Media
Monte Carlo Integration II
Path Tracing (some material from University of Wisconsin)
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
Distributed Ray Tracing
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
Lesson 9: Basic Monte Carlo integration
A Practical Model for Subsurface Light Transport
Digital Image Synthesis Yung-Yu Chuang 12/6/2007
Monte Carlo Path Tracing and Caching Illumination
Photon Density Estimation using Multiple Importance Sampling
Presentation transcript:

Digital Image Synthesis Yung-Yu Chuang Lights Digital Image Synthesis Yung-Yu Chuang with slides by Stephen Chenney

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, float pEpsilon, LightSample &ls, float time, Vector *wi, float *pdf, 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, …) { *wi = Normalize(lightPos - p); *pdf = 1.f; visibility->SetSegment(p,pEpsilon,lightPos,0,time); 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, …) { *wi = Normalize(lightPos - p); *pdf = 1.f; visibility->SetSegment(p,pEpsilon,lightPos,0,time); 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, …) { *wi = Normalize(lightPos - p); *pdf = 1.f; visibility->SetSegment(p,pEpsilon,lightPos,0,time); 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 == NULL) ? 1.f : Spectrum(mipmap->Lookup(s,t,SPECTRUM_ILLUMINANT)); } Spectrum Power(const Scene *) const { return 4.f * M_PI * Intensity * Spectrum(mipmap ? mipmap->Lookup(.5f, .5f, .5f) : 1.f, SPECTRUM_ILLUMINANT);}

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, …) const { wi = lightDir; *pdf = 1.f; visibility->SetSegment(p,pEpsilon,lightPos,0,time); return L;

Directional lights Spectrum Power(const Scene *scene) { Point worldCenter; float worldRadius; scene->WorldBound().BoundingSphere(&worldCenter, &worldRadius); return L * M_PI * worldRadius * worldRadius; }

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 (chap14).

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

Infinite area light (environment light) midday skylight sunset skylight

Infinite area light InfiniteAreaLight(Transform &light2world,Spectrum &L, int ns, string &texmap) : Light(light2world, ns) { <read texel data from texmap> <initialize sampling PDFs from infinite area light> } Sample_L and <initialize sampling PDFs …> will be discussed after introducing Monte Carlo method

Infinite area light Spectrum InfiniteAreaLight::Power(const Scene *scene) { Point worldCenter; float worldRadius; scene->WorldBound().BoundingSphere(&worldCenter, &worldRadius); return M_PI * worldRadius * worldRadius * Spectrum(radianceMap->Lookup(.5f,.5f,.5f),…); } Spectrum Le(const RayDifferential &r) { Vector wh = Normalize(WorldToLight(r.d)); float s = SphericalPhi(wh) * INV_TWOPI; float t = SphericalTheta(wh) * INV_PI; return Spectrum(radianceMap->Lookup(s, t), SPECTRUM_ILLUMINANT); for those rays which miss the scene