Skip to content

Use spherical harmonics for irradiance

Precomputing irradiance (diffuse contribution from the environment) is done through vtkPBRIrradianceTexture currently.
While this works well, there are some issues:

  • Precomputation can be expensive depending on the GPU
  • High-frequency environments introduced recently by HDR inputs produces artifacts when using low number of samples
  • Using too many samples can fail on some OpenGL implementation

This MR introduces a different approach, using spherical harmonics computed with a CPU filter.
The implementation comes from http://graphics.stanford.edu/papers/envmap/envmap.pdf

This method is more efficient, does not have artifacts with HDR, but is an approximation, thus the old method is still available if precision is needed.

Here is the image resulting from the test, this is a comparison between irradiance sampling with HDR artifacts (left) and spherical harmonics (right):

2020-05-12-155547_window

Edited by Michael Migliore

Merge request reports