Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
imjiangjun
pbrt-v4
提交
b325bc89
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,发现更多精彩内容 >>
提交
b325bc89
编写于
10月 25, 2021
作者:
M
Matt Pharr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update from book source. No functional changes.
上级
83d4c269
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
27 addition
and
16 deletion
+27
-16
src/pbrt/media.cpp
src/pbrt/media.cpp
+3
-1
src/pbrt/media.h
src/pbrt/media.h
+4
-5
src/pbrt/paramdict.cpp
src/pbrt/paramdict.cpp
+18
-10
src/pbrt/pbrt.h
src/pbrt/pbrt.h
+1
-0
src/pbrt/util/colorspace.h
src/pbrt/util/colorspace.h
+1
-0
未找到文件。
src/pbrt/media.cpp
浏览文件 @
b325bc89
...
@@ -509,7 +509,6 @@ NanoVDBMedium::NanoVDBMedium(const Transform &renderFromMedium, Spectrum sigma_a
...
@@ -509,7 +509,6 @@ NanoVDBMedium::NanoVDBMedium(const Transform &renderFromMedium, Spectrum sigma_a
:
renderFromMedium
(
renderFromMedium
),
:
renderFromMedium
(
renderFromMedium
),
sigma_a_spec
(
sigma_a
,
alloc
),
sigma_a_spec
(
sigma_a
,
alloc
),
sigma_s_spec
(
sigma_s
,
alloc
),
sigma_s_spec
(
sigma_s
,
alloc
),
sigmaScale
(
sigmaScale
),
phase
(
g
),
phase
(
g
),
majorantGrid
(
Bounds3f
(),
{
64
,
64
,
64
},
alloc
),
majorantGrid
(
Bounds3f
(),
{
64
,
64
,
64
},
alloc
),
densityGrid
(
std
::
move
(
dg
)),
densityGrid
(
std
::
move
(
dg
)),
...
@@ -519,6 +518,9 @@ NanoVDBMedium::NanoVDBMedium(const Transform &renderFromMedium, Spectrum sigma_a
...
@@ -519,6 +518,9 @@ NanoVDBMedium::NanoVDBMedium(const Transform &renderFromMedium, Spectrum sigma_a
temperatureScale
(
temperatureScale
)
{
temperatureScale
(
temperatureScale
)
{
densityFloatGrid
=
densityGrid
.
grid
<
float
>
();
densityFloatGrid
=
densityGrid
.
grid
<
float
>
();
sigma_a_spec
.
Scale
(
sigmaScale
);
sigma_s_spec
.
Scale
(
sigmaScale
);
nanovdb
::
BBox
<
nanovdb
::
Vec3R
>
bbox
=
densityFloatGrid
->
worldBBox
();
nanovdb
::
BBox
<
nanovdb
::
Vec3R
>
bbox
=
densityFloatGrid
->
worldBBox
();
bounds
=
Bounds3f
(
Point3f
(
bbox
.
min
()[
0
],
bbox
.
min
()[
1
],
bbox
.
min
()[
2
]),
bounds
=
Bounds3f
(
Point3f
(
bbox
.
min
()[
0
],
bbox
.
min
()[
1
],
bbox
.
min
()[
2
]),
Point3f
(
bbox
.
max
()[
0
],
bbox
.
max
()[
1
],
bbox
.
max
()[
2
]));
Point3f
(
bbox
.
max
()[
0
],
bbox
.
max
()[
1
],
bbox
.
max
()[
2
]));
...
...
src/pbrt/media.h
浏览文件 @
b325bc89
...
@@ -610,8 +610,8 @@ class NanoVDBMedium {
...
@@ -610,8 +610,8 @@ class NanoVDBMedium {
PBRT_CPU_GPU
PBRT_CPU_GPU
MediumProperties
SamplePoint
(
Point3f
p
,
const
SampledWavelengths
&
lambda
)
const
{
MediumProperties
SamplePoint
(
Point3f
p
,
const
SampledWavelengths
&
lambda
)
const
{
// Sample spectra for grid $\sigmaa$ and $\sigmas$
// Sample spectra for grid $\sigmaa$ and $\sigmas$
SampledSpectrum
sigma_a
=
sigma
Scale
*
sigma
_a_spec
.
Sample
(
lambda
);
SampledSpectrum
sigma_a
=
sigma_a_spec
.
Sample
(
lambda
);
SampledSpectrum
sigma_s
=
sigma
Scale
*
sigma
_s_spec
.
Sample
(
lambda
);
SampledSpectrum
sigma_s
=
sigma_s_spec
.
Sample
(
lambda
);
// Scale scattering coefficients by medium density at _p_
// Scale scattering coefficients by medium density at _p_
p
=
renderFromMedium
.
ApplyInverse
(
p
);
p
=
renderFromMedium
.
ApplyInverse
(
p
);
...
@@ -635,8 +635,8 @@ class NanoVDBMedium {
...
@@ -635,8 +635,8 @@ class NanoVDBMedium {
DCHECK_LE
(
tMax
,
raytMax
);
DCHECK_LE
(
tMax
,
raytMax
);
// Sample spectra for grid $\sigmaa$ and $\sigmas$
// Sample spectra for grid $\sigmaa$ and $\sigmas$
SampledSpectrum
sigma_a
=
sigma
Scale
*
sigma
_a_spec
.
Sample
(
lambda
);
SampledSpectrum
sigma_a
=
sigma_a_spec
.
Sample
(
lambda
);
SampledSpectrum
sigma_s
=
sigma
Scale
*
sigma
_s_spec
.
Sample
(
lambda
);
SampledSpectrum
sigma_s
=
sigma_s_spec
.
Sample
(
lambda
);
SampledSpectrum
sigma_t
=
sigma_a
+
sigma_s
;
SampledSpectrum
sigma_t
=
sigma_a
+
sigma_s
;
return
DDAMajorantIterator
(
ray
,
tMin
,
tMax
,
&
majorantGrid
,
sigma_t
);
return
DDAMajorantIterator
(
ray
,
tMin
,
tMax
,
&
majorantGrid
,
sigma_t
);
...
@@ -662,7 +662,6 @@ class NanoVDBMedium {
...
@@ -662,7 +662,6 @@ class NanoVDBMedium {
Bounds3f
bounds
;
Bounds3f
bounds
;
Transform
renderFromMedium
;
Transform
renderFromMedium
;
DenselySampledSpectrum
sigma_a_spec
,
sigma_s_spec
;
DenselySampledSpectrum
sigma_a_spec
,
sigma_s_spec
;
Float
sigmaScale
;
HGPhaseFunction
phase
;
HGPhaseFunction
phase
;
MajorantGrid
majorantGrid
;
MajorantGrid
majorantGrid
;
nanovdb
::
GridHandle
<
NanoVDBBuffer
>
densityGrid
;
nanovdb
::
GridHandle
<
NanoVDBBuffer
>
densityGrid
;
...
...
src/pbrt/paramdict.cpp
浏览文件 @
b325bc89
...
@@ -162,8 +162,10 @@ void ParameterDictionary::checkParameterTypes() {
...
@@ -162,8 +162,10 @@ void ParameterDictionary::checkParameterTypes() {
for
(
const
ParsedParameter
*
p
:
params
)
{
for
(
const
ParsedParameter
*
p
:
params
)
{
if
(
p
->
type
==
ParameterTypeTraits
<
ParameterType
::
Boolean
>::
typeName
)
{
if
(
p
->
type
==
ParameterTypeTraits
<
ParameterType
::
Boolean
>::
typeName
)
{
if
(
p
->
bools
.
empty
())
if
(
p
->
bools
.
empty
())
ErrorExit
(
&
p
->
loc
,
"
\"
%s
\"
: non-Boolean values provided for Boolean-valued parameter"
,
ErrorExit
(
p
->
name
);
&
p
->
loc
,
"
\"
%s
\"
: non-Boolean values provided for Boolean-valued parameter"
,
p
->
name
);
}
else
if
(
p
->
type
==
ParameterTypeTraits
<
ParameterType
::
Float
>::
typeName
||
}
else
if
(
p
->
type
==
ParameterTypeTraits
<
ParameterType
::
Float
>::
typeName
||
p
->
type
==
ParameterTypeTraits
<
ParameterType
::
Integer
>::
typeName
||
p
->
type
==
ParameterTypeTraits
<
ParameterType
::
Integer
>::
typeName
||
p
->
type
==
ParameterTypeTraits
<
ParameterType
::
Point2f
>::
typeName
||
p
->
type
==
ParameterTypeTraits
<
ParameterType
::
Point2f
>::
typeName
||
...
@@ -173,17 +175,23 @@ void ParameterDictionary::checkParameterTypes() {
...
@@ -173,17 +175,23 @@ void ParameterDictionary::checkParameterTypes() {
p
->
type
==
ParameterTypeTraits
<
ParameterType
::
Normal3f
>::
typeName
||
p
->
type
==
ParameterTypeTraits
<
ParameterType
::
Normal3f
>::
typeName
||
p
->
type
==
"rgb"
||
p
->
type
==
"blackbody"
)
{
p
->
type
==
"rgb"
||
p
->
type
==
"blackbody"
)
{
if
(
p
->
ints
.
empty
()
&&
p
->
floats
.
empty
())
if
(
p
->
ints
.
empty
()
&&
p
->
floats
.
empty
())
ErrorExit
(
&
p
->
loc
,
"
\"
%s
\"
: non-numeric values provided for numeric-valued parameter"
,
ErrorExit
(
p
->
name
);
&
p
->
loc
,
"
\"
%s
\"
: non-numeric values provided for numeric-valued parameter"
,
p
->
name
);
}
else
if
(
p
->
type
==
ParameterTypeTraits
<
ParameterType
::
String
>::
typeName
||
}
else
if
(
p
->
type
==
ParameterTypeTraits
<
ParameterType
::
String
>::
typeName
||
p
->
type
==
"texture"
)
{
p
->
type
==
"texture"
)
{
if
(
p
->
strings
.
empty
())
if
(
p
->
strings
.
empty
())
ErrorExit
(
&
p
->
loc
,
"
\"
%s
\"
: non-string values provided for string-valued parameter"
,
ErrorExit
(
p
->
name
);
&
p
->
loc
,
"
\"
%s
\"
: non-string values provided for string-valued parameter"
,
p
->
name
);
}
else
if
(
p
->
type
==
"spectrum"
)
{
}
else
if
(
p
->
type
==
"spectrum"
)
{
if
(
p
->
strings
.
empty
()
&&
p
->
ints
.
empty
()
&&
p
->
floats
.
empty
())
if
(
p
->
strings
.
empty
()
&&
p
->
ints
.
empty
()
&&
p
->
floats
.
empty
())
ErrorExit
(
&
p
->
loc
,
"
\"
%s
\"
: expecting string or numeric-valued parameter for spectrum parameter"
,
ErrorExit
(
&
p
->
loc
,
p
->
name
);
"
\"
%s
\"
: expecting string or numeric-valued parameter for "
"spectrum parameter"
,
p
->
name
);
}
else
}
else
ErrorExit
(
&
p
->
loc
,
"
\"
%s
\"
: unknown parameter type"
,
p
->
type
);
ErrorExit
(
&
p
->
loc
,
"
\"
%s
\"
: unknown parameter type"
,
p
->
type
);
}
}
...
...
src/pbrt/pbrt.h
浏览文件 @
b325bc89
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#define PBRT_CPU_GPU_LAMBDA(...) [=] PBRT_CPU_GPU(__VA_ARGS__)
#define PBRT_CPU_GPU_LAMBDA(...) [=] PBRT_CPU_GPU(__VA_ARGS__)
#endif
#endif
// Define Cache Line Size Constant
#ifdef PBRT_BUILD_GPU_RENDERER
#ifdef PBRT_BUILD_GPU_RENDERER
#define PBRT_L1_CACHE_LINE_SIZE 128
#define PBRT_L1_CACHE_LINE_SIZE 128
#else
#else
...
...
src/pbrt/util/colorspace.h
浏览文件 @
b325bc89
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#include <pbrt/pbrt.h>
#include <pbrt/pbrt.h>
#include <pbrt/util/color.h>
#include <pbrt/util/math.h>
#include <pbrt/util/math.h>
#include <pbrt/util/spectrum.h>
#include <pbrt/util/spectrum.h>
#include <pbrt/util/vecmath.h>
#include <pbrt/util/vecmath.h>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录