230 likes | 361 Views
Rendering theory & practice. Introduction. We’ve looked at modelling, surfacing and animating. The final stage is rendering. This can be the most time consuming part of the process depending on the complexity of you scene. Many people underestimate the time needed But you won’t of course!.
E N D
Introduction • We’ve looked at modelling, surfacing and animating. • The final stage is rendering. • This can be the most time consuming part of the process depending on the complexity of you scene. • Many people underestimate the time needed But you won’t of course!
Some basic things to remember • Render to frame files rather than movie files • Use file formats that use no compression or loss-less compression • Use anti-aliasing (within reason) • Don’t raytrace if you can avoid it!
Simple shading • We’ve already considered this in the simplest sense: Flat, Gouraud and Phong shading • None of these consider inter-face reflections or shadows. • We need these for visual realism. • For these we need global illumination algorithms
Global illumination • This simulates the interaction of light with the entire environment rather than individual surfaces. • Light is tracked from emitters to sensors. • Shadows are automatically generated, as are interactions between surfaces. • There are two common approaches: ray tracing and radiosity • Before we look at these in detail, we should look at some general features of global illumination
Global illumination (2) • Ignoring the fact that the calculations (as we shall see later) are complex, the solution to global illumination is simple: • Start at a light source • Trace every light path through the environment it either: * hits the eye point * has its energy reduced below a threshold * travels out of the environment
A first attempt: the rendering equation • Describes what happens at point x on a surface due to light travelling from it where I(x,x’) is the transport intensity g(x, x') is the visibility function (x, x') transfer emittance (x, x', x'') is the scattering term
Another attempt: surface-surface interactions • We can also model the way one surface interacts with another • This is easier to consider non-mathematically • Four different interactions: diffuse to diffuse specular to diffuse diffuse to specular specular to specular
Mechanisms of light transport Diffuse to diffuse Specular to diffuse Diffuse to specular Specular to specular
Mechanisms of light transport (2) • Specular-specular transfer can be calculated using ray-tracing • Diffuse-diffuse transfer can be calculated using radiosity • Specular-diffuse and diffuse-specular need a combination • We can categorise the type of transfer so that we know how to handle a given situation
Categories of light transfer • Light-Diffuse-Diffuse-Eye (LDDE) • Light-Specular-Diffuse-Eye (LSDE) • Light-Diffuse-Specular-Eye (LDSE) • Light-Specular-Specular-Eye (LSSE) • …
Reflectedray Transmitted ray Reflectedray Initial ray Transmitted ray Initial ray Transmitted ray Reflected ray Ray tracing Eye
A classic ray-traced scene 1 2 3 5 4 6 7
3 6 4 7 1 5 2 1 2 3 5 4 6 7
Radiosity • This implements diffuse-diffuse transfer. • Instead of following individual rays, interaction between patches in a scene are considered. • This is different from other global illumination algorithms in two important ways: * the solution is view independent * the scene must be divided into patches
Radiosity (2) • Consider a light source as an array of emitting patches • Light is shot from these into the scene and we consider the diffuse-diffuse interaction between the light patch and the first hit patch • The energy arriving at the hit patch is then re-emitted according to the surface properties, hitting other patches… • This process iterates until there are no further significant changes in energy distribution
250 20 5000 Radiosity example