 |
Spherical Harmonics 1: A synthetic source of environmental lighting

Environmental Based Lighting is nothing new, Paul Debevec and his group at the UCLA Berkley came up with the concept several years ago and numerous tutorials have been written how to execute it in a number of packages.
The Problem with Environment based lighting is you are typically restricted to creating the lighting in the real world environment and then capturing this lighting before using it as a source for your synthetic scene. Which is great for compositing, but not as useful for motion graphics or completely CG scenes
Spherical Harmonics are a way of over coming this issue.
- Install Plugins
- Copy cgShaders.dlt to your ..\3dsmax6\plugins directory
- Copy cgShaders.mi to your 3dsmax6\mentalray\include directory
- Restart 3dsmax
- Create Spherical Harmonics Stack
- Open sample.max, create a default shader, with 100% self illunation and lock the ambient diffuse and specular colour together

- on the ambient swatch choose a spherical Harmonic stack, name this "Environmental Lights"
- click the Add button three times to add Spherical Harmonics Maps

- Create Key Light: Double Click the first Layer1, click the button set to top light, tick the check box named "Level Slider", and slide to a value of 0.5, set the Intensity multipler to 0.3 and then name the spherical Harmonic to "Key"

- Create Fill Light: Double Click the first Layer1, click the button set to top light, tick the check box named "Level Slider", and slide to a value of 0.5, set the Intensity multipler to 0.3 and then name the spherical Harmonic to "Fill"
- Create Rim Light: Double Click the first Layer1, click the button set to top light, tick the check box named "Level Slider", and slide to a value of 0.5, set the Intensity multipler to 0.3 and then name the spherical Harmonic to "Rim"
- Render your scene

- It will be a very bland overhead lighting rig, now we need to adjust the position and brightness of each of the lights
- Create Spherical Harmonics Mod for Viewport feedback
- In the top viewport create a Geosphere with at least 6 segments
- Add a "Sphere Mod" modifier

- Right click to Geosphere's properties to show Vertex colours and Shaded, and uncheck renderable check box, to ensure the geosphere isnt visible as it is only a gizmo

- Drag an instance of one of the Spherical Harmonics Maps (key,fill or rim) to the button labelled "Use Texmap", and tick the box "Plot Fx", you will see the lobes of the geosphere represent the colour and direction of your spherical harmonic light source, negative lobes are represnted in a black

- Adjust the rotation each of the Spherical Harmonics, watch the geosphere update
- Adjust the, rotation colour and Level slider of each of the Spherical Harmonics, watch the geosphere update
- Repeat for other two shaders steps 4-7
- Render repeat steps 4-8

- Adjust Lights with Realtime feedback using cgShaders Effect
- Open Effect dialog

- Add a cgShaders Effect
- Drag a copy of the "Environmental Lights" Spherical Harmonics Stack onto the map channel
- Check the box interactive, and click update
- Return to your material editor
- Repeat the adjustments to the orienation, level, intensity and colour of your key fill and rim Spherical Harmonics.
- See the updates in Real time

- Use a mapped Skylight as Illumination source for mental ray GI + Final Gather
- Copy the map Spherical Harmonics Stack named "Environmental Lights" to the Scene environment

- Apply a Default mental ray DGS shader to your Geometry in your Scene
- Create a skylight in the middle of your scene, ensuring that "Use scene environment" is checked for the skylight

- Open up the render scene dialog box, open the "Indirect Illumination" tab and check enable in Global Illunmination and enble in Final Gather

- Render the scene
- Adjust the Mulitplier for the skylight to above or below 1 to get exposure correct
- Adjust your default DGS materials

|
|
| http://www.cgcharacter.com/shareware |