There 2 GI cache solutions highlighted during the features poll:
1) A V-Ray like solution mostly based on photon mapping. Characteristics: biased, pre-processing, GPU viable, path tracing only, very fast, sometime tricky.
2) A Corona like solution mostly based on reducing the noise by driving the traced paths according the importance. The name "cache", in this case, is not even appropriate. Characteristics: unbiased, on-line training (very little pre-processing), not GPU viable, bidirectional and normal path tracing, not faster (but with less noise), easy to use (i.e. "fire and forget").
Note: I don't have the V-Ray or Corona sources so the above statements are based on publicaly available information and papers.
I'm currently working on #1 solution. The optimal would be to have #1 for GPU path tracing and #2 for CPU bidirectional so it may be worth work on #2 in the future too.
Direct light cache
This is cache is mostly used for building indirect light cache and it is not usually directly used for the rendering due to far better result you can get with normal direct light sampling. There is still a possible direct light cache application (see below: all caches enabled). The output of the cache looks like:
You can reduce the "splotch-ness", by tracing more photons, up to the point to have a correct render but normal direct light sampling works well and is already fast enough. Note how this image is rendered using only 1 ray per pixel thanks to the cache (it is fast, very fast). The is true for any cache usage: instead of tracing a long chain of rays, you do a cache look up and it is done.
Indirect light cache
This cache starts to be very useful and it transforms the complete computation of the global illumination in just a cache lookup. The output of the cache is similar the indirect light AOV:
And a complete rendering with the cache:
As you can see, the "splotch-ness" in indirect light is not noticeable (because of the very smooth way indirect lighting works). This image is rendered using only 3 rays per sample: 1 to find the first intersection point, 1 for direct light sampling and 1 for indirect light cache lookup. Normally, this scene requires 5-6 rays per samples.
Caustic cache is used to render caustics. Some scene like the Cornell box doesn't use one for the obvious reason there are not specular surfaces and caustics. However in a scene like the Psor's cube, the output of the cache looks like:
And a complete rendering with the cache:
Note: this is a path tracing rendering, not a bidirectional one. Path tracing is not even vaguely able to render this caustic without the cache. With the cache, it is rendered nearly for free.
All caches enabled
When all 3 caches (including direct light one) are enabled, they will be merged in a single one and used, specular reflections/transmissions aside, after having traced just one single ray. While the direct light cache cause some splotch-ness, it is a view independent cache that can be shared across all the frames of an animation where you are moving only the camera. This makes rendering the preview of an animation a very fast process. The output looks like:
It is not usable for a final render but it is good enough for a animation preview.
The pre-processing time of the above renderings is about 2secs for Cornell box and 30secs for Psor's cube.
Like I wrote, direct light cache is not used by default. The default configuration should be:
- Direct light cache disabled
- Indirect light cache enabled
- Caustic light cache enabled
This is the list of properties (with their default values) currently used:
Code: Select all
# Leave disabled (aside from pre-views) path.photongi.direct.enabled = 0 # Enable to use the indirect light cache path.photongi.indirect.enabled = 0 # Enable to use the caustic light cache path.photongi.caustic.enabled = 0 # Max. number of photons traced path.photongi.photon.maxcount = 100000 # Max. depth of photon paths path.photongi.photon.maxdepth = 4 # Max. number of photons stored in direct light cache path.photongi.direct.maxsize = 100000 # Max. number of photons stored in indirect light cache path.photongi.indirect.maxsize = 100000 # Max. number of photons stored in caustic light cache path.photongi.caustic.maxsize = 100000 # Cache look up radius path.photongi.lookup.maxcount = 48 # Cache look up radius path.photongi.lookup.radius = 0.15 # Cache look up normal angle path.photongi.lookup.normalangle = 10.0
This is the start of the development, not the end. Some current limitation that will be removed in the future:
1) Cache entries are currently created only on "matte" material (note: "matte", not "roughmatte");
2) You probably want to avoid infinite lights and/or very open scenes because they require to fire a lot of photons (as they have to "irradiante" a large surface);
3) serialization is not supported (aka sharing/saving/loading the cache from file).