weixin_39861882
weixin_39861882
2020-12-25 20:09

Blue noise

Brief Description

This PR replaces white-noise random variables with blue-noise random variables. As a result, the first few seconds of rendering should look much more pleasing to the eye and less noise should be noticeable as a whole after any number of rendered samples.

In our path tracing algorithm, we seed a unique random number for each pixel on the screen. We then sum this per-pixel random number with a global random number produced via stratified sampling. This summed random number is what we use to sample ray directions in the path tracing algorithm.

Before this PR, the per-pixel random number was generated uniformly and without consideration of the nearby pixels' random numbers. We were effectively creating a white-noise texture to sample from. This change modifies the per-pixel random number to instead come from a pre-computed blue noise texture.

Blue noise is a specifically crafted noise that contains no uneven spikes of energy, or in other words, no neighborhoods of pixels that are similar to each other. This property functions nicely with path tracing, since it results in renders that are evenly converged everywhere in the image. No one part of the image is more noisy or more converged than any other part.

For a more detailed explanation of why this works, please refer to the following papers which discuss the general idea: * Georgiev et. al. - Blue-noise Dithered Sampling * Heitz - Distributing Monte Carlo Errors as a Blue Noise in Screen Space by Permuting Pixel Seeds Between Frames

Notes

  • We are using a pre-computed blue-noise texture created by Cristoph Peters. This texture is placed in public domain through CC0-licensing. Generating a blue-noise texture ourself would be difficult to implement and time consuming to compute on the fly. Therefore it makes sense to store a pre-computed texture that's bundled with the renderer. The texture is 9.6 kB in size (7.1 kB gzipped) which is relatively small compared to our existing ~100 kB bundle.

  • Performance remains the same with this method.

Images

Blue noise results in an improvement to the rendering quality at both early and late stages of rendering. The effect is most visible for surfaces with lots of global illumination.

House model

White noise (15 samples) house_whitenoise_15

Blue noise (15 samples) house_bluenoise_15

White noise (400 samples) house_whitenoise_400

Blue noise (400 samples) house_bluenoise_400

Mask model

White noise (50 samples) mase_whitenoise_50

Blue noise (50 samples) mask_bluenoise_50

White noise (400 samples) mask_whitenoise_400

Blue noise (400 samples) mask_bluenoise_400

Pull Request Guidelines

  • [x] I have added pull requests labels which describe my contribution.
  • [x] All existing tests passed.
    • [ ] I have added tests to cover my changes, of which pass.
  • [x] I have compared the render output of my branch to master.
  • [x] My code has passed the ESLint configuration for this project.
  • [ ] My change requires modifications to the documentation.
    • [ ] I have updated the documentation accordingly.

该提问来源于开源项目:hoverinc/ray-tracing-renderer

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

4条回答

为你推荐