Saturday 27 July 2013

Week Four

A full week, this week, which covered a broad range of topics.  This post will focus on lighting.

A lot of the lighting within 3D software is calculated using the same physics which governs the movement of light in the real world; however, I am not a physicist, nor is my teacher.  This post may be fatally flawed with regards to real physics.  I will be talking solely about the use and behaviour of light in the 3D world, not the real one.  That out of the way, lighting is a fascinating part of 3D.  It's complex and can be highly technical; the physical laws can be followed strictly, or disabled and ignored.

The first tool I'm going to write about is Final Gather, which is a render technique by which ambient light is added to a scene.  Ambient light is light which is not being emitted from a direct light source such as a light bulb: it is light which has bounced off walls, the floor, surfaces, or has been diffused by cloudy sky.


dif·fuse  [v. dih-fyooz; adj. dih-fyoos] 
1. to spread or scatter widely or thinly; disseminate. 

Both scenes below contain just one light, casting a shadow.  In the first render light is emitted, lands, and does nothing more.  In the second render Final Gather is enabled; the emitted light lands, bounces and does nothing more.  Maya uses the bouncing light rays to calculate how much ambient light is in a particular area, and subsequently how much ambient light (or how little shadow) there should be.  That's roughly how it works.


Direct light.

Direct light and ambient light.

Similar but very different is ambient occlusion which, to quote Wikipedia, "attempts to approximate the way light radiates in real life, especially off what are normally considered non-reflective surfaces".  In our context, ambient occlusion is a tool used to pick out fine detail on an object when rendering the final image.  The term ambient occlusion means - not too helpfully - the occlusion of ambient light.


An ambient occlusion render pass.

In the image above, there is no direct light.  Final Gather is not enabled.  Only Ambient Occlusion is being used to 'light' this scene.  The back of the typewriter contains a lot of fine detail - switches, dials, layers of casing - which are picked out cleanly and clearly by the ambient occlusion render.  That image can be composited over another render of the typewriter, lit with a direct light.  The Ambient Occlusion pass will help to pick out the fine detail.  It may be that an Ambient Occlusion pass is required on top of a Final Gather pass, but that will depend on the situation. 

As opposed to Final Gather which calculates how much light there should be in a scene, Ambient Occlusion emits 'shadow rays' from surfaces and based upon how far they travel calculates how much shadow there should be.  In the fine cracks of the typewriter the shadow rays travelled an extremely short distance and so there is a lot of shadow.  On the top of the typewriter the shadow rays travelled much further, so there is no shadow.  

In 3D ambient light is different from direct light.  The two are classed as two distinct parts of lighting and may be setup and controlled independently of each other.  In the real world ambient light is just there; in 3D it's an option.  Direct light, Final Gather and Ambient Occlusion can be used in conjunction to achieve the best results: direct light to light the scene, Final Gather to simulate ambient, bounced light and Ambient Occlusion to ensure the fine detail is not lost.  

On Monday we will be looking at non-linear workflows in lighting.  That is, setting up light in a real-world manner such that it decays in the same way light does.  That will probably get quite complicated but I'll write again if I understand it.  For homework, you can all look up the inverse square law.

No comments:

Post a Comment