Return to the tutorials
Return to the scripting
HDR Shop Scripting - Fun with Spherical Harmonics
Spherical harmonics have many uses in comuter graphics from precomputed radiance transfer to data compression. While a detailed explanations of the math is beyond this tutorial, HDRShop provides some basic functions that handle most of the math for you. HDRShop can generate arbitrary spherical harmonics through he Create->Spherical Harmonics menu option.

This function can also be called from within an HDRShop script:
Image CreateSphericalHarmonic(M, L, width, height, format);
M and L represent the order of the desired harmonic, width and height represent the desired size of the destination image. format is the integer id of the the desired panoramic format. Once one can generate these spherical harmonic images, one can easily do simple operations such as spherical harmonic decomposition (factorSH.js) and diffuse convolution (sh_blur.js).
Return to the scripting
Return to the tutorials