Spherical Harmonics Baking Engine |
In computer graphics Spherical Harmonics (SH) are carriers of lighting information and they are used to light objects. This is done by first pre-calculating certain data in SH file and then interpreting this information during rendering. SH are useful in scenes with low frequency (slowly varying in space) lighting, favoring techniques like self occlusion, soft shadows and color bleeding. They are suitable for fly-through animations and animations with changing environment. A serious disadvantage is that they are restricted in dynamic scenes. The moving objects could receive self occlusion and self interreflection, but if they are to receive occlusion and interreflection from other objects, one have to pre-calculate SH for the whole scene per frame which is highly inefficient. In V-Ray SH are baked either per vertex or per normal. For round objects per vertex baking is suitable, but for objects with some sharp edges per normal baking is recommended. Per normal is the default distribution and it just needs smoothed normals for the round parts of the object. Another very important issue is that the user should pay additional attention when modeling the geometry. The models should be relatively finely and uniformly subdivided, due to the fact that the only known information is over vertices/normals. A great advantage is that the error of approximation is smooth and results in smooth image in contrast to the majority of the realistic image synthesis algorithms that produce noisy images.
File name - the name of the file in which the spherical harmonics data will be saved.
Format - this is the output file format. It could be *.xml for general purposes, V-Ray internal format *.vrsh designed to be used in "Spherical Harmoics" GI engine or both of them.
Mode - allows you to select between four different modes of operation.
Occlusion (selected object) - spherical harmonics will be exported only for the selected object. When exporting the spherical harmonics V-Ray will only consider direct light.
Occlusion(all) - spherical harmonics will be calculated for the whole scene. When exporting the spherical harmonics V-Ray will only consider direct light.
Interreflection(selected object) - spherical harmonics will be exported only for the selected object. In this mode V-Ray will also consider secondary bounces of light. It is similar to GI in terms that objects are illuminated by light that is being reflected from other objects.
Interreflection(all) - spherical harmonics will be exported for the whole scene. In this mode V-Ray will also consider secondary bounces of light. It is similar to GI in terms that objects are illuminated by light that is being reflected from other objects.
Transform - this option allows you to choose wether the spherical harmonics will be exported in World Space or in Object Space. It usually a good idea to export static geometry in World Space, and moving geometry in Object Space.
Distribute - spherical harmonics can be created either for each vertex of the geometry or for each normal, this option allows you to choose between those two modes. For round objects it is better to use per Vertex mode while for objects with large flat surfaces the per Normal mode is better and faster.
Ray bias - a small positive offset that will be applied when generating the spherical harmonics. This is needed to avoid some undesirable results when calculating the spherical harmonics in corners for example.
Bands - this option controls the accuarcy of the spherical harmonics. Larger values make the result closer to the actuall lighting but increases the render times. Smaller values are generated faster but less accurate. Usually values from 3-4 to 8-9 are used.
Subdivs - controls the number of samples taken in order to create the spherical harmonics. Higher values produce better results but take longer to render.
Bounces - this option is only available when one of the interreflection methods is selected. It controls the number of secondary bounces that are going to be traced.
Use hit recording - this option is only available when one of the interreflection methods is selected. Enabling it speeds up the calculations by storing a lot of information in the RAM.