distributed area lighting
DESCRIPTION
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: - PowerPoint PPT PresentationTRANSCRIPT
Distributed Area LightingDistributed Area Lighting
Joon Jae LeeJoon Jae Lee
Keimyung UniversityKeimyung University
OverviewOverview
MotivationMotivation
Compact LightsCompact Lights
Distributed LightsDistributed Lights
General CaseGeneral Case
Light comes from all positions and Light comes from all positions and from all directionsfrom all directions
We need approximations in order to We need approximations in order to model in finite timemodel in finite time
Choices are:Choices are:Represent lighting envt as small number Represent lighting envt as small number of compact light sourcesof compact light sources
Model a real nature of light sourcesModel a real nature of light sources
Compact Lighting ModelCompact Lighting Model
Well known, understoodWell known, understood
Light characterized solely by direction Light characterized solely by direction vectorvector
Shadows have sharp edgesShadows have sharp edgesstencils, horizon maps, etc.stencils, horizon maps, etc.
ShadowingShadowing
Cast shadowsCast shadows
Self shadowingSelf shadowing
MotivationMotivation
Most common caseMost common case
everything is a secondary reflectoreverything is a secondary reflectorand therefore a light sourceand therefore a light source
Distributed Lighting ModelsDistributed Lighting Models
Environment MappingEnvironment Mapping
Specular—common, understoodSpecular—common, understoodblur somewhat for lower powerblur somewhat for lower power
Diffuse—less commonly usedDiffuse—less commonly useduse normal instead of reflection vectoruse normal instead of reflection vector
blur texture—prefilter to integrateblur texture—prefilter to integrate
Environment map typesEnvironment map types
CubeCube
LonLatLonLat
HemisphereHemisphere
ParaboloidParaboloid
Dual paraboloidDual paraboloid
Spherical HarmonicsSpherical Harmonics
etc.etc.
Hardware Environment MapsHardware Environment Maps
see Debevecsee Debevec
Facilitated by next generation Facilitated by next generation hardwarehardware
Model ElementsModel Elements
Sky Color
Final ColorFinal Color
Ground ColorGround Color
Hemisphere ModelHemisphere Model
Diffuse Envt Mapped BunnyDiffuse Envt Mapped Bunny
Diffuse Environment Mapped HeadDiffuse Environment Mapped Head
Distributed Light ModelDistributed Light Model
Hemisphere of possible incident light directions
Surface Normal
Microfacet Normal - defines axis of hemisphere
Procedural Environment MapsProcedural Environment Maps
Generate environment maps by:Generate environment maps by:
rendering into cube maprendering into cube mapif you have cube map hardware, okayif you have cube map hardware, okay
otherwise, use other methodotherwise, use other method
Rendering into other maps types is Rendering into other maps types is possible toopossible too
especially the the light sourcesespecially the the light sources
Procedural Hemisphere Map
Procedural Diffuse MapsProcedural Diffuse Maps
Hemisphere LightingHemisphere Lighting
Spherical Harmonic LightingSpherical Harmonic Lighting
Hemisphere LightingHemisphere Lighting
Simplest area light modelSimplest area light model
Fairly accurate model for sky/ground Fairly accurate model for sky/ground casecase
Somewhat generalizable to other Somewhat generalizable to other profilesprofiles
Building/canyon versionBuilding/canyon version
2-Hemisphere Model2-Hemisphere Model
Sky Color
Ground Color
Area Light ShadowsArea Light Shadows
Self occlusion not well representedSelf occlusion not well represented
Representation is a scalarRepresentation is a scalarAt each pointAt each point
Ray-trace to generateRay-trace to generate
Distributed Light ModelDistributed Light Model
Hemisphere of possible incident light directions
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 ModelRay Cast Occlusion Model
Microfacet
Some rays hit this object, others miss it
Occlusion RepresentationsOcclusion Representations
Can store result in various ways
Compute ratio of hits / missesOcclusion FactorA single scalar parameterShould weight with cosine
Use to blend in shadow color
Sufficient for hemisphere lighting
Model ElementsModel Elements
Sky Color
Final ColorFinal Color
Ground ColorGround Color
Object ColorObject Color Sphere Model
Occlusion Factor
Occlusion Factor AbsentOcclusion Factor Absent
Occlusion Factor PresentOcclusion Factor Present
Occlusion Factor AbsentOcclusion Factor Absent
Occlusion Factor PresentOcclusion Factor Present
Occlusion Factor AbsentOcclusion Factor Absent
Occlusion Factor Present
Lightwave Image
Hi-Res
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
Per Pixel Occlusion Factor
Pixel Occlusion
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 scalarput axis of cone (xyz) + cos cone angle in alphaThere are other representations
C. F. Heidrichs et al. “Ellipses”
Occlusion Cone ModelOcclusion Cone Model
Surface Normal
Fit cone to horizon between hits and misses
Ang
Axis
Occlusion Cone ShadowsOcclusion Cone Shadows
Each sample has a coneEach sample has a cone
Check to see if light ray is in itCheck to see if light ray is in itIf ( L dot Axis > cosAng )If ( L dot Axis > cosAng )
If so thenIf so thenIt is litIt is lit
ElseElseIt is in shadowIt is in shadow
Need not be BooleanNeed not be BooleanFor softer edged shadowsFor softer edged shadows
Horizon MapsHorizon Maps
Enable Per-Pixel shadowingEnable Per-Pixel shadowing
Also per-vertex for terrain enginesAlso per-vertex for terrain engines
Representation is a set of scalar Representation is a set of scalar samplessamples
1 for each direction1 for each direction
Cone is ~ octahedralCone is ~ octahedral
Standard Bump Map Standard Bump Map
Horizon Map ShadowsHorizon Map Shadows
Horizon Maps: Occlusion ConesHorizon Maps: Occlusion Cones
Horizon maps represent occlusion Horizon maps represent occlusion cones as 8-sided figurescones as 8-sided figures
Cone is parameterized as 8 valuesCone is parameterized as 8 valuesN, NE, E, SE, S, SW, W, NWN, NE, E, SE, S, SW, W, NW
Works fine for compact lightsWorks fine for compact lights
Scalar factor works for hemispheresScalar factor works for hemispheres
What about lights in between?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 Harmonics
Spherical Harmonic Environment MapsSpherical Harmonic Environment Maps
Represent environment map as set of Represent environment map as set of colors for each harmoniccolors for each harmonic
Very compact representationVery compact representation16 colors sufficient for diffuse16 colors sufficient for diffuse
Very efficient math to useVery efficient math to useJust multiply-adds or dot productsJust multiply-adds or dot products
Simple to generate procedurallySimple to generate procedurally
Easy to generate from image dataEasy to generate from image data
Buddha No Shadow
Environment + Scalar Occlusion
Procedural with No Shadow
Procedural with Occlusion
Spherical HarmonicSpherical Harmonic Surface Response Surface Response
What about occlusion/shadow terms?What about occlusion/shadow terms?
Representation is set of SH scalar Representation is set of SH scalar weightsweights
Store set at each pointStore set at each pointPixel or vertexPixel or vertex
Ray-trace to generateRay-trace to generateConvert to SH basisConvert to SH basis
Environment + Scalar Occlusion
Environment + Surf Response
Procedural with Occlusion
Procedural with Surface Response
Surface Response
Environment Map + Surface Response
Due to power of SH representation
Surface Response can include:Self-shadowingInter-reflection: glows, causticsSubsurface scattering
No Shadow
Shadow
Shadow + Inter-Reflection
Glossy No Shadow
Glossy Shadow
Combination TechniqueCombination Technique
Models diffuse environment lightingModels diffuse environment lightingLike Debevec’sLike Debevec’s
Can produce moving shadowsCan produce moving shadowsLike horizon mapsLike horizon maps
But for arbitrary light envtBut for arbitrary light envtNot just single point lightNot just single point light
Analog of cone shadow modelAnalog of cone shadow modelUses basis to decide if in cone or notUses basis to decide if in cone or not
Cool Techniques
Hemisphere LightingDiffuse soft lighting technique
Horizon MappingSelf-shadowing bump maps
Diffuse Environment MappingVery realistic diffuse lighting
Spherical Harmonic IlluminationDiffuse lighting + self-shadowing + inter-reflection + subsurface + …
References
Spherical Harmonic Environment Mapping work Ravi Ramamoorthi, Hanrahan
http://graphics.stanford.edu
Spherical Harmonic Illumination Sloan, Kautz, Snyder SIGGRAPH 2002
http://research.microsoft.com/~ppsloan