Environment map

In this update, the lighting from environment map(s) is implemented into the uni-directional path tracer. When we sample the direct lighting from all the light sources, in the case of environment map lighting, the probability distribution is proportional to the light intensity of each texel in the environment map. (Of course the computation of the probability distribution of the environment map is done before we render/trace the rays into the scene.) Once we have the correct distribution, we can use 2D probability sample for sampling the light contribution by Monte Carlo integration process.

Below shows several, different environment maps with the same Suzanne model. The material type for the model is glossy with proper Dielectric Fresnel and Blinn microfacet distribution.