View Full Version : Lighting with Spherical Harmonics
Youpi 11-16-2008, 09:08 AM Hello
Here is a tutorial I made to show how to use Spherical Harmonics in XSI for HDR Image Based Lighting.
Spherical Harmonics offer a result close to Final Gather and the render time is often really faster.
When merged in a same pass with Ambient Occlusion, you can have Final Gather look for less than 2 seconds more on AO render time.
Link is here : Image Based Lighting with Spherical Harmonics (http://immerg.com/index.php?option=com_content&task=view&id=346&Itemid=44)
http://immerg.com/images/stories/tuto/IBLSHAO002.1R.jpg (http://immerg.com/index.php?option=com_content&task=view&id=346&Itemid=44)
If you have any question about this tutorial, just ask me !
Have a nice IBL day !
|
|
popol
11-16-2008, 12:16 PM
merci :thumbsup: youpi
DimensionalPunk
11-16-2008, 10:17 PM
How does it look when animated? Is there the same scintillation flickering that FG gives us?
Jozvex
11-17-2008, 07:07 AM
There shouldn't be any flicker no, because there's no interpolation or 'view based' sampling that changes from frame to frame, the shader simply looks at the environment map.
I personally wouldn't use the AO shadows alone unless the environment is quite uniformly lit, because the AO shadows aren't being influenced by the environment shader at all (unless I'm mistaken). I'd probably use the Spherical Harmonics for the ambience and then just regular area light shadows placed roughly in the right places.
There are so many techniques we can mix and match these days, it's great!
Nice tutorial by the way!
:thumbsup:
MDuffy
11-17-2008, 10:44 AM
That's a nice tutorial, Youpi. Thanks for posting it! But it doesn't really use spherical harmonics as I understand them to be used in IBL. The Picturenaut plugin might be using a few levels of Spherical Harmonics to blur the image, but the result isn't all that different from doing say a gaussian blur on the image. The resulting image gives you one level of blur, which you then do a single-sample reflection map on to get your ambient light value. Full Spherical Harmonic use allows you to vary the blur of the image based on how many levels of harmonics deep you go, which is useful when the reflectivity/specularity of an object varies across its surface (or varies from object to object).
The tutorial is good, don't get me wrong. :-) i just wanted to clarify on the Spherical Harmonic part.
Cheers,
Michael Duffy
earlyworm
11-17-2008, 12:31 PM
That's a nice tutorial, Youpi. Thanks for posting it! But it doesn't really use spherical harmonics as I understand them to be used in IBL.
Yeah my understanding of SH lighting is slightly different to that of the tutorial. Still good tutorial, and thanks for the subtitles.
http://portal.acm.org/citation.cfm?id=581934
http://portal.acm.org/citation.cfm?id=1141982
ConcreteDonkey
11-18-2008, 09:03 AM
Sounds nice , I'll try it with a light rig generated from the same hdri... it's generally the same idea as Jozvex said , I'm just lazyer :D
Jozvex
11-18-2008, 09:15 AM
Oh don't worry I'm lazy too, I just didn't admit to it! :)
Youpi
11-18-2008, 10:05 PM
Hello !
Thank you for your comments.
DimensionalPunk : if the AO samples is too low, you’ll have some scintillation flickering. Not the same as FG, but scintillation indeed.
Jozvex : Thank you ! Using it just as ambient is nice and can be done in Ambient Only light in Renderman or Maya or 3DSMax, but not in XSI… I agree with you that AO shadows are good for contact light, but are not enough.
MDuffy : Real Spherical Harmonics are much more complex than Diffuse Irradiance Integration as ‘diffuse SH’ is doing. And I don’t know any way to use real multilevel SH with Mental Ray.
Indeed, diffuse_SH is not just blurring things, it makes an Integration of Irradiance on a sphere, which return a 360°x180° map. It’s just the same as a standard Phong shader.
I could use Rendermap or lightmap on a sphere to generate the map instead of diffuse_SH. But diffuse_SH is really faster !
Earlyworm : thank you for the links. Very useful. And yes again, diffuse _SH is doing the smallest part of SH.
About how much faster than FG it is… Nice question !
The exemple scene is 1 million polygons.
The IBL only pass is fast (about 20 seconds on tutorial exemple),
The AO+IBL pass is just 2 second slower than just AO (40 seconds AOIBL and 38 seconds without IBL).
The FG past is 42 seconds.
As you can see, the difference is not that big.
If you already have a AO pass, transforming it in AOIBL is cheap.
But doing an AO pass and an IBL pass is slower than a FG pass on my example. I think you should try and see rendering time according to your scene and render size.
I’ve also tried this technique of IBL with 3DSMax also, if you are interested in a 3DSMax version of this tutorial, just ask me !
hotknife
11-19-2008, 12:48 PM
I'd be interested in a 3ds Max Tutorial....any chance of stretching it to english.(sorry) I'm still working on my french.
Merci.
I'm not sure this really belongs in News so I moved it to Lighting and Shaders.
I'm not up to par on Spherical Harmonics (from what I gather it's an algorithm to downsample data over multiple levels?) but it looks like the tutorial basically looks up a blurred environment map and multiplies this with colour and ambient occlusion?
This way of lighting has been around a while (I think I picked up the technique from some tutorial I read 6-7 years ago?) so I'm wondering if the difference is that SH is a way of getting more fidelity out of the environment map?
Or I may totally be missing the point in this and not seeing the cool part which could speed up my renders x2? :)
Wiro
Youpi
11-20-2008, 08:45 PM
Hello !
Thank you for your interest in a 3DSMax Tutorial. I’ll try to record it soon. (unfortunately, in French with English subtitle also… ) :argh:
Wiro : Thanks for moving it. I didn’t expect so many reaction about the technique itself. So 'lighting' is a better place !
Yes, this way of lighting is not new. Paul Debevec even told about it at Siggraph this year.
In fact, I didn’t find an elegant and fast way to use it in XSI / Mental Ray until I found the ‘Diffuse SH’ HDRShop plugin and the AO way. So I made this little tutorial to show it.
About render time. It’s nice when you have an IBL (FG or other) and an Ambient Occlusion. Then, you can mix the two in a same pass and loose just few seconds instead of another full pass render time.
But, if you want separate passes for IBL and AO, it depends strongly of your scene. I’ve try it on some old scenes, and when FG has less than 50 rays, FG is faster.
About blurred vs Diffuse SH : Diffuse SH makes a true Spherical Irradiance Integration (and, in fact, not a true Spherical Harmonic !). Blurred map is just … blurred map, if you try to map a blurred map on a sphere, you’ll see the difference, the biggest ones are map non continuity and the feeling of blurred reflection instead of lighted sphere.
Indeed, with some map, like a cloudy day at beach, the difference is not that big.
Thanks a lot for your comments !
I see, thanks for explaining it, I was genuinly interested in what the sperical harmonics part contributed to this techinique.
I didn't mean using an environment map as a reflection map though (i.e. camera dependant). That would indeed just make it look like a blurry reflection. Instead, like you said, it's about shooting a ray from the normal of the surface and reading the light value of that ray hitting the environment sphere.
The difference between the "old" method and the one you're describing is that the environment sphere in my case is textured by a simply blurred map and in your case by one "blurred" by spherical harmonics?
I'll have to do some tests when I got the time to see the difference in this. Thanks again for the explanation!
Wiro
CGTalk Moderation
11-21-2008, 02:44 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.