Global Effects: Reflection, Refraction and Shadow
· 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
· 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
· 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
· 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
· 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
· 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)
· 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
· 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
· 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.
· 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
· 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
· 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