diff --git "a/_posts/2024-03-03-bsdf\344\270\255\347\232\204\351\207\215\350\246\201\346\200\247\351\207\207\346\240\267\347\232\204\347\233\270\345\205\263\346\216\250\345\257\274\344\270\216\346\200\235\350\200\203.md" "b/_posts/2024-03-03-bsdf\344\270\255\347\232\204\351\207\215\350\246\201\346\200\247\351\207\207\346\240\267\347\232\204\347\233\270\345\205\263\346\216\250\345\257\274\344\270\216\346\200\235\350\200\203.md" new file mode 100644 index 000000000000..1b20051d3ce5 --- /dev/null +++ "b/_posts/2024-03-03-bsdf\344\270\255\347\232\204\351\207\215\350\246\201\346\200\247\351\207\207\346\240\267\347\232\204\347\233\270\345\205\263\346\216\250\345\257\274\344\270\216\346\200\235\350\200\203.md" @@ -0,0 +1,93 @@ +--- +title: BSDF中的重要性采样的相关推导与思考 +date: 2024-03-03T09:44:37.443Z +last_modified_at: 2024-03-03T09:44:37.444Z +excerpt: 针对BSDF中的重要性采样的推导与相关思考 +categories: + - 图形学 +tags: + - BSRF + - 路径追踪 + - 数学 +header: + overlay_image: https://picsum.photos/1920/640 + caption: "来源: [**Lorem Picsum**](https://picsum.photos/)" + teaser: https://ultcrt.github.io/UltBlog/assets/images/site/default-teaser.png +--- +这里的重要性采样指的是蒙特卡洛积分过程中,使用特定的PDF(概率密度函数),使随机变量的分布更符合被积函数,从而提高结果的准确度。 + +这里首先给出蒙特卡洛积分的公式: + +$$ +\int_a^b f(x)dx\approx\frac 1 N \sum_{n=1}^N \frac {f(x_n)} {p(x_n)} +$$ + +其中,$$N$$为采样数量,$$p$$为PDF。 + +可以看到,如果PDF满足: + +$$ +p(x)=\frac {f(x)} {\int_a^b f(x) dx} +$$ + +那么此时蒙特卡洛积分能够严格等于原积分,其实上述这种情况就是最理想的重要性采样。 + +如果要将重要性积分运用到BSDF上,那么就需要确定两件事: +1. 怎么采样 +2. 怎么求PDF + +首先来看 + + +参考文献: + +[1] [Some Notes on +Importance Sampling of a Hemisphere](https://www.mathematik.uni-marburg.de/%7Ethormae/lectures/graphics1/code/ImportanceSampling/importance_sampling_notes.pdf) + +[2] [Spherical coordinate system](https://en.wikipedia.org/wiki/Spherical_coordinate_system) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +