Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
32afbb49
T
three.js
项目概览
车家大少爷
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
32afbb49
编写于
11月 09, 2019
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
EXRLoader: Clean up.
上级
93eb40d0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
22 deletion
+24
-22
examples/js/loaders/EXRLoader.js
examples/js/loaders/EXRLoader.js
+12
-11
examples/jsm/loaders/EXRLoader.js
examples/jsm/loaders/EXRLoader.js
+12
-11
未找到文件。
examples/js/loaders/EXRLoader.js
浏览文件 @
32afbb49
...
...
@@ -778,7 +778,7 @@ THREE.EXRLoader.prototype = Object.assign( Object.create( THREE.DataTextureLoade
var
rawBuffer
=
new
Uint8Array
(
inflate
.
decompress
().
buffer
);
var
tmpBuffer
=
new
Uint8Array
(
rawBuffer
.
length
);
reconstruct_scalar
(
rawBuffer
);
// reorder pixels
interleave_scalar
(
rawBuffer
,
tmpBuffer
);
// interleave pixels
...
...
@@ -792,16 +792,16 @@ THREE.EXRLoader.prototype = Object.assign( Object.create( THREE.DataTextureLoade
raw
=
new
Float32Array
(
tmpBuffer
.
buffer
);
}
return
raw
;
}
function
reconstruct_scalar
(
source
)
{
for
(
let
t
=
1
;
t
<
source
.
length
;
t
++
)
{
for
(
let
t
=
1
;
t
<
source
.
length
;
t
++
)
{
var
d
=
source
[
t
-
1
]
+
source
[
t
]
-
128
;
var
d
=
source
[
t
-
1
]
+
source
[
t
]
-
128
;
source
[
t
]
=
d
;
}
...
...
@@ -818,10 +818,10 @@ THREE.EXRLoader.prototype = Object.assign( Object.create( THREE.DataTextureLoade
while
(
true
)
{
if
(
s
>
stop
)
break
;
out
[
s
++
]
=
source
[
t1
++
];
out
[
s
++
]
=
source
[
t1
++
];
if
(
s
>
stop
)
break
;
out
[
s
++
]
=
source
[
t2
++
];
out
[
s
++
]
=
source
[
t2
++
];
}
...
...
@@ -1296,7 +1296,7 @@ THREE.EXRLoader.prototype = Object.assign( Object.create( THREE.DataTextureLoade
}
}
else
if
(
EXRHeader
.
compression
===
'
ZIP_COMPRESSION
'
||
}
else
if
(
EXRHeader
.
compression
===
'
ZIP_COMPRESSION
'
||
EXRHeader
.
compression
===
'
ZIPS_COMPRESSION
'
)
{
for
(
var
scanlineBlockIdx
=
0
;
scanlineBlockIdx
<
height
/
scanlineBlockSize
;
scanlineBlockIdx
++
)
{
...
...
@@ -1307,7 +1307,7 @@ THREE.EXRLoader.prototype = Object.assign( Object.create( THREE.DataTextureLoade
var
raw
=
decompressZIP
(
bufferDataView
,
offset
,
compressedSize
,
EXRHeader
.
channels
[
0
].
pixelType
);
offset
.
value
+=
compressedSize
;
for
(
var
line_y
=
0
;
line_y
<
scanlineBlockSize
;
line_y
++
)
{
for
(
var
channelID
=
0
;
channelID
<
EXRHeader
.
channels
.
length
;
channelID
++
)
{
...
...
@@ -1345,7 +1345,8 @@ THREE.EXRLoader.prototype = Object.assign( Object.create( THREE.DataTextureLoade
case
THREE
.
HalfFloatType
:
throw
'
EXRLoader.parse: unsupported HalfFloatType texture for FloatType image file.
'
throw
'
EXRLoader.parse: unsupported HalfFloatType texture for FloatType image file.
'
;
}
}
else
{
...
...
@@ -1358,7 +1359,7 @@ THREE.EXRLoader.prototype = Object.assign( Object.create( THREE.DataTextureLoade
byteArray
[
(
(
(
height
-
true_y
)
*
(
width
*
numChannels
)
)
+
(
x
*
numChannels
)
)
+
cOff
]
=
val
;
}
}
}
...
...
@@ -1377,7 +1378,7 @@ THREE.EXRLoader.prototype = Object.assign( Object.create( THREE.DataTextureLoade
width
:
width
,
height
:
height
,
data
:
byteArray
,
format
:
numChannels
==
4
?
THREE
.
RGBAFormat
:
THREE
.
RGBFormat
,
format
:
numChannels
==
=
4
?
THREE
.
RGBAFormat
:
THREE
.
RGBFormat
,
type
:
this
.
type
};
...
...
examples/jsm/loaders/EXRLoader.js
浏览文件 @
32afbb49
...
...
@@ -789,7 +789,7 @@ EXRLoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
var
rawBuffer
=
new
Uint8Array
(
inflate
.
decompress
().
buffer
);
var
tmpBuffer
=
new
Uint8Array
(
rawBuffer
.
length
);
reconstruct_scalar
(
rawBuffer
);
// reorder pixels
interleave_scalar
(
rawBuffer
,
tmpBuffer
);
// interleave pixels
...
...
@@ -803,16 +803,16 @@ EXRLoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
raw
=
new
Float32Array
(
tmpBuffer
.
buffer
);
}
return
raw
;
}
function
reconstruct_scalar
(
source
)
{
for
(
let
t
=
1
;
t
<
source
.
length
;
t
++
)
{
for
(
let
t
=
1
;
t
<
source
.
length
;
t
++
)
{
var
d
=
source
[
t
-
1
]
+
source
[
t
]
-
128
;
var
d
=
source
[
t
-
1
]
+
source
[
t
]
-
128
;
source
[
t
]
=
d
;
}
...
...
@@ -829,10 +829,10 @@ EXRLoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
while
(
true
)
{
if
(
s
>
stop
)
break
;
out
[
s
++
]
=
source
[
t1
++
];
out
[
s
++
]
=
source
[
t1
++
];
if
(
s
>
stop
)
break
;
out
[
s
++
]
=
source
[
t2
++
];
out
[
s
++
]
=
source
[
t2
++
];
}
...
...
@@ -1307,7 +1307,7 @@ EXRLoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
}
}
else
if
(
EXRHeader
.
compression
===
'
ZIP_COMPRESSION
'
||
}
else
if
(
EXRHeader
.
compression
===
'
ZIP_COMPRESSION
'
||
EXRHeader
.
compression
===
'
ZIPS_COMPRESSION
'
)
{
for
(
var
scanlineBlockIdx
=
0
;
scanlineBlockIdx
<
height
/
scanlineBlockSize
;
scanlineBlockIdx
++
)
{
...
...
@@ -1318,7 +1318,7 @@ EXRLoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
var
raw
=
decompressZIP
(
bufferDataView
,
offset
,
compressedSize
,
EXRHeader
.
channels
[
0
].
pixelType
);
offset
.
value
+=
compressedSize
;
for
(
var
line_y
=
0
;
line_y
<
scanlineBlockSize
;
line_y
++
)
{
for
(
var
channelID
=
0
;
channelID
<
EXRHeader
.
channels
.
length
;
channelID
++
)
{
...
...
@@ -1356,7 +1356,8 @@ EXRLoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
case
HalfFloatType
:
throw
'
EXRLoader.parse: unsupported HalfFloatType texture for FloatType image file.
'
throw
'
EXRLoader.parse: unsupported HalfFloatType texture for FloatType image file.
'
;
}
}
else
{
...
...
@@ -1369,7 +1370,7 @@ EXRLoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
byteArray
[
(
(
(
height
-
true_y
)
*
(
width
*
numChannels
)
)
+
(
x
*
numChannels
)
)
+
cOff
]
=
val
;
}
}
}
...
...
@@ -1388,7 +1389,7 @@ EXRLoader.prototype = Object.assign( Object.create( DataTextureLoader.prototype
width
:
width
,
height
:
height
,
data
:
byteArray
,
format
:
numChannels
==
4
?
RGBAFormat
:
RGBFormat
,
format
:
numChannels
==
=
4
?
RGBAFormat
:
RGBFormat
,
type
:
this
.
type
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录