Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
imjiangjun
pbrt-v4
提交
134eb78d
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,体验更适合开发者的 AI 搜索 >>
提交
134eb78d
编写于
4月 25, 2022
作者:
M
Matt Pharr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add Film::ResetPixel() method
上级
a4f48c69
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
0 deletion
+27
-0
src/pbrt/base/film.h
src/pbrt/base/film.h
+3
-0
src/pbrt/film.h
src/pbrt/film.h
+24
-0
未找到文件。
src/pbrt/base/film.h
浏览文件 @
134eb78d
...
...
@@ -50,6 +50,7 @@ class Film : public TaggedPointer<RGBFilm, GBufferFilm, SpectralFilm> {
const
SampledWavelengths
&
lambda
)
const
;
Image
GetImage
(
ImageMetadata
*
metadata
,
Float
splatScale
=
1
);
PBRT_CPU_GPU
RGB
GetPixelRGB
(
Point2i
p
,
Float
splatScale
=
1
)
const
;
...
...
@@ -64,6 +65,8 @@ class Film : public TaggedPointer<RGBFilm, GBufferFilm, SpectralFilm> {
Filter
filter
,
const
FileLoc
*
loc
,
Allocator
alloc
);
std
::
string
ToString
()
const
;
PBRT_CPU_GPU
inline
void
ResetPixel
(
Point2i
p
);
};
}
// namespace pbrt
...
...
src/pbrt/film.h
浏览文件 @
134eb78d
...
...
@@ -295,6 +295,10 @@ class RGBFilm : public FilmBase {
return
outputRGBFromSensorRGB
*
sensorRGB
;
}
PBRT_CPU_GPU
void
ResetPixel
(
Point2i
p
)
{
std
::
memset
(
&
pixels
[
p
],
0
,
sizeof
(
Pixel
));
}
private:
// RGBFilm::Pixel Definition
struct
Pixel
{
...
...
@@ -367,6 +371,10 @@ class GBufferFilm : public FilmBase {
std
::
string
ToString
()
const
;
PBRT_CPU_GPU
void
ResetPixel
(
Point2i
p
)
{
std
::
memset
(
&
pixels
[
p
],
0
,
sizeof
(
Pixel
));
}
private:
// GBufferFilm::Pixel Definition
struct
Pixel
{
...
...
@@ -482,6 +490,16 @@ class SpectralFilm : public FilmBase {
return
{};
}
PBRT_CPU_GPU
void
ResetPixel
(
Point2i
p
)
{
Pixel
&
pix
=
pixels
[
p
];
pix
.
rgbSum
[
0
]
=
pix
.
rgbSum
[
1
]
=
pix
.
rgbSum
[
2
]
=
0.
;
pix
.
rgbWeightSum
=
0.
;
pix
.
rgbSplat
[
0
]
=
pix
.
rgbSplat
[
1
]
=
pix
.
rgbSplat
[
2
]
=
0.
;
std
::
memset
(
pix
.
bucketSums
,
0
,
nBuckets
*
sizeof
(
double
));
std
::
memset
(
pix
.
weightSums
,
0
,
nBuckets
*
sizeof
(
double
));
std
::
memset
(
pix
.
bucketSplats
,
0
,
nBuckets
*
sizeof
(
AtomicDouble
));
}
private:
PBRT_CPU_GPU
int
LambdaToBucket
(
Float
lambda
)
const
{
...
...
@@ -584,6 +602,12 @@ inline const PixelSensor *Film::GetPixelSensor() const {
return
Dispatch
(
filter
);
}
PBRT_CPU_GPU
inline
void
Film
::
ResetPixel
(
Point2i
p
)
{
auto
rp
=
[
&
](
auto
ptr
)
{
ptr
->
ResetPixel
(
p
);
};
return
Dispatch
(
rp
);
}
}
// namespace pbrt
#endif // PBRT_FILM_H
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录