1 / 16

Lighting & Shading

Lighting & Shading. Illumination. Without. Local. Global. Global Illumination. Interaction with matter Consider multiple reflections, transmission, shadows Rendering Equation :. BRDF. Local Illumination - Phong Lighting. General Idea:

roman
Download Presentation

Lighting & Shading

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lighting & Shading

  2. Illumination Without Local Global

  3. Global Illumination • Interaction with matter • Consider multiple reflections, transmission, shadows Rendering Equation: BRDF

  4. Local Illumination - Phong Lighting General Idea: • Consider only (non-area) light sources that are directly visible from the point on the objects surface without reflections. • Each point is illuminated independent of its “global” surroundings (except “self”-occlusion of light sources) • Idea: Approximate illumination by three additive components, representing ambient, diffuse and specular lighting.

  5. Local Illumination Ambient Lighting • Hack for replacing true global illumination (i.e. light bouncing off from other objects) • No direction • Incoming light component that is identical everywhere in the whole scenewhere • ka is the ambient material coefficient of reflection with0.0 <= ka <= 1.0 and • Ia is the intensity of the ambient light

  6. Local Illumination Diffuse Lighting • Rough material • Brightness ~ incoming Energy (Lambertian reflection) • Object scatters light into all directions equally • Heuristic reflection model but plausible for certain materials

  7. Local Illumination Diffuse Lighting Power per unit area arriving at point xdepends on the angle of the surface to the light direction (Johann Friedrich Lambert) N Iin J dA‘ J dA

  8. Local Illumination Diffuse Lighting • Rough material • Brightness ~ incoming Energy (Lambertian reflection) • Object scatters light into all directions equally • Heuristic reflection model but physically plausible for certainkd N L  Intersection Point

  9. Local Illumination SpecularLighting • Glossy/smooth material • Light is mostly reflected into the directions around the mirror direction RL of L Diffuse Glossy Specular

  10. Local Illumination SpecularLighting: The Phong model • Use cosine power as heuristic • Light is mostly reflected into the directions around the mirror direction RL of L (Rapid decay) • Perfect mirroring only in direction RL(perfect mirror: n  ) cosn a N RL eye L a V J J

  11. Local Illumination Careful! If a lightissituatedbehindtheobject (α > 90°) then cos(α) < 0.  Discard negative intensityvaluesbyclampingthedotproductsdottotherange [0,1] ! dot = max(0,dot) ka= 0.1 kd= 0.5 ks= 0.4 Phong Specular Ambient Diffuse

  12. Incorporatingcolor • So farwehaveonly dealt withIntensity: Onepossibleapproachtoincorporatecolor: • diffusely reflected light results from the reflection via multiple scattering events in the micro-scale geometry  reflected light is coloured by selective absorption by the surface i.e. a green surface absorbs all wavelengths except green • specularly reflected light interacts once with the surface and is thus not “coloured” by the surface i.e. the reflection of a light source remains the colour of the source

  13. Color of Material and Light Usuallywedefine Colors as 3 componentvectorC(r,g,b) ThereforethePhong model becomes: Cambglobal ambientlightingcolordefinedonce in thewholescene Cdiffdefined per material Cspecspecified per lightsource (Toincreaseflexibilitythespecularcolorcanadditionallybescaledby a colordefined per material)

  14. Graphics Pipeline (DirectX 10) IB Input Data VB Memory Input Assembler Buffer Resources: Stage (IA) Buffers, Textures, Constant Buffers Vertex Shader Texture, Constant Buffer Stage (VS) Geometry Shader Texture, Constant Buffer Stage (GS) Stream Output Buffer Stage (SO) Rasterizer Stage (RS) Texture, Constant Buffer Pixel Shader Stage (PS) States Output Merger Stage (OM) Output Data Buffer, Texture, Constant Buffer

  15. Shading: Flat vs. Gouraud vs. Phong PhongLighting Flat Shading PhongLighting GouraudShading PhongLighting PhongShading

  16. Shading: Gouraud vs. Phong GouraudShading PhongShading evaluateslighting per vertex evaluateslighting per fragment

More Related