Importons and Irradiance Particles


Hi there !

         mentalray 3.6+ comes with importons and irradiance particles.
         Here some tests and elucidations, eventually a geoshader to enable the new features.
         Importons are an implementation to compute importance-driven sampling maps.
         They can be used for importance-driven photon maps as a merging function for photons. 
         Ie, photons close to an importon will be saved to the map, those that are not, will be just discarded. This will lead to very light photon maps, but also very precise, because we just discard photons which have not a great impact on the final image, thus we have more photon density where we just need it (ok, photons are not really 'just' discarded.. when a photon is discarded its power is redistributed over nearby photons).
         To engage the Importons with photons, you have to set to zero the 'merge' parameter in the global.illumination part and to something non-zero the 'merge' parameter in the Importon rollout. This will tell mentalray to use Importons to merge photons, instead of a fixed merging distance (if non-zero the merge param in the gi rollout).
         Importons are shot in the importons phase, that happens before photon shooting. Importons are then discarded once the photon map is saved. In the verbosity you'll find how many photons are merged and how many are saved to the map. Importons shooting depend on the image size if you use the 'density' parameter, or can be shot arbitrary with an 'emitted' parameter.
         When using Importons together with photon maps, the 'traverse' parameter should be checked. In this mode Importons will not be blocked by object and will continue evaluating importance for any further intersection.
         The pratical way to use Importons is to shot a lot of photons. The problem with photons is not photon shooting but the photon map: access, balancing, storing and network sharing.
         Generally, on 32bit, when something more than 15milions of photons are stored in a map, we'll start having some problem. First the map could be around 200/300mb and more. Then mentalray will just crash before attemping to save the map, just by trying to optimize it before goto save. Now, why we're going to shot 15mil of photons. :)
         There're a couple of techniques, generally, to deal with  photons. 
         Have a low detail solution just to bring the overall light conditions and then get detail with a final gather pass.
         Have an high detail photon map to deal more accurately with light details and then have contact shadows and such with a final gather pass.
         Now, we have a third solution. 
         We can use photons together with Importons to have both an accurate light bouncing while achiving very minimal details.
         An example.
         Here I shot 5milions photons in a cornell box.
         Photon shooting is taking no more than 30 secs.
         I'm working on two dual-quads in a distributed env.
         Once the map is saved, it's size is around 102mb. That's just enough for my dbr rendering, as I have to wait the map broadcasting to the slave, and as the scene is very light, I will end up waiting for the slave to get its photon map when the master has already finished, ie. wasting of render time.
         Also the results, are those classic results we achive with photon maps. Ie. very poor details. Just look at the cube with its bottom part in dark, how is un-natural the shadowing there.
         Now, we can try with Importons. Full density. And a merging distance of 0.05 (cm, while photon radius is 1cm) and traverse enabled. 
         The photon map is now 3861kb.
         From the verbosity we can see how only around 200.000 photons are necesarry to cover the 'important' zones of our image. As the distribution of photon is importance based, we shot a lot of photons covering all the zones with a sufficent density so that when merged via importons we'll remain with enough photons to get out small details. Just take a look at the cube shadow, as was before without importons, and how it's now.
     (edited: as importons are used to merge photons and then discarded, only the photon map will be available. that means, one can use maya photon map visualizer to see photon distribution (with and without importons) directly in the viewport).:)
         Then, we can use Importons without photons and with the help of Irradiance Particles.
         Beside the fact you need a minimun amount of importons to get out a smooth image, the most important parameter here (before, with photons, was the merging, here it's discarded) is Trace Depth. We need to let bounce a lot our importons in the scene to have an importon map suitable for a complete walkthrough (for example). Start with density of 0.2 and go up. For Depth start with something 2. 
         Irradiance Particles.
         Let me attach a mentalimages description of this 'novel' technique:
         ' A short description of the technique may be given as follows: before rendering,
         importons are shot to the scene from the camera. Their hit positions with
         information on the amount of direct (and possibly indirect) illumination coming at
         their position (hence the name "irradiance particles") are combined into a map.
         Optionally, one or more passes of indirect illumination can be computed. The
         nature of the algorithm is that the computation is importance-driven. During
         rendering, Irradiance Particles are used to estimate the irradiance for every
         shading point; if only direct illumination is collected for irradiance particles, then
         this is equivalent to one bounce of indirect lighting. Irradiance can also be
         interpolated from precomputed values at particles' positions. '
         Parameters are close to those of finalgather.
         There's an amount of ray shot over the particle sample.
         There's a way to have the calculation interpolating over particle position (also only for secondary rays) and a mode where we're acting like in a brute force approach, where no interpolation is used.
         Passes means how many indirect bounces we'll consider when calculating the irradiance, ie, something like fg diffuse bounces.
         Eventually, if you have an environment, like a mr_sky, irradiance particles implementation will support a different set of sampling parameters to deal just with that.
         Here some images to demostrate the new feature.
         Only on the first image a full importon+irradianceparticles pre pass was shot. for all the others I just freezed the map and simply gone for rendering. The pre-pass took around 30mins. All the subsequent frames, around 3mins (1k).
         (importons density 0.5, depth4; irradianceparticles, 680rays, 2 passes, 32interp, 480envrays)
         Here, also an animation to see how Irradiance Particles are flicker free. 
         The solution is a medium detail solution. There're still some blotches on the parts in shadow. But this bloches are not flickering as they are not computed for every frame. (Banding comes with the web compression).
         Another feature that comes with mr3.6+ is an advanced framebuffer memory management. Indeed, the cached mode. When in cache mode you can render any image size (even on 32bit). In fact, if enabled, only a small fraction of the resulting image (or user framebuffers) is present in memory: newly rendered tiles and tiles recently accessed.
         This mode should be used only for batch rendering (it will crash maya if used for the render view.. also it does not make too much sense rendering big size images in a viewer). I just rendered a 20k image, in floating point, on a 32bit system. Slower than the others methods, it should be used only if mr is not able to create a framebuffer of a huge size (generally more than 4k images on 32bit).
RC   0.2  info : option: fb mem management cached
            RC   0.2  info : option: image	type	 interpolate
            RC   0.2  info :			 0	rgba_fp  yes
            RC   0.2  info : camera: focal length	  1.37795
            RC   0.2  info : camera: aperture		  1.41732
            RC   0.2  info : camera: aspect			0.8
            RC   0.2  info : camera: resolution		16000 20000
         A couple of things to use Importons and Irradiance Particles in Maya2008SP1.
         You should avoid any maya shader:
         'Suppress all Maya Shaders' should be checked. 'Export with Shading Engine' instead shouldn't be checked, in the shading engine node (tests were made with mia_material).
         The same goes for lights. 'Suppress all Maya Shaders' need to be checked, and a custom light shader should be supplied (mr sky portals work good).
         Finally, in the Rendering Settings, goto Translation->Customization and de-check the 'Export State Shader'.
        Eventually read the description file that comes with the geoshader for a more detailed description of paramters and such. 
 64bit version available (remove the .x64 postfix).
        Have fun,


some other images to showcase irradiance particles I posted on other threads or forums.

here a test in a more advanced situation.



all i can say is: thanx :bowdown:

this is a great new for all of us, thanx max and :buttrock:


Thanks for sharing :thumbsup:


ok, now with your hints the rendering seems much faster (especially with high IP values)
and i undestood what was the problem with the IP depth, there is a bug, if you use a depth by 1 and then try to use an higher depth maya crash

oh and the FB addon it’s just great :smiley:


This is what we have been waiting for. THANK YOU.


max for the animation you used the “traverse” option?
and another question, do you know why FG and IP have different “scale” values?

thanx again :slight_smile:



nope. the traverse option doesn’t work for ip, only for importons when used together with photons. it’s there to collect more importances from a single importon shot.

what ya mean by different scales ? different illuminance values ? yup, could be. physical correct results are generally +/-5%. so what ya see(as it’s tonemapped also) could be under that threshold, and both be physicall accurate. I’m testing ip with 3dsMaxDesign2009, lighting tools, to see how they can be compared.



there is a great difference (clearly over the 5%) when you use a physical sky
the FGmb solution have much more contrast and it’s really different

how are you using IP in Max? do you have a ctrl.ghost for max or what?


another note: IP is not working with Clip planes


an outdoor attempt to test env with mr sky.



here a test with a cornellbox

FG diffuse bounces 0, Rays 120, Density 0.1, Interp 32

IP depth 0, Rays 120, Importons 2000, Interp 32, Imp Depth 5

FG diffuse bounces 3, Rays 120, Density 0.1, Interp 32

IP depth 3, Rays 120, Importons 2000, Interp 32, Imp Depth 5

FG brute force, diffuse bounces 3, Rays 120
8m 25s

IP no interpolation, detp 3, Ryas 120, Importons 2000, Imp Depth 5
2m 49s

IP no interpolation, detp 3, Ryas 256, Importons 2000, Imp Depth 5
4m 51s


dagon, you’re ta test man !

I forgot about the build-in mr ambient occlusion cache.
you can enable that via the geoshader then use the mib_fast_occlusion (or ctrl.occlusion) when looking for a shader that takes advance on that.



thanx max :smiley:

i’ms still not completly satisfied by the IP interpolation, the non-interpolated looks very amazing, fast and good, but with interpolation there are too many options to play with (in my opinion) and it’s hard to find the best compromise quality/speed

IP depth 3, Rays 500, Importons 20000, Interp 32, Imp Depth 5
3m 14s

as you can see the quality is goob, but still not perfect
i think vray has an advantage, even with IP… i’m waiting for the new beta to make some comparison
i hope mental image can optimize a little bit more this very promising new GI engine

oh, and there is also some problems with the AO with color bleed, seems slower with IP

FG diffuse bounces 3, Rays 120, Density 0.1, Interp 32, AOcb
1m 14s

IP depth 3, Rays 120, Importons 2000, Interp 32, Imp Depth 5, AOcb
1m 33s

even more strange, with less bounces the render is slower :curious:
IP depth 0, Rays 120, Importons 2000, Interp 32, Imp Depth 5, AOcb
1m 58s


a test with GI/Importons

  • GI depth 4, photons 10.000.000, accuracy 5.000
    3m 30s

  • GI+Importons depth 4, photons 10.000.000, accuracy 800, importons 20.000
    2m 12s


Excellent! Great work Max and great testing Dagon!

How exciting, more stuff to play with. :drool:


Good, keep testing!


thanks a great job.

i always got a crash if i use IP. only if i use IP with FG maya don’t crash.

i have a dual quad core with vista 64, any idea??

thankx again


I haven’t got any crash so far.

Roberto, did you avoid any maya shader ?
When using FG, you’re just using FG, IP will be disabled.


If you have GI enabled, Importons and IP. Only Importons(together with photons) will be used (if a merge is specified for the importons param, while set to 0 for the gi photons param) and IP will be disabled.
If you have GI and FG enabled. Same as above.
If you have FG only enabled. Both Importons and IP will be disabled.

that ends to these workflows:

  • photons only
  • finalgather only
  • photons + finalgather
  • importons + photons
  • importons + photons + finalgather (cool here is to use the ‘Precompute Photon Lookup’… so you’ll have a kind of fg importance-drived)
  • importons + irradianceparticles



Hi Max.

if i use
FG + IP, don´t crash
FG + Importons + IP, dont crash
FG + Importons, don´t crash
Only Importons, don´t crash

but if i use:
Only IP, crash
IP + importons, crash

I only use mia_material or mia_material_x, all of them with the “export with shading engine” unchecked
I have a Physical sun & sky with 39 mia portal lights, all of them with the “Suppress all maya shaders” checked.
I´m ussing maya2008 with sp2
ah!! and i’m ussing mia_exposure_photographic

here you have the result with only importons