Global Effects: Reflection, Refraction and Shadow

1        Simple Phong: A Local Illumination Model

·         Describes the illumination of the visible position, ONLY.

o    Primary visibility (what is visible from the eyes).

·         No consideration of relative visibility between objects in the scene

·         Cannot describe: Shadow, Reflection, Refraction

2        Secondary Visibility

·         Inter-object visibility

o    Secondary visibility: what are visible from a visible position!

·         Write this down:

o    This is the main shortcoming of hardware rendering (HLSL)

o    We will learn about this later

3        Extending Phong for “Global” Effects

·         Cause of  “Global effects”

o    Dominating: “mirror reflections”

o    More subtle: Diffuse inter-reflections (e.g., color bleeding)

·         Articulate how to simulate the process

·         Integrate into illumination model

·         Works for Raytracing, or any other ways of rendering

4        Reflection

·         Physical process:

o    light bounces

o    Reflectivity of materials

·         Raytrace simulation:  tracing reflection rays

o    Secondary rays, exactly as eye rays!

o    Recursive!

·         Phong illumination extended:

o    The new reflection term

5        Refraction

·         Identical to reflection

o    slightly more elaborate math with :RefractiveIndex and Transparency

·         Raytrace simulation: tracing refraction rays

o    Secondary rays: in the transmission direction!

·         Phong illumination extended:

o    The new refraction term

6        Shadow

·         Causes of shadow

o    Blockage between visible position and the light source

·         How much blockage?

o    Area of light source!

o    Umbra (hard) and Penumbra (soft)

7        Simulating/Computing Shadow

·         Compute visibility between light source and visible position

o    Tracing Shadow Rays

·         What kind of shadow? Umbra vs. Penumbra?

o    Point sampling, one sample per light

o    Fake soft shadow with a point light:

§  Approximate the point light with a sphere and trace multiple shadow rays

§  Aliasing in shadow vs. Noise in shadow

8        Modeling Shadow in Phong

·         The G-term: Geometric visibility before IL

o    Conditional (0 or 1) gives hard shadow

§  One shadow ray per light source

o    Fractional (Percentage) gives soft shadow

§  Many shadow rays per light source

·         Assumption

o    light source illuminates uniformly

9        Shadow Depth Map

·         The idea (will be mentioned again in hardware rendering portion of the lecture)

o    Light as Camera collecting what objects are visible from the light and how far

o    Before Render:

§  Compute DepthBuffer: a buffer recording what are visible from the light source

o    During render:

§  For each point to shade,

§  Check the DepthBuffer for potential shadow.

10  Pre-Render Depth Map Creation

·         Light Position: Camera position

o    What about directional lights?

·         Light Direction: Viewing Direction

o    What about point lights?

·         Light cone angle (for spot lights): camera FOV

o    What about point lights and directional lights?

·         Render to two images:

o    ID Buffer: collect visible object ID

o    Depth Buffer: collect distance of visible object

11  Using Depth Map During Rendering

·         For each point to be shaded

·         Consult the Depth Map

o    What is the object visible

o    What is the distance stored in the map

·         Soft Shadow simulation

o    Perform a simple average

12  Evaluating Depth Map

·         Advantage:

o    Cheaper, constant time shadow ray

o    Nice soft shadow boundaries that looks good

o    Works especially well for spotlight

·         Disadvantage:

o    Depth map resolution: unknown

o    Coverage, e.g., point light: needs up to 6 maps!

o    Accuracy: difficult to resolve distance if visible point is about same distance with another object from the light source

13  MP3