Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
imjiangjun
pbrt-v4
提交
ba5c99c9
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,发现更多精彩内容 >>
提交
ba5c99c9
编写于
5月 16, 2021
作者:
M
Matt Pharr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve ImageTexture ToString() methods.
Implement them for GPU textures. Include the filename for all textures.
上级
399b8c79
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
17 deletion
+40
-17
src/pbrt/textures.cpp
src/pbrt/textures.cpp
+22
-8
src/pbrt/textures.h
src/pbrt/textures.h
+18
-9
未找到文件。
src/pbrt/textures.cpp
浏览文件 @
ba5c99c9
...
...
@@ -375,15 +375,15 @@ SampledSpectrum SpectrumImageTexture::Evaluate(TextureEvalContext ctx,
}
std
::
string
SpectrumImageTexture
::
ToString
()
const
{
return
StringPrintf
(
"[ SpectrumImageTexture mapping: %s scale: %f invert: %s mipmap: %s ]"
,
mapping
,
scale
,
invert
,
*
mipmap
);
return
StringPrintf
(
"[ SpectrumImageTexture filename: %s mapping: %s scale: %f "
"invert: %s mipmap: %s ]"
,
filename
,
mapping
,
scale
,
invert
,
*
mipmap
);
}
std
::
string
FloatImageTexture
::
ToString
()
const
{
return
StringPrintf
(
"[ FloatImageTexture
mapping: %s scale: %f invert: %s mipmap: %s ]"
,
mapping
,
scale
,
invert
,
*
mipmap
);
"[ FloatImageTexture
filename: %s mapping: %s scale: %f invert: %s mipmap: %s ]"
,
filename
,
mapping
,
scale
,
invert
,
*
mipmap
);
}
std
::
string
TexInfo
::
ToString
()
const
{
...
...
@@ -1260,8 +1260,15 @@ GPUSpectrumImageTexture *GPUSpectrumImageTexture::Create(
Float
scale
=
parameters
.
GetOneFloat
(
"scale"
,
1.
f
);
bool
invert
=
parameters
.
GetOneBool
(
"invert"
,
false
);
return
alloc
.
new_object
<
GPUSpectrumImageTexture
>
(
mapping
,
texObj
,
scale
,
invert
,
isSingleChannel
,
colorSpace
,
spectrumType
);
return
alloc
.
new_object
<
GPUSpectrumImageTexture
>
(
filename
,
mapping
,
texObj
,
scale
,
invert
,
isSingleChannel
,
colorSpace
,
spectrumType
);
}
std
::
string
GPUSpectrumImageTexture
::
ToString
()
const
{
return
StringPrintf
(
"[ GPUSpectrumImageTexture filename: %s mapping: %s scale: %f invert: %s ]"
,
filename
,
mapping
,
scale
,
invert
);
}
GPUFloatImageTexture
*
GPUFloatImageTexture
::
Create
(
...
...
@@ -1366,7 +1373,14 @@ GPUFloatImageTexture *GPUFloatImageTexture::Create(
Float
scale
=
parameters
.
GetOneFloat
(
"scale"
,
1.
f
);
bool
invert
=
parameters
.
GetOneBool
(
"invert"
,
false
);
return
alloc
.
new_object
<
GPUFloatImageTexture
>
(
mapping
,
texObj
,
scale
,
invert
);
return
alloc
.
new_object
<
GPUFloatImageTexture
>
(
filename
,
mapping
,
texObj
,
scale
,
invert
);
}
std
::
string
GPUFloatImageTexture
::
ToString
()
const
{
return
StringPrintf
(
"[ GPUFloatImageTexture filename: %s mapping: %s scale: %f invert: %s ]"
,
filename
,
mapping
,
scale
,
invert
);
}
#endif // PBRT_BUILD_GPU_RENDERER
...
...
src/pbrt/textures.h
浏览文件 @
ba5c99c9
...
...
@@ -530,7 +530,7 @@ class ImageTextureBase {
ImageTextureBase
(
TextureMapping2D
mapping
,
std
::
string
filename
,
MIPMapFilterOptions
filterOptions
,
WrapMode
wrapMode
,
Float
scale
,
bool
invert
,
ColorEncoding
encoding
,
Allocator
alloc
)
:
mapping
(
mapping
),
scale
(
scale
),
invert
(
invert
)
{
:
mapping
(
mapping
),
filename
(
filename
),
scale
(
scale
),
invert
(
invert
)
{
// Get _MIPMap_ from texture cache if present
TexInfo
texInfo
(
filename
,
filterOptions
,
wrapMode
,
encoding
);
std
::
unique_lock
<
std
::
mutex
>
lock
(
textureCacheMutex
);
...
...
@@ -558,6 +558,7 @@ class ImageTextureBase {
protected:
// ImageTextureBase Protected Members
TextureMapping2D
mapping
;
std
::
string
filename
;
Float
scale
;
bool
invert
;
MIPMap
*
mipmap
;
...
...
@@ -629,10 +630,12 @@ class SpectrumImageTexture : public ImageTextureBase {
#if defined(PBRT_BUILD_GPU_RENDERER) && defined(__NVCC__)
class
GPUSpectrumImageTexture
{
public:
GPUSpectrumImageTexture
(
TextureMapping2D
mapping
,
cudaTextureObject_t
texObj
,
Float
scale
,
bool
invert
,
bool
isSingleChannel
,
const
RGBColorSpace
*
colorSpace
,
SpectrumType
spectrumType
)
GPUSpectrumImageTexture
(
std
::
string
filename
,
TextureMapping2D
mapping
,
cudaTextureObject_t
texObj
,
Float
scale
,
bool
invert
,
bool
isSingleChannel
,
const
RGBColorSpace
*
colorSpace
,
SpectrumType
spectrumType
)
:
mapping
(
mapping
),
filename
(
filename
),
texObj
(
texObj
),
scale
(
scale
),
invert
(
invert
),
...
...
@@ -679,11 +682,12 @@ class GPUSpectrumImageTexture {
SpectrumType
spectrumType
,
const
FileLoc
*
loc
,
Allocator
alloc
);
std
::
string
ToString
()
const
{
return
"GPUSpectrumImageTexture"
;
}
std
::
string
ToString
()
const
;
void
MultiplyScale
(
Float
s
)
{
scale
*=
s
;
}
TextureMapping2D
mapping
;
std
::
string
filename
;
cudaTextureObject_t
texObj
;
Float
scale
;
bool
invert
,
isSingleChannel
;
...
...
@@ -693,9 +697,13 @@ class GPUSpectrumImageTexture {
class
GPUFloatImageTexture
{
public:
GPUFloatImageTexture
(
TextureMapping2D
mapping
,
cudaTextureObject_t
texObj
,
Float
scale
,
bool
invert
)
:
mapping
(
mapping
),
texObj
(
texObj
),
scale
(
scale
),
invert
(
invert
)
{}
GPUFloatImageTexture
(
std
::
string
filename
,
TextureMapping2D
mapping
,
cudaTextureObject_t
texObj
,
Float
scale
,
bool
invert
)
:
mapping
(
mapping
),
filename
(
filename
),
texObj
(
texObj
),
scale
(
scale
),
invert
(
invert
)
{}
PBRT_CPU_GPU
Float
Evaluate
(
TextureEvalContext
ctx
)
const
{
...
...
@@ -718,11 +726,12 @@ class GPUFloatImageTexture {
const
TextureParameterDictionary
&
parameters
,
const
FileLoc
*
loc
,
Allocator
alloc
);
std
::
string
ToString
()
const
{
return
"GPUFloatImageTexture"
;
}
std
::
string
ToString
()
const
;
void
MultiplyScale
(
Float
s
)
{
scale
*=
s
;
}
TextureMapping2D
mapping
;
std
::
string
filename
;
cudaTextureObject_t
texObj
;
Float
scale
;
bool
invert
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录