The current implementation of PhotonGI caustic cache has been stretched up to the point to not make any sense. I'm looking for an alternative solution to replace and discard caustic cache altogether. Hybrid Back/Forward path tracing is what I'm thinking to use at the moment.
Hybrid Back/Forward path tracing
Path tracing builds paths from the eye toward the light source. Many years ago it was called also backward ray tracing. Light tracing does the opposite, builds paths from the light source toward the eye and it is really (only) good to render caustics (forward path tracing).
Bidirectional path tracing does both, building many times the same path in different ways and mix the result with MIS (multiple importance sampling). BiDir is slow because of the "building many times the same path" part.
My idea is to trace, alternatively, back and forward paths. The ratio is driven by a user defined parameter. The result works with OpenCL, is extremely fast and is really good to render caustics:
Notice the samples/sec. This picture was rendered using a single GPU and the GPU was dedicated to render only eye paths while the CPU was dedicated to render light paths (i.e. caustics).
This is technically bidirectional path tracing done using GPUs but without MIS and with asymmetrical workload. I think this solution is currently used by Iray.
You can enable hybrid Back/Forward path tracing with:
Code: Select all
path.hybridbackforward.enable = 1
Code: Select all
path.hybridbackforward.partition = 0.8
The parameters work for both PATHCPU and PATHOCL (but read below). TILEPATH ignores the parameter because tile rendering can not work with light paths, for obvious reasons.
GPUs can still render only eye paths so when using PATHOCL, the parameters control only the ratio of the CPU work: GPU will always rende only eye paths, CPU will render both.
Most of the times, if not all, it is best to dedicate the GPU to render only eye paths, and the CPU only light paths (i.e. "path.hybridbackforward.partition = 0.0").
If this solution replaces caustic cache, I will add the support for glossy caustics too. It currently render only specular caustics like caustic cache.