This patch adds support for light portals: Objects that help sampling the environment light, therefore improving convergence.
Using them tor other lights in a unidirectional pathtracer is virtually useless.
The sampling is done with the area-preserving code already used for area lamps.
MIS is used both for combination of different portals and for combining portal- and envmap-sampling.
The direction of portals is considered, they aren't used if the sampling point is behind them (since then, the ray winn go into the interior...)
Examples following, I'm uploading this with arcanist...