Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
imjiangjun
pbrt-v4
提交
90dc2994
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,发现更多精彩内容 >>
提交
90dc2994
编写于
11月 24, 2020
作者:
M
Matt Pharr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix GPU build
上级
a7d44bb1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
17 addition
and
16 deletion
+17
-16
src/pbrt/gpu/media.cpp
src/pbrt/gpu/media.cpp
+7
-6
src/pbrt/gpu/optix.cu
src/pbrt/gpu/optix.cu
+9
-8
src/pbrt/gpu/pathintegrator.cpp
src/pbrt/gpu/pathintegrator.cpp
+1
-1
src/pbrt/gpu/workitems.h
src/pbrt/gpu/workitems.h
+0
-1
未找到文件。
src/pbrt/gpu/media.cpp
浏览文件 @
90dc2994
...
...
@@ -168,8 +168,8 @@ void GPUPathIntegrator::SampleMediumInteraction(int depth) {
PBRT_DBG
(
"Adding ray to escapedRayQueue pixel index %d depth %d
\n
"
,
w
.
pixelIndex
,
depth
);
escapedRayQueue
->
Push
(
EscapedRayWorkItem
{
T_hat
,
uniPathPDF
,
lightPathPDF
,
lambda
,
ray
.
o
,
ray
.
d
,
w
.
prevIntrCtx
,
(
int
)
w
.
isSpecularBounce
,
w
.
pixelInde
x
});
ray
.
o
,
ray
.
d
,
lambda
,
w
.
pixelIndex
,
(
int
)
w
.
isSpecularBounce
,
T_hat
,
uniPathPDF
,
lightPathPDF
,
w
.
prevIntrCt
x
});
}
}
...
...
@@ -191,8 +191,9 @@ void GPUPathIntegrator::SampleMediumInteraction(int depth) {
"depth %d
\n
"
,
w
.
pixelIndex
,
depth
);
hitAreaLightQueue
->
Push
(
HitAreaLightWorkItem
{
w
.
areaLight
,
lambda
,
T_hat
,
uniPathPDF
,
lightPathPDF
,
Point3f
(
w
.
pi
),
w
.
n
,
w
.
uv
,
-
ray
.
d
,
w
.
prevIntrCtx
,
w
.
isSpecularBounce
,
w
.
pixelIndex
});
w
.
areaLight
,
Point3f
(
w
.
pi
),
w
.
n
,
w
.
uv
,
-
ray
.
d
,
lambda
,
T_hat
,
uniPathPDF
,
lightPathPDF
,
w
.
prevIntrCtx
,
w
.
isSpecularBounce
,
w
.
pixelIndex
});
}
FloatTextureHandle
displacement
=
material
.
GetDisplacement
();
...
...
@@ -210,8 +211,8 @@ void GPUPathIntegrator::SampleMediumInteraction(int depth) {
using
Material
=
typename
std
::
remove_reference_t
<
decltype
(
*
ptr
)
>
;
q
->
Push
<
MaterialEvalWorkItem
<
Material
>>
(
MaterialEvalWorkItem
<
Material
>
{
ptr
,
w
.
pi
,
w
.
n
,
w
.
ns
,
w
.
dpdus
,
w
.
dpdvs
,
w
.
dndus
,
w
.
dndvs
,
w
.
uv
,
lambda
,
w
.
anyNonSpecularBounces
,
T_hat
,
uniPathPDF
,
-
ray
.
d
,
ray
.
time
,
w
.
etaScale
,
w
.
mediumInterface
,
w
.
pixelIndex
});
lambda
,
w
.
anyNonSpecularBounces
,
-
ray
.
d
,
w
.
pixelIndex
,
T_hat
,
uniPathPDF
,
w
.
mediumInterface
,
w
.
etaScale
,
ray
.
time
});
};
material
.
Dispatch
(
enqueue
);
});
...
...
src/pbrt/gpu/optix.cu
浏览文件 @
90dc2994
...
...
@@ -124,8 +124,8 @@ extern "C" __global__ void __raygen__findClosest() {
PBRT_DBG
(
"Adding ray to escapedRayQueue ray index %d pixel index %d
\n
"
,
rayIndex
,
r
.
pixelIndex
);
params
.
escapedRayQueue
->
Push
(
EscapedRayWorkItem
{
r
.
T_hat
,
r
.
uniPathPDF
,
r
.
lightPathPDF
,
r
.
lambda
,
ray
.
o
,
ray
.
d
,
r
.
prevIntrCtx
,
(
int
)
r
.
isSpecularBounce
,
r
.
pixelInde
x
});
r
ay
.
o
,
ray
.
d
,
r
.
lambda
,
r
.
pixelIndex
,
(
int
)
r
.
isSpecularBounce
,
r
.
T_hat
,
r
.
uniPathPDF
,
r
.
lightPathPDF
,
r
.
prevIntrCt
x
});
}
}
}
...
...
@@ -198,7 +198,7 @@ static __forceinline__ __device__ void ProcessClosestIntersection(
PBRT_DBG
(
"Enqueuing into medium transition queue: ray index %d pixel index %d
\n
"
,
rayIndex
,
r
.
pixelIndex
);
Ray
newRay
=
intr
.
SpawnRay
(
r
.
ray
.
d
);
params
.
nextRayQueue
->
PushIndirect
(
params
.
nextRayQueue
->
PushIndirect
Ray
(
newRay
,
r
.
prevIntrCtx
,
r
.
T_hat
,
r
.
uniPathPDF
,
r
.
lightPathPDF
,
r
.
lambda
,
r
.
etaScale
,
r
.
isSpecularBounce
,
r
.
anyNonSpecularBounces
,
r
.
pixelIndex
);
return
;
...
...
@@ -210,8 +210,9 @@ static __forceinline__ __device__ void ProcessClosestIntersection(
Ray
ray
=
r
.
ray
;
// TODO: intr.wo == -ray.d?
params
.
hitAreaLightQueue
->
Push
(
HitAreaLightWorkItem
{
intr
.
areaLight
,
r
.
lambda
,
r
.
T_hat
,
r
.
uniPathPDF
,
r
.
lightPathPDF
,
intr
.
p
(),
intr
.
n
,
intr
.
uv
,
intr
.
wo
,
r
.
prevIntrCtx
,
(
int
)
r
.
isSpecularBounce
,
r
.
pixelIndex
});
intr
.
areaLight
,
intr
.
p
(),
intr
.
n
,
intr
.
uv
,
intr
.
wo
,
r
.
lambda
,
r
.
T_hat
,
r
.
uniPathPDF
,
r
.
lightPathPDF
,
r
.
prevIntrCtx
,
(
int
)
r
.
isSpecularBounce
,
r
.
pixelIndex
});
}
FloatTextureHandle
displacement
=
material
.
GetDisplacement
();
...
...
@@ -229,9 +230,9 @@ static __forceinline__ __device__ void ProcessClosestIntersection(
q
->
Push
(
MaterialEvalWorkItem
<
Material
>
{
ptr
,
intr
.
pi
,
intr
.
n
,
intr
.
shading
.
n
,
intr
.
shading
.
dpdu
,
intr
.
shading
.
dpdv
,
intr
.
shading
.
dndu
,
intr
.
shading
.
dndv
,
intr
.
uv
,
r
.
lambda
,
r
.
anyNonSpecularBounces
,
r
.
T_hat
,
r
.
uniPathPDF
,
intr
.
wo
,
intr
.
time
,
r
.
etaScal
e
,
getPayload
<
ClosestHitContext
>
()
->
mediumInterface
,
r
.
pixelIndex
});
intr
.
uv
,
r
.
lambda
,
r
.
anyNonSpecularBounces
,
intr
.
wo
,
r
.
pixelIndex
,
r
.
T_hat
,
r
.
uniPathPDF
,
getPayload
<
ClosestHitContext
>
()
->
mediumInterfac
e
,
r
.
etaScale
,
intr
.
time
});
};
material
.
Dispatch
(
enqueue
);
...
...
src/pbrt/gpu/pathintegrator.cpp
浏览文件 @
90dc2994
...
...
@@ -476,7 +476,7 @@ void GPUPathIntegrator::HandleRayFoundEmission(int depth) {
"Handle emitters hit by indirect rays"
,
hitAreaLightQueue
,
maxQueueSize
,
PBRT_GPU_LAMBDA
(
const
HitAreaLightWorkItem
w
,
int
index
)
{
// Find emitted radiance from surface that ray hit
SampledSpectrum
Le
=
areaLight
.
L
(
w
.
p
,
w
.
n
,
w
.
uv
,
w
.
wo
,
w
.
lambda
);
SampledSpectrum
Le
=
w
.
areaLight
.
L
(
w
.
p
,
w
.
n
,
w
.
uv
,
w
.
wo
,
w
.
lambda
);
if
(
!
Le
)
return
;
PBRT_DBG
(
"Got Le %f %f %f %f from hit area light at depth %d
\n
"
,
Le
[
0
],
Le
[
1
],
...
...
src/pbrt/gpu/workitems.h
浏览文件 @
90dc2994
...
...
@@ -291,7 +291,6 @@ struct MaterialEvalWorkItem {
int
pixelIndex
;
SampledSpectrum
T_hat
,
uniPathPDF
;
MediumInterface
mediumInterface
;
Float
time
;
Float
etaScale
;
Float
time
;
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录