This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
forked from mmistakes/minimal-mistakes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Posts “2024-03-03-bsdf中的重要性采样的相关推导与思考”
- Loading branch information
Showing
1 changed file
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|