Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
imjiangjun
pbrt-v4
提交
fc37e41b
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,发现更多精彩内容 >>
提交
fc37e41b
编写于
9月 02, 2020
作者:
M
Matt Pharr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update from book source
上级
ca0db69d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
16 deletion
+17
-16
src/pbrt/base/sampler.h
src/pbrt/base/sampler.h
+1
-1
src/pbrt/cmd/pbrt.cpp
src/pbrt/cmd/pbrt.cpp
+4
-4
src/pbrt/cpu/integrators.cpp
src/pbrt/cpu/integrators.cpp
+7
-6
src/pbrt/cpu/integrators.h
src/pbrt/cpu/integrators.h
+5
-5
未找到文件。
src/pbrt/base/sampler.h
浏览文件 @
fc37e41b
...
...
@@ -56,7 +56,7 @@ class SamplerHandle
PBRT_CPU_GPU
inline
Float
Get1D
();
PBRT_CPU_GPU
inline
Point2f
Get2D
();
std
::
vector
<
SamplerHandle
>
Clone
(
int
n
,
Allocator
alloc
);
std
::
vector
<
SamplerHandle
>
Clone
(
int
n
,
Allocator
alloc
=
{}
);
std
::
string
ToString
()
const
;
};
...
...
src/pbrt/cmd/pbrt.cpp
浏览文件 @
fc37e41b
...
...
@@ -111,7 +111,6 @@ int main(int argc, char *argv[]) {
// Declare variables for parsed command line
PBRTOptions
options
;
std
::
vector
<
std
::
string
>
filenames
;
std
::
string
logLevel
=
"error"
;
std
::
string
renderCoordSys
=
"cameraworld"
;
bool
format
=
false
,
toPly
=
false
;
...
...
@@ -201,11 +200,12 @@ int main(int argc, char *argv[]) {
#endif // !NDEBUG
printf
(
"Copyright (c)1998-2020 Matt Pharr, Wenzel Jakob, and Greg Humphreys.
\n
"
);
printf
(
"The source code to pbrt (but *not* the book contents) is covered "
"by the
BSD
License.
\n
"
);
"by the
Apache 2.0
License.
\n
"
);
printf
(
"See the file LICENSE.txt for the conditions of the license.
\n
"
);
fflush
(
stdout
);
}
// Check validity of provided arguments
if
(
renderCoordSys
==
"camera"
)
options
.
renderingSpace
=
RenderingCoordinateSystem
::
Camera
;
else
if
(
renderCoordSys
==
"cameraworld"
)
...
...
@@ -223,6 +223,7 @@ int main(int argc, char *argv[]) {
options
.
logLevel
=
LogLevelFromString
(
logLevel
);
// Initialize pbrt
InitPBRT
(
options
);
if
(
format
||
toPly
||
options
.
upgrade
)
{
...
...
@@ -240,9 +241,8 @@ int main(int argc, char *argv[]) {
CPURender
(
scene
);
LOG_VERBOSE
(
"Memory used after post-render cleanup: %s"
,
GetCurrentRSS
());
// Clean up after rendering scene
// Clean up after rendering
the
scene
CleanupPBRT
();
}
return
0
;
}
src/pbrt/cpu/integrators.cpp
浏览文件 @
fc37e41b
...
...
@@ -142,20 +142,19 @@ void ImageTileIntegrator::Render() {
});
// Declare common variables for rendering image in tiles
Bounds2i
pixelBounds
=
camera
.
GetFilm
().
PixelBounds
();
int
spp
=
samplerPrototype
.
SamplesPerPixel
();
int
startWave
=
0
,
endWave
=
1
,
waveDelta
=
1
;
std
::
vector
<
ScratchBuffer
>
scratchBuffers
;
for
(
int
i
=
0
;
i
<
MaxThreadIndex
();
++
i
)
scratchBuffers
.
push_back
(
ScratchBuffer
(
65536
));
std
::
vector
<
SamplerHandle
>
samplers
=
samplerPrototype
.
Clone
(
MaxThreadIndex
(),
Allocator
());
std
::
vector
<
SamplerHandle
>
samplers
=
samplerPrototype
.
Clone
(
MaxThreadIndex
());
Bounds2i
pixelBounds
=
camera
.
GetFilm
().
PixelBounds
();
int
spp
=
samplerPrototype
.
SamplesPerPixel
();
ProgressReporter
progress
(
int64_t
(
spp
)
*
pixelBounds
.
Area
(),
"Rendering"
,
Options
->
quiet
);
int
startWave
=
0
,
endWave
=
1
,
waveDelta
=
1
;
if
(
Options
->
recordPixelStatistics
)
StatsEnablePixelStats
(
pixelBounds
,
RemoveExtension
(
camera
.
GetFilm
().
GetFilename
()));
...
...
@@ -206,6 +205,7 @@ void ImageTileIntegrator::Render() {
});
}
// Render image in waves
while
(
startWave
<
spp
)
{
// Render image tiles in parallel
ParallelFor2D
(
pixelBounds
,
[
&
](
Bounds2i
tileBounds
)
{
...
...
@@ -256,6 +256,7 @@ void ImageTileIntegrator::Render() {
camera
.
InitMetadata
(
&
metadata
);
camera
.
GetFilm
().
WriteImage
(
metadata
,
1.0
f
/
startWave
);
}
if
(
mseOutFile
)
fclose
(
mseOutFile
);
progress
.
Done
();
...
...
src/pbrt/cpu/integrators.h
浏览文件 @
fc37e41b
...
...
@@ -47,12 +47,12 @@ class Integrator {
const
Bounds3f
&
SceneBounds
()
const
{
return
sceneBounds
;
}
virtual
void
Render
()
=
0
;
pstd
::
optional
<
ShapeIntersection
>
Intersect
(
const
Ray
&
ray
,
Float
tMax
=
Infinity
)
const
;
bool
IntersectP
(
const
Ray
&
ray
,
Float
tMax
=
Infinity
)
const
;
virtual
void
Render
()
=
0
;
bool
Unoccluded
(
const
Interaction
&
p0
,
const
Interaction
&
p1
)
const
{
return
!
IntersectP
(
p0
.
SpawnRayTo
(
p1
),
1
-
ShadowEpsilon
);
}
...
...
@@ -62,12 +62,13 @@ class Integrator {
// Integrator Public Members
std
::
vector
<
LightHandle
>
lights
;
PrimitiveHandle
aggregate
;
std
::
vector
<
LightHandle
>
infiniteLights
;
protected:
// Integrator Private Methods
Integrator
(
PrimitiveHandle
aggregate
,
std
::
vector
<
LightHandle
>
l
)
:
lights
(
std
::
move
(
l
)
),
aggregate
(
aggregate
)
{
Integrator
(
PrimitiveHandle
aggregate
,
std
::
vector
<
LightHandle
>
l
ights
)
:
lights
(
lights
),
aggregate
(
aggregate
)
{
// Integrator Constructor Implementation
if
(
aggregate
)
sceneBounds
=
aggregate
.
Bounds
();
...
...
@@ -80,7 +81,6 @@ class Integrator {
}
// Integrator Private Members
PrimitiveHandle
aggregate
;
Bounds3f
sceneBounds
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录