Search Keywords:spherical, harmonics, GI, baking



Spherical Harmonics Baking

Spherical Harmonics Rendering




In this tutorial we will show how to use the V-Ray Spherical Harmonics tools for lighting a simple scene.


The first part of this tutorial is related to baking the SH in files, while the second part is dedicated to the interpretation of these files by Spherical Harmonics GI engine.

For complete information on parameters meanings see Spherical Harmonics Baking Engine and Spherical Harmonics GI Engine.


Maya starting scene can be found here. Required version Maya 2009 or higher.


Spherical Harmonics Baking

1. Set V-Ray as the current rendering engine.


2. Model the scene paying additional attention to the fine and uniform subdivision of the geometry.



3. Assign materials.


4. In Render Settings, in VRay Common tab go to Image File Output and set Baking engine to Spherical harmonics. This will enable Spherical harmonics options button.



5. Hit Spherical harmonics options button to call Spherical Harmonics Baking Engine options window.


6. Set options:


6.1 Fill in File name or click on Browse button to select location for the output file. (If File name field is empty, default path will be used.)


6.2 Set Format to *.vrsh. (*.xml file format is designed to be parsed by foreign applications.)


6.3 Set Mode to Interreflection (all). (You could set also Occlusion (all), but Occlusion (selected object) and Interreflection (selected object) cannot be rendered by V-Ray. These modes are designed for foreign applications.)


6.4 Set Distribute to per Normal. (If we choose per Vertex the baking engine will calculate only one SH per vertex and this will smooth our sharp edges. per Normal is the predominant setting in the majority of situations.)


6.5 Set Ray bias to 0.0001.


6.6 Set Bands to 7.


6.7 Set Subdivs to 70.


6.8 Set Bounces to 2.


6.9 Enable Use hit recording.


7. Hit Render button and wait until SH are calculated.


Spherical Harmonics Rendering

1. In Render Settings, in VRay Common tab go to Image File Output and set Baking engine to None.


2. In Render Settings, in Indirect Illumination tab check On option, set Primary bounces Engine to Spherical Harmonics and Secondary bounces Engine to None. Spherical Harmonics GI rollout will appear.


3. Set parameters in Spherical Harmonics GI rollout:


3.1 In Basic parameters select the *.vrsh file in File name field. Precalc light per frame parameter has meaning only when rendering animation with changing lighting, so it's value doesn't matter for this tutorial.


3.2 In Sample environment check On option and set Subdivs to 8. We'll use just a few samples to sample the environment, because in this example we'll use plain white color for environment. In scenes with complex environment textures we should use far more samples to approximate the lighting.


3.3 In VRay tab, in Environment rollout turn on Override Environment and put white color in Background texture.


3.4 Turn off Apply filtering for now.


3.5 Hit Render button!



3.6 Now turn off Sample environment and add a Maya Directional Light to the scene.


3.7 Render some images with different light positions. The color bleeding and the shadows are computed from the precomputed spherical harmonics without additional calculations.


Intensity = 1.0
Intensity = 2.95


3.8 You may notice ringing artefacts in object shadows in the images above. To soften them turn on the Apply filtering option and play with the Filter Strength parameter to balance between ringing and blurring.


Filter Strength = 0.0
Filter Strength = 0.6
Filter Strength = 1.0


3.9 Combine environment lighting with directional lights and experiment!