1
\$\begingroup\$

What is the difference between Spherical Harmonics and Spherical Harmonics Lighting in OpenGL?

\$\endgroup\$
4
\$\begingroup\$

Spherical harmonics lighting use spherical harmonics to approximate a lighting lobe on an object.

It has property that make it cheap to compute in real time (dot product vs the normal) and to store (7floats per channels generally, for example in unity engine, but it vary based on the use, The movie avatar used spherical harmonics with 81floats per channel). However it's low frequency and don't handle specular well, so it is use mostly for diffuse representation (incoming radiance). It's a cheap and compressed representation for lights.

There is several uses:

1. To compute a lot of diffuse lights at a single object.

Because each light need a pass, it's cheaper to accumulate lights in a single spherical harmonic representation and apply it to objects. However this does not handle specular lighting, so you need passes for at each principal lights.

2. To store baked global illumination.

Spherical Harmonics can be blended linearly to quadrilinearly in a volume. It allow to store light in point of space then interpolate to find the light at objects position.

3. To store lightmap

Being able to be interpolate linearly makes spherical harmonics good candidate for lightmap intensity as you can store second order spherical harmonics (4 floats) in a regular rgba texture (could be stored at vertex value too). It works like above and allow to modify or move normal of a surface, or tesselate it, and retain the correct baked global illumination. Basically it allow to add correctly lit high frequencies for cheap.

4. More

It can be use to store better AO map, secondary bounce for radiosity, thickness map, smooth shadow casting (the last of us), time of day etc ...

Spherical harmonics is well documented at that point but all are very math heavy, I understand the overall idea, but I can't manipulate it because it's written in an opaque manner and the community was VERY unhelpful so far, pointing at document without clarifications. It mean that the entry level stays high unlike other aspect of learning shader (like physically based rendering).

So if you can find a competent mentor, cherish him!

http://www.research.scea.com/gdc2003/spherical-harmonic-lighting.pdf http://nccastaff.bournemouth.ac.uk/jmacey/MastersProjects/MSc11/Ravi/msc_thesis_ravi_acharya.pdf http://sebh-blog.blogspot.com/2010/04/spherical-harmonics-lighting.html https://dickyjim.wordpress.com/2013/09/04/spherical-harmonics-for-beginners/ http://ppsloan.org/publications/StupidSH36.pdf http://www.gamasutra.com/view/news/173409/Indepth_Photon_mapping_and_baking_light_maps.php http://sebastien.hillaire.free.fr/index.php?option=com_content&view=article&id=60&Itemid=71

\$\endgroup\$
1
\$\begingroup\$

Spherical harmonics is a general mathematical concept that can be applied to a number of problems. One of those problems is modeling the behavior of light for use in 3D rendering. There's not really a difference, just a scoping of the application. It's sort of like asking "What's the difference between Fourier Analysis and Fourier Analysis of Sound Signals?"

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.