文摘
Rendering volumetric scattering in real-time is a challenge due to the complex interactions between the light and the particles in the participating media. Assuming that a ray leaving the emitter is scattered only once along its path to the sensor, we propose to represent the extinction coefficient by a Gaussian mixture model. Then the model is trained with a large number of particles colliding that ray in an online way. A low-cost updating function based on the weighted maximum likelihood estimation is derived for the weighted stepwise expectation–maximization algorithm, which is fitted into the graphics pipeline as a stage of learning. This enables all those particles to contribute to the extinction on the fly without storing and sorting them together with respect to the emitter in a geometry pass. Our approach is able to accurately reconstruct the per-pixel transmittance of the opacity map for optically thick heterogeneous media in real-time but operate in bounded memory, using the recently introduced fragment shader critical section feature of the graphics processing unit.