Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
imjiangjun
pbrt-v4
提交
ddbf1f62
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,发现更多精彩内容 >>
提交
ddbf1f62
编写于
7月 01, 2021
作者:
M
Matt Pharr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update from book source. Just hyphenation and contraction pedantry.
上级
4550fb73
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
20 addition
and
20 deletion
+20
-20
src/pbrt/cpu/aggregates.cpp
src/pbrt/cpu/aggregates.cpp
+1
-1
src/pbrt/cpu/integrators.cpp
src/pbrt/cpu/integrators.cpp
+3
-3
src/pbrt/gpu/util.h
src/pbrt/gpu/util.h
+1
-1
src/pbrt/lightsamplers.h
src/pbrt/lightsamplers.h
+1
-1
src/pbrt/samplers.h
src/pbrt/samplers.h
+8
-8
src/pbrt/shapes.cpp
src/pbrt/shapes.cpp
+1
-1
src/pbrt/util/sampling.cpp
src/pbrt/util/sampling.cpp
+3
-3
src/pbrt/util/splines.h
src/pbrt/util/splines.h
+1
-1
src/pbrt/wavefront/integrator.cpp
src/pbrt/wavefront/integrator.cpp
+1
-1
未找到文件。
src/pbrt/cpu/aggregates.cpp
浏览文件 @
ddbf1f62
...
...
@@ -479,7 +479,7 @@ BVHBuildNode *BVHAggregate::emitLBVH(BVHBuildNode *&buildNodes,
}
else
{
int
mask
=
1
<<
bitIndex
;
// Advance to next subtree level if there
'
s no LBVH split for this bit
// Advance to next subtree level if there
i
s no LBVH split for this bit
if
((
mortonPrims
[
0
].
mortonCode
&
mask
)
==
(
mortonPrims
[
nPrimitives
-
1
].
mortonCode
&
mask
))
return
emitLBVH
(
buildNodes
,
bvhPrimitives
,
mortonPrims
,
nPrimitives
,
...
...
src/pbrt/cpu/integrators.cpp
浏览文件 @
ddbf1f62
...
...
@@ -541,7 +541,7 @@ void LightPathIntegrator::EvaluatePixelSample(Point2i pPixel, int sampleIndex,
camera
.
SampleWi
(
*
les
->
intr
,
sampler
.
Get2D
(),
lambda
);
if
(
cs
&&
cs
->
pdf
!=
0
)
{
if
(
Float
pdf
=
light
.
PDF_Li
(
cs
->
pLens
,
cs
->
wi
);
pdf
>
0
)
{
// Add light's emitted radiance if non
-
zero and light is visible
// Add light's emitted radiance if nonzero and light is visible
SampledSpectrum
Le
=
light
.
L
(
les
->
intr
->
p
(),
les
->
intr
->
n
,
les
->
intr
->
uv
,
cs
->
wi
,
lambda
);
if
(
Le
&&
Unoccluded
(
cs
->
pRef
,
cs
->
pLens
))
{
...
...
@@ -1810,7 +1810,7 @@ struct Vertex {
pdf
=
pdfDir
*
invDist2
;
}
else
{
// Compute sampling density for non
-
infinite light sources
// Compute sampling density for noninfinite light sources
CHECK
(
type
==
VertexType
::
Light
);
CHECK
(
ei
.
light
);
Float
pdfPos
,
pdfDir
;
...
...
@@ -1834,7 +1834,7 @@ struct Vertex {
return
InfiniteLightDensity
(
infiniteLights
,
lightSampler
,
w
);
}
else
{
// Return sampling density for non
-
infinite light source
// Return sampling density for noninfinite light source
Light
light
=
(
type
==
VertexType
::
Light
)
?
ei
.
light
:
si
.
areaLight
;
Float
pdfPos
,
pdfDir
,
pdfChoice
=
lightSampler
.
PDF
(
light
);
if
(
IsOnSurface
())
...
...
src/pbrt/gpu/util.h
浏览文件 @
ddbf1f62
...
...
@@ -47,7 +47,7 @@ std::pair<cudaEvent_t, cudaEvent_t> GetProfilerEvents(const char *description);
template
<
typename
F
>
inline
int
GetBlockSize
(
const
char
*
description
,
F
kernel
)
{
// Note: this isn't re
-
entrant, but that's fine for our purposes...
// Note: this isn't reentrant, but that's fine for our purposes...
static
std
::
map
<
std
::
type_index
,
int
>
kernelBlockSizes
;
std
::
type_index
index
=
std
::
type_index
(
typeid
(
F
));
...
...
src/pbrt/lightsamplers.h
浏览文件 @
ddbf1f62
...
...
@@ -312,7 +312,7 @@ class BVHLightSampler {
nodeIndex
=
(
child
==
0
)
?
(
nodeIndex
+
1
)
:
node
.
childOrLightIndex
;
}
else
{
// Confirm light has non
-
zero importance before returning light sample
// Confirm light has nonzero importance before returning light sample
if
(
nodeIndex
>
0
)
DCHECK_GT
(
node
.
lightBounds
.
Importance
(
p
,
n
,
allLightBounds
),
0
);
if
(
nodeIndex
>
0
||
...
...
src/pbrt/samplers.h
浏览文件 @
ddbf1f62
...
...
@@ -151,8 +151,8 @@ class PaddedSobolSampler {
PaddedSobolSampler
(
int
samplesPerPixel
,
RandomizeStrategy
randomizer
,
int
seed
=
0
)
:
samplesPerPixel
(
samplesPerPixel
),
randomize
(
randomizer
),
seed
(
seed
)
{
if
(
!
IsPowerOf2
(
samplesPerPixel
))
Warning
(
"Sobol samplers with non power-of-two sample counts (%d) are "
"sub-
optimal."
,
Warning
(
"Sobol samplers with non power-of-two sample counts (%d) are sub
optimal."
,
samplesPerPixel
);
}
...
...
@@ -227,8 +227,8 @@ class ZSobolSampler {
RandomizeStrategy
randomize
,
int
seed
=
0
)
:
randomize
(
randomize
),
seed
(
seed
)
{
if
(
!
IsPowerOf2
(
samplesPerPixel
))
Warning
(
"Sobol samplers with non power-of-two sample counts (%d) are "
"sub-
optimal."
,
Warning
(
"Sobol samplers with non power-of-two sample counts (%d) are sub
optimal."
,
samplesPerPixel
);
log2SamplesPerPixel
=
Log2Int
(
samplesPerPixel
);
int
res
=
RoundUpPow2
(
std
::
max
(
fullResolution
.
x
,
fullResolution
.
y
));
...
...
@@ -484,8 +484,8 @@ class SobolSampler {
RandomizeStrategy
randomize
)
:
samplesPerPixel
(
samplesPerPixel
),
randomize
(
randomize
)
{
if
(
!
IsPowerOf2
(
samplesPerPixel
))
Warning
(
"Non power-of-two sample count %d will perform sub
-optimally with
"
"
the
SobolSampler."
,
Warning
(
"Non power-of-two sample count %d will perform sub
optimally with the
"
"SobolSampler."
,
samplesPerPixel
);
scale
=
RoundUpPow2
(
std
::
max
(
fullResolution
.
x
,
fullResolution
.
y
));
}
...
...
src/pbrt/shapes.cpp
浏览文件 @
ddbf1f62
...
...
@@ -607,7 +607,7 @@ bool Curve::RecursiveIntersect(const Ray &ray, Float tMax, pstd::span<const Poin
int
depth
,
pstd
::
optional
<
ShapeIntersection
>
*
si
)
const
{
Float
rayLength
=
Length
(
ray
.
d
);
if
(
depth
>
0
)
{
// Split curve segment into sub
-
segments and test for intersection
// Split curve segment into subsegments and test for intersection
pstd
::
array
<
Point3f
,
7
>
cpSplit
=
SubdivideCubicBezier
(
cp
);
Float
u
[
3
]
=
{
u0
,
(
u0
+
u1
)
/
2
,
u1
};
for
(
int
seg
=
0
;
seg
<
2
;
++
seg
)
{
...
...
src/pbrt/util/sampling.cpp
浏览文件 @
ddbf1f62
...
...
@@ -141,7 +141,7 @@ Point2f InvertSphericalTriangleSample(const pstd::array<Point3f, 3> &v, Point3f
if
(
Dot
(
a
,
cp
)
>
0.99999847691
f
/* 0.1 degrees */
)
u0
=
0
;
else
{
// Compute area $A'$ of sub
-
triangle
// Compute area $A'$ of subtriangle
Vector3f
n_cpb
=
Cross
(
cp
,
b
),
n_acp
=
Cross
(
a
,
cp
);
CHECK_RARE
(
1e-5
,
LengthSquared
(
n_cpb
)
==
0
||
LengthSquared
(
n_acp
)
==
0
);
if
(
LengthSquared
(
n_cpb
)
==
0
||
LengthSquared
(
n_acp
)
==
0
)
...
...
@@ -391,7 +391,7 @@ Float SampleCatmullRom(pstd::span<const Float> nodes, pstd::span<const Float> f,
Float
d1
=
(
i
+
2
<
nodes
.
size
())
?
width
*
(
f
[
i
+
2
]
-
f0
)
/
(
nodes
[
i
+
2
]
-
x0
)
:
(
f1
-
f0
);
// Re
-
scale _u_ for continuous spline sampling step
// Rescale _u_ for continuous spline sampling step
u
=
(
u
-
F
[
i
])
/
width
;
// Invert definite integral over spline segment
...
...
@@ -443,7 +443,7 @@ Float SampleCatmullRom2D(pstd::span<const Float> nodes1, pstd::span<const Float>
Float
width
=
x1
-
x0
;
Float
d0
,
d1
;
// Re
-
scale _u_ using the interpolated _cdf_
// Rescale _u_ using the interpolated _cdf_
u
=
(
u
-
interpolate
(
cdf
,
idx
))
/
width
;
// Approximate derivatives using finite differences of the interpolant
...
...
src/pbrt/util/splines.h
浏览文件 @
ddbf1f62
...
...
@@ -81,7 +81,7 @@ PBRT_CPU_GPU inline pstd::array<Point3f, 4> ElevateQuadraticBezierToCubic(
PBRT_CPU_GPU
inline
pstd
::
array
<
Point3f
,
3
>
QuadraticBSplineToBezier
(
pstd
::
span
<
const
Point3f
>
cp
)
{
// We can compute equivalent Bezier control points via some blossoming.
// We have three control points and a uniform knot vector; we
'
ll label
// We have three control points and a uniform knot vector; we
wi
ll label
// the points p01, p12, and p23. We want the Bezier control points of
// the equivalent curve, which are p11, p12, and p22. We already have
// p12.
...
...
src/pbrt/wavefront/integrator.cpp
浏览文件 @
ddbf1f62
...
...
@@ -652,7 +652,7 @@ void WavefrontPathIntegrator::HandleEscapedRays() {
}
}
// Update pixel radiance if ray's radiance is non
-
zero
// Update pixel radiance if ray's radiance is nonzero
if
(
L
)
{
PBRT_DBG
(
"Added L %f %f %f %f for escaped ray pixel index %d
\n
"
,
L
[
0
],
L
[
1
],
L
[
2
],
L
[
3
],
w
.
pixelIndex
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录