Recursive analytic spherical harmonics gradient for spherical lights

Pierre Mézières, Nicolas Mellado, Loïc Barthe, Mathias Paulin
Computer Graphics Forum, Wiley, 2022, 41(2).

Abstract: When rendering images using Spherical Harmonics (SH), the projection of a spherical function on the SH basis remains a computational challenge both for high-frequency functions and for emission functions from complex light sources. Recent works investigate efficient SH projection of the light field coming from polygonal and spherical lights. To further reduce the rendering time, instead of computing the SH coefficients at each vertex of a mesh or at each fragment on an image, it has been shown, for polygonal area light, that computing both the SH coefficients and their spatial gradients on a grid covering the scene allows the efficient and accurate interpolation of these coefficients at each shaded point. In this paper, we develop analytical recursive formulae to compute the spatial gradients of SH coefficients for spherical light. This requires the efficient computation of the spatial gradients of the SH basis function that we also derive. Compared to existing method for polygonal light, our method is faster, requires less memory and scales better with respect to the SH band limit. We also show how to approximate polygonal lights using spherical lights to benefit from our derivations. To demonstrate the effectiveness of our proposal, we integrate our algorithm in a shading system able to render fully dynamic scenes with several hundreds of spherical lights in real time.

This fully dynamic scene is rendered at 77 fps with 1793 lights in an image of resolution 1920×1080. This is achieved by introducing new analytic formulae that efficiently computes the spherical harmonics (SH) gradients for lighting with uniform spherical lights. We integrate our new computations in a SH based rendering system able to compute the lighting from several hundreds of light sources in real time. This rendering system first computes the SH coefficients and their gradients on a 3D grid, and then compute the shading at each visible point by interpolating the samples grid. Our formulae reduce the gradients computational cost and allow to: increase the frame rate, increase the number of SH bands, use more lights and/or increase the 3D grid resolution.

Acknowledgment: This project was partially funded by the CaLiTrOp project from French National Research Agency (ANR-16-CE33-0026).
Drone taken from Sketchfab. Horse taken from Sumner and Popovic. Perseverance taken from NASA/JPL-Caltech. Dragon, Armadillo and Buddha taken from Stanford 3D scanning repository. White room and conference taken from the McGuire Computer Graphics Archive. Suzanne taken from blender foundations. Fertility taken from visionair. Living room taken from BlendSwap.

Supp. mat.