Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
imjiangjun
pbrt-v4
提交
24d5abf6
P
pbrt-v4
项目概览
imjiangjun
/
pbrt-v4
11 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
24d5abf6
编写于
12月 28, 2021
作者:
M
Matt Pharr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix a few more nits from -Wall
上级
37cf605f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
22 addition
and
90 deletion
+22
-90
src/pbrt/cpu/integrators.cpp
src/pbrt/cpu/integrators.cpp
+1
-3
src/pbrt/lightsamplers.h
src/pbrt/lightsamplers.h
+2
-2
src/pbrt/textures.h
src/pbrt/textures.h
+0
-1
src/pbrt/util/math.h
src/pbrt/util/math.h
+19
-19
src/pbrt/util/spectrum.cpp
src/pbrt/util/spectrum.cpp
+0
-54
src/pbrt/wavefront/integrator.cpp
src/pbrt/wavefront/integrator.cpp
+0
-11
未找到文件。
src/pbrt/cpu/integrators.cpp
浏览文件 @
24d5abf6
...
...
@@ -1431,8 +1431,6 @@ retry:
// Compute coordinate frame based on true geometry, not shading
// geometry.
Normal3f
n
=
FaceForward
(
isect
.
n
,
-
ray
.
d
);
Vector3f
s
=
Normalize
(
isect
.
dpdu
);
Vector3f
t
=
Cross
(
isect
.
n
,
s
);
Vector3f
wi
;
Float
pdf
;
...
...
@@ -2797,7 +2795,7 @@ void SPPMIntegrator::Render() {
// Allocate per-thread _ScratchBuffer_s for SPPM rendering
ThreadLocal
<
ScratchBuffer
>
threadScratchBuffers
(
[
nPixels
]()
{
return
ScratchBuffer
(
1024
*
1024
);
});
[]()
{
return
ScratchBuffer
(
1024
*
1024
);
});
// Allocate samplers for SPPM rendering
ThreadLocal
<
Sampler
>
threadSamplers
(
...
...
src/pbrt/lightsamplers.h
浏览文件 @
24d5abf6
...
...
@@ -234,13 +234,13 @@ struct alignas(32) LightBVHNode {
PBRT_CPU_GPU
static
LightBVHNode
MakeLeaf
(
unsigned
int
lightIndex
,
const
CompactLightBounds
&
cb
)
{
return
LightBVHNode
{
cb
,
lightIndex
,
1
};
return
LightBVHNode
{
cb
,
{
lightIndex
,
1
}
};
}
PBRT_CPU_GPU
static
LightBVHNode
MakeInterior
(
unsigned
int
child1Index
,
const
CompactLightBounds
&
cb
)
{
return
LightBVHNode
{
cb
,
child1Index
,
0
};
return
LightBVHNode
{
cb
,
{
child1Index
,
0
}
};
}
PBRT_CPU_GPU
...
...
src/pbrt/textures.h
浏览文件 @
24d5abf6
...
...
@@ -581,7 +581,6 @@ class FloatImageTexture : public ImageTextureBase {
assert
(
!
"Should not be called in GPU code"
);
return
0
;
#else
Vector2f
dstdx
,
dstdy
;
TexCoord2D
c
=
mapping
.
Map
(
ctx
);
// Texture coordinates are (0,0) in the lower left corner, but
// image coordinates are (0,0) in the upper left.
...
...
src/pbrt/util/math.h
浏览文件 @
24d5abf6
...
...
@@ -1601,25 +1601,25 @@ PBRT_CPU_GPU inline pstd::optional<SquareMatrix<4>> Inverse(const SquareMatrix<4
return
{};
Float
s
=
1
/
determinant
;
Float
inv
[
4
][
4
]
=
{
s
*
InnerProduct
(
m
[
1
][
1
],
c5
,
m
[
1
][
3
],
c3
,
-
m
[
1
][
2
],
c4
),
s
*
InnerProduct
(
-
m
[
0
][
1
],
c5
,
m
[
0
][
2
],
c4
,
-
m
[
0
][
3
],
c3
),
s
*
InnerProduct
(
m
[
3
][
1
],
s5
,
m
[
3
][
3
],
s3
,
-
m
[
3
][
2
],
s4
),
s
*
InnerProduct
(
-
m
[
2
][
1
],
s5
,
m
[
2
][
2
],
s4
,
-
m
[
2
][
3
],
s3
)
,
s
*
InnerProduct
(
-
m
[
1
][
0
],
c5
,
m
[
1
][
2
],
c2
,
-
m
[
1
][
3
],
c1
),
s
*
InnerProduct
(
m
[
0
][
0
],
c5
,
m
[
0
][
3
],
c1
,
-
m
[
0
][
2
],
c2
),
s
*
InnerProduct
(
-
m
[
3
][
0
],
s5
,
m
[
3
][
2
],
s2
,
-
m
[
3
][
3
],
s1
),
s
*
InnerProduct
(
m
[
2
][
0
],
s5
,
m
[
2
][
3
],
s1
,
-
m
[
2
][
2
],
s2
)
,
s
*
InnerProduct
(
m
[
1
][
0
],
c4
,
m
[
1
][
3
],
c0
,
-
m
[
1
][
1
],
c2
),
s
*
InnerProduct
(
-
m
[
0
][
0
],
c4
,
m
[
0
][
1
],
c2
,
-
m
[
0
][
3
],
c0
),
s
*
InnerProduct
(
m
[
3
][
0
],
s4
,
m
[
3
][
3
],
s0
,
-
m
[
3
][
1
],
s2
),
s
*
InnerProduct
(
-
m
[
2
][
0
],
s4
,
m
[
2
][
1
],
s2
,
-
m
[
2
][
3
],
s0
)
,
s
*
InnerProduct
(
-
m
[
1
][
0
],
c3
,
m
[
1
][
1
],
c1
,
-
m
[
1
][
2
],
c0
),
s
*
InnerProduct
(
m
[
0
][
0
],
c3
,
m
[
0
][
2
],
c0
,
-
m
[
0
][
1
],
c1
),
s
*
InnerProduct
(
-
m
[
3
][
0
],
s3
,
m
[
3
][
1
],
s1
,
-
m
[
3
][
2
],
s0
),
s
*
InnerProduct
(
m
[
2
][
0
],
s3
,
m
[
2
][
2
],
s0
,
-
m
[
2
][
1
],
s1
)
};
Float
inv
[
4
][
4
]
=
{
{
s
*
InnerProduct
(
m
[
1
][
1
],
c5
,
m
[
1
][
3
],
c3
,
-
m
[
1
][
2
],
c4
),
s
*
InnerProduct
(
-
m
[
0
][
1
],
c5
,
m
[
0
][
2
],
c4
,
-
m
[
0
][
3
],
c3
),
s
*
InnerProduct
(
m
[
3
][
1
],
s5
,
m
[
3
][
3
],
s3
,
-
m
[
3
][
2
],
s4
),
s
*
InnerProduct
(
-
m
[
2
][
1
],
s5
,
m
[
2
][
2
],
s4
,
-
m
[
2
][
3
],
s3
)}
,
{
s
*
InnerProduct
(
-
m
[
1
][
0
],
c5
,
m
[
1
][
2
],
c2
,
-
m
[
1
][
3
],
c1
),
s
*
InnerProduct
(
m
[
0
][
0
],
c5
,
m
[
0
][
3
],
c1
,
-
m
[
0
][
2
],
c2
),
s
*
InnerProduct
(
-
m
[
3
][
0
],
s5
,
m
[
3
][
2
],
s2
,
-
m
[
3
][
3
],
s1
),
s
*
InnerProduct
(
m
[
2
][
0
],
s5
,
m
[
2
][
3
],
s1
,
-
m
[
2
][
2
],
s2
)}
,
{
s
*
InnerProduct
(
m
[
1
][
0
],
c4
,
m
[
1
][
3
],
c0
,
-
m
[
1
][
1
],
c2
),
s
*
InnerProduct
(
-
m
[
0
][
0
],
c4
,
m
[
0
][
1
],
c2
,
-
m
[
0
][
3
],
c0
),
s
*
InnerProduct
(
m
[
3
][
0
],
s4
,
m
[
3
][
3
],
s0
,
-
m
[
3
][
1
],
s2
),
s
*
InnerProduct
(
-
m
[
2
][
0
],
s4
,
m
[
2
][
1
],
s2
,
-
m
[
2
][
3
],
s0
)}
,
{
s
*
InnerProduct
(
-
m
[
1
][
0
],
c3
,
m
[
1
][
1
],
c1
,
-
m
[
1
][
2
],
c0
),
s
*
InnerProduct
(
m
[
0
][
0
],
c3
,
m
[
0
][
2
],
c0
,
-
m
[
0
][
1
],
c1
),
s
*
InnerProduct
(
-
m
[
3
][
0
],
s3
,
m
[
3
][
1
],
s1
,
-
m
[
3
][
2
],
s0
),
s
*
InnerProduct
(
m
[
2
][
0
],
s3
,
m
[
2
][
2
],
s0
,
-
m
[
2
][
1
],
s1
)}
};
return
SquareMatrix
<
4
>
(
inv
);
}
...
...
src/pbrt/util/spectrum.cpp
浏览文件 @
24d5abf6
...
...
@@ -268,8 +268,6 @@ namespace {
constexpr
int
nCIESamples
=
471
;
extern
const
Float
CIE_lambda
[
nCIESamples
];
const
Float
CIE_lambdaStart
=
CIE_lambda
[
0
];
const
Float
CIE_lambdaEnd
=
CIE_lambda
[
nCIESamples
-
1
];
// Spectral Data
const
Float
CIE_X
[
nCIESamples
]
=
{
...
...
@@ -1443,58 +1441,6 @@ const Float GlassSF11_eta[] = {
// PhysLight code and measurements contributed by Anders Langlands and Luca Fascione
// Copyright (c) 2020, Weta Digital, Ltd.
// SPDX-License-Identifier: Apache-2.0
const
Float
Canon_eos5dmkii_lambda
[]
=
{
380
,
390
,
400
,
410
,
420
,
430
,
440
,
450
,
460
,
470
,
480
,
490
,
500
,
510
,
520
,
530
,
540
,
550
,
560
,
570
,
580
,
590
,
600
,
610
,
620
,
630
,
640
,
650
,
660
,
670
,
680
,
690
,
700
,
710
,
720
};
const
Float
Canon_eos5dmkii_R
[]
=
{
0.0008013842
,
0.0006220757
,
0.001637148
,
0.0038748426
,
0.0085357673
,
0.0061490957
,
0.0028872172
,
0.0024148706
,
0.0022508639
,
0.0040032296
,
0.0068301998
,
0.0092928829
,
0.0152933769
,
0.0305241911
,
0.0916499483
,
0.1336909081
,
0.1509614473
,
0.130782838
,
0.1628188126
,
0.2568271304
,
0.3849123031
,
0.4693487229
,
0.4692466342
,
0.4421441869
,
0.3902777211
,
0.317328307
,
0.2623859635
,
0.1707236556
,
0.122806183
,
0.0916867133
,
0.051765637
,
0.0147074911
,
0.0025296982
,
0.0016901259
,
0.0008906563
};
const
Float
Canon_eos5dmkii_G
[]
=
{
0.001320931
,
0.0009869984
,
0.0029762197
,
0.0101720847
,
0.0322943739
,
0.0390348509
,
0.0598052544
,
0.0750923329
,
0.0912708802
,
0.2487049523
,
0.4731934541
,
0.603250544
,
0.7303841968
,
0.71503
,
1.0
,
0.8266072352
,
0.7706404757
,
0.7397716484
,
0.7017391188
,
0.5729864943
,
0.4713093699
,
0.3557909148
,
0.2270881614
,
0.1267125616
,
0.0609366683
,
0.035822907
,
0.0229253792
,
0.0122726601
,
0.0088821173
,
0.0086322805
,
0.0068405787
,
0.0027319055
,
0.000806291
,
0.0005819094
,
0.0003689315
};
const
Float
Canon_eos5dmkii_B
[]
=
{
0.0010193366
,
0.0019387474
,
0.0184137527
,
0.0880872372
,
0.324456777
,
0.4733696468
,
0.5952254136
,
0.719627943
,
0.7247913875
,
0.765651266
,
0.7369036376
,
0.5623063473
,
0.4416055734
,
0.2567925877
,
0.1963973281
,
0.0897441872
,
0.051141812
,
0.0322256091
,
0.0210614803
,
0.0139621978
,
0.0114102512
,
0.0094738362
,
0.0071171351
,
0.0046852384
,
0.0038326684
,
0.0032847416
,
0.0035606685
,
0.0026451065
,
0.0025273598
,
0.0022779309
,
0.0014565188
,
0.0004733991
,
0.0001661569
,
0.0001275188
,
9.09883e-05
};
const
Float
Canon_eos5dmkiifg_lambda
[]
=
{
380
,
390
,
400
,
410
,
420
,
430
,
440
,
450
,
460
,
470
,
480
,
490
,
500
,
510
,
520
,
530
,
540
,
550
,
560
,
570
,
580
,
590
,
600
,
610
,
620
,
630
,
640
,
650
,
660
,
670
,
680
,
690
,
700
,
710
,
720
};
const
Float
Canon_eos5dmkiifg_R
[]
=
{
0.0008013842
,
0.0006220757
,
0.001637148
,
0.0038748426
,
0.0085357673
,
0.0061490957
,
0.0028872172
,
0.0024148706
,
0.0022508639
,
0.0040032296
,
0.0068301998
,
0.0092928829
,
0.0152933769
,
0.0305241911
,
0.0916499483
,
0.1336909081
,
0.1509614473
,
0.130782838
,
0.1628188126
,
0.2568271304
,
0.3849123031
,
0.4693487229
,
0.4692466342
,
0.4421441869
,
0.3902777211
,
0.317328307
,
0.2623859635
,
0.1707236556
,
0.122806183
,
0.0916867133
,
0.051765637
,
0.0147074911
,
0.0025296982
,
0.0016901259
,
0.0008906563
};
const
Float
Canon_eos5dmkiifg_G
[]
=
{
0.001320931
,
0.0009869984
,
0.0029762197
,
0.0101720847
,
0.0322943739
,
0.0390348509
,
0.0598052544
,
0.0750923329
,
0.0912708802
,
0.2487049523
,
0.4731934541
,
0.603250544
,
0.7303841968
,
0.928899999922
,
1.0
,
0.8266072352
,
0.7706404757
,
0.7397716484
,
0.7017391188
,
0.5729864943
,
0.4713093699
,
0.3557909148
,
0.2270881614
,
0.1267125616
,
0.0609366683
,
0.035822907
,
0.0229253792
,
0.0122726601
,
0.0088821173
,
0.0086322805
,
0.0068405787
,
0.0027319055
,
0.000806291
,
0.0005819094
,
0.0003689315
};
const
Float
Canon_eos5dmkiifg_B
[]
=
{
0.0010193366
,
0.0019387474
,
0.0184137527
,
0.0880872372
,
0.324456777
,
0.4733696468
,
0.5952254136
,
0.719627943
,
0.7247913875
,
0.765651266
,
0.7369036376
,
0.5623063473
,
0.4416055734
,
0.2567925877
,
0.1963973281
,
0.0897441872
,
0.051141812
,
0.0322256091
,
0.0210614803
,
0.0139621978
,
0.0114102512
,
0.0094738362
,
0.0071171351
,
0.0046852384
,
0.0038326684
,
0.0032847416
,
0.0035606685
,
0.0026451065
,
0.0025273598
,
0.0022779309
,
0.0014565188
,
0.0004733991
,
0.0001661569
,
0.0001275188
,
9.09883e-05
};
const
Float
canon_eos_100d_r
[]
=
{
380.0
,
0.0010345340999999945
,
390.0
,
0.0009932282000000006
,
400.0
,
0.0018438642000000011
,
410.0
,
0.01028051149999999
,
...
...
src/pbrt/wavefront/integrator.cpp
浏览文件 @
24d5abf6
...
...
@@ -101,17 +101,6 @@ WavefrontPathIntegrator::WavefrontPathIntegrator(
if
(
!
shape
.
insideMedium
.
empty
()
||
!
shape
.
outsideMedium
.
empty
())
haveMedia
=
true
;
auto
findMedium
=
[
&
](
const
std
::
string
&
s
,
const
FileLoc
*
loc
)
->
Medium
{
if
(
s
.
empty
())
return
nullptr
;
auto
iter
=
media
.
find
(
s
);
if
(
iter
==
media
.
end
())
ErrorExit
(
loc
,
"%s: medium not defined"
,
s
);
haveMedia
=
true
;
return
iter
->
second
;
};
// Textures
LOG_VERBOSE
(
"Starting to create textures"
);
NamedTextures
textures
=
scene
.
CreateTextures
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录