620 likes | 719 Views
Distributed Area Lighting. Joon Jae Lee Keimyung University. Overview. Motivation Compact Lights Distributed Lights. General Case. Light comes from all positions and from all directions We need approximations in order to model in finite time Choices are:
E N D
Distributed Area Lighting Joon Jae Lee Keimyung University
Overview • Motivation • Compact Lights • Distributed Lights
General Case • Light comes from all positions and from all directions • We need approximations in order to model in finite time • Choices are: • Represent lighting envt as small number of compact light sources • Model a real nature of light sources
Compact Lighting Model • Well known, understood • Light characterized solely by direction vector • Shadows have sharp edges • stencils, horizon maps, etc.
Shadowing • Cast shadows • Self shadowing
Motivation • Most common case • everything is a secondary reflector • and therefore a light source
Distributed Lighting Models • Environment Mapping • Specular—common, understood • blur somewhat for lower power • Diffuse—less commonly used • use normal instead of reflection vector • blur texture—prefilter to integrate
Environment map types • Cube • LonLat • Hemisphere • Paraboloid • Dual paraboloid • Spherical Harmonics • etc.
Hardware Environment Maps • see Debevec • Facilitated by next generation hardware
Model Elements Sky Color Ground Color Hemisphere Model Final Color
Distributed Light Model Hemisphere of possible incident light directions q Surface Normal Microfacet Normal - defines axis of hemisphere
Procedural Environment Maps • Generate environment maps by: • rendering into cube map • if you have cube map hardware, okay • otherwise, use other method • Rendering into other maps types is possible too • especially the the light sources
Procedural Diffuse Maps • Hemisphere Lighting • Spherical Harmonic Lighting
Hemisphere Lighting • Simplest area light model • Fairly accurate model for sky/ground case • Somewhat generalizable to other profiles • Building/canyon version
2-Hemisphere Model Sky Color q Ground Color
Area Light Shadows • Self occlusion not well represented • Representation is a scalar • At each point • Ray-trace to generate
Distributed Light Model Hemisphere of possible incident light directions q Microfacets Other facets can shadow this one: Occlusion
Approximating Occlusion • Need to determine extent of shadowing • Cast rays out from facet to see which ones intersect the object
Ray Cast Occlusion Model Microfacet Some rays hit this object, others miss it
Occlusion Representations • Can store result in various ways • Compute ratio of hits / misses • Occlusion Factor • A single scalar parameter • Should weight with cosine • Use to blend in shadow color • Sufficient for hemisphere lighting
Model Elements Sky Color Ground Color Object Color Sphere Model Occlusion Factor Final Color
Per Pixel Occlusion Factor • Estimate area based on adjacent pixels in height field • Should cast to all pixels in image • Should ray-cast bumps and pixels at the same time
Other Occlusion Methods • What if we need to produce sharp shadows? • e.g. to model effect of compact lights • Compute cone of visibility • = cone of unocclusion • Store as more than a scalar • put axis of cone (xyz) + cos cone angle in alpha • There are other representations • C. F. Heidrichs et al. “Ellipses”
Occlusion Cone Model Axis Ang Surface Normal Fit cone to horizon between hits and misses
Occlusion Cone Shadows • Each sample has a cone • Check to see if light ray is in it • If ( L dot Axis > cosAng ) • If so then • It is lit • Else • It is in shadow • Need not be Boolean • For softer edged shadows
Horizon Maps • Enable Per-Pixel shadowing • Also per-vertex for terrain engines • Representation is a set of scalar samples • 1 for each direction • Cone is ~ octahedral
Horizon Maps: Occlusion Cones • Horizon maps represent occlusion cones as 8-sided figures • Cone is parameterized as 8 values • N, NE, E, SE, S, SW, W, NW • Works fine for compact lights • Scalar factor works for hemispheres • What about lights in between?
Spherical Harmonics • Another way to parameterize information on a sphere • Analogous to Fourier Transforms, but over surface of a sphere
Spherical Harmonic Environment Maps • Represent environment map as set of colors for each harmonic • Very compact representation • 16 colors sufficient for diffuse • Very efficient math to use • Just multiply-adds or dot products • Simple to generate procedurally • Easy to generate from image data
Spherical Harmonic Surface Response • What about occlusion/shadow terms? • Representation is set of SH scalar weights • Store set at each point • Pixel or vertex • Ray-trace to generate • Convert to SH basis