Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
imjiangjun
pbrt-v4
提交
bd0e8574
P
pbrt-v4
项目概览
imjiangjun
/
pbrt-v4
12 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
pbrt-v4
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bd0e8574
编写于
8月 22, 2021
作者:
M
Matt Pharr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update Integrator::Tr() to match inverse MIS weights convention
上级
673c2477
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
14 deletion
+10
-14
src/pbrt/cpu/integrators.cpp
src/pbrt/cpu/integrators.cpp
+10
-14
未找到文件。
src/pbrt/cpu/integrators.cpp
浏览文件 @
bd0e8574
...
...
@@ -318,17 +318,10 @@ SampledSpectrum Integrator::Tr(const Interaction &p0, const Interaction &p1,
const
SampledWavelengths
&
lambda
)
const
{
RNG
rng
(
Hash
(
p0
.
p
()),
Hash
(
p1
.
p
()));
auto
rescale
=
[](
SampledSpectrum
&
Tr
,
SampledSpectrum
&
pdf
)
{
if
(
Tr
.
MaxComponentValue
()
>
0x1
p24f
||
pdf
.
MaxComponentValue
()
>
0x1
p24f
)
{
Tr
/=
0x1
p24f
;
pdf
/=
0x1
p24f
;
}
};
// :-(
Ray
ray
=
p0
.
IsSurfaceInteraction
()
?
p0
.
AsSurface
().
SpawnRayTo
(
p1
)
:
p0
.
SpawnRayTo
(
p1
);
SampledSpectrum
Tr
(
1.
f
),
pdf
(
1.
f
);
SampledSpectrum
Tr
(
1.
f
),
inv_w
(
1.
f
);
if
(
LengthSquared
(
ray
.
d
)
==
0
)
return
Tr
;
...
...
@@ -343,22 +336,25 @@ SampledSpectrum Integrator::Tr(const Interaction &p0, const Interaction &p1,
Point3f
pExit
=
ray
(
si
?
si
->
tHit
:
(
1
-
ShadowEpsilon
));
ray
.
d
=
pExit
-
ray
.
o
;
SampleT_maj
(
ray
,
1.
f
,
rng
.
Uniform
<
Float
>
(),
rng
,
lambda
,
SampledSpectrum
T_maj
=
SampleT_maj
(
ray
,
1.
f
,
rng
.
Uniform
<
Float
>
(),
rng
,
lambda
,
[
&
](
Point3f
p
,
MediumProperties
mp
,
SampledSpectrum
sigma_maj
,
SampledSpectrum
T_maj
)
{
SampledSpectrum
sigma_n
=
ClampZero
(
sigma_maj
-
mp
.
sigma_a
-
mp
.
sigma_s
);
Float
pr
=
T_maj
[
0
]
*
sigma_maj
[
0
];
// ratio-tracking: only evaluate null scattering
Tr
*=
T_maj
*
sigma_n
;
pdf
*=
T_maj
*
sigma_maj
;
Tr
*=
T_maj
*
sigma_n
/
pr
;
inv_w
*=
T_maj
*
sigma_maj
/
pr
;
if
(
!
Tr
)
if
(
!
Tr
||
!
inv_w
)
return
false
;
rescale
(
Tr
,
pdf
);
return
true
;
});
Tr
*=
T_maj
/
T_maj
[
0
];
inv_w
*=
T_maj
/
T_maj
[
0
];
}
// Generate next ray segment or return final transmittance
...
...
@@ -367,7 +363,7 @@ SampledSpectrum Integrator::Tr(const Interaction &p0, const Interaction &p1,
ray
=
si
->
intr
.
SpawnRayTo
(
p1
);
}
PBRT_DBG
(
"%s
\n
"
,
StringPrintf
(
"Tr from %s to %s = %s"
,
p0
.
pi
,
p1
.
pi
,
Tr
).
c_str
());
return
Tr
/
pdf
.
Average
();
return
Tr
/
inv_w
.
Average
();
}
std
::
string
Integrator
::
ToString
()
const
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录