Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
707d9471
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,发现更多精彩内容 >>
提交
707d9471
编写于
6月 21, 2019
作者:
M
Mugen87
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Material: Clean up serialization/deserialization.
上级
6a7784dd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
3 deletion
+7
-3
src/loaders/MaterialLoader.js
src/loaders/MaterialLoader.js
+2
-0
src/materials/Material.js
src/materials/Material.js
+5
-3
未找到文件。
src/loaders/MaterialLoader.js
浏览文件 @
707d9471
...
@@ -93,6 +93,7 @@ Object.assign( MaterialLoader.prototype, {
...
@@ -93,6 +93,7 @@ Object.assign( MaterialLoader.prototype, {
if
(
json
.
skinning
!==
undefined
)
material
.
skinning
=
json
.
skinning
;
if
(
json
.
skinning
!==
undefined
)
material
.
skinning
=
json
.
skinning
;
if
(
json
.
morphTargets
!==
undefined
)
material
.
morphTargets
=
json
.
morphTargets
;
if
(
json
.
morphTargets
!==
undefined
)
material
.
morphTargets
=
json
.
morphTargets
;
if
(
json
.
morphNormals
!==
undefined
)
material
.
morphNormals
=
json
.
morphNormals
;
if
(
json
.
dithering
!==
undefined
)
material
.
dithering
=
json
.
dithering
;
if
(
json
.
dithering
!==
undefined
)
material
.
dithering
=
json
.
dithering
;
if
(
json
.
visible
!==
undefined
)
material
.
visible
=
json
.
visible
;
if
(
json
.
visible
!==
undefined
)
material
.
visible
=
json
.
visible
;
...
@@ -218,6 +219,7 @@ Object.assign( MaterialLoader.prototype, {
...
@@ -218,6 +219,7 @@ Object.assign( MaterialLoader.prototype, {
if
(
json
.
envMapIntensity
!==
undefined
)
material
.
envMapIntensity
=
json
.
envMapIntensity
;
if
(
json
.
envMapIntensity
!==
undefined
)
material
.
envMapIntensity
=
json
.
envMapIntensity
;
if
(
json
.
reflectivity
!==
undefined
)
material
.
reflectivity
=
json
.
reflectivity
;
if
(
json
.
reflectivity
!==
undefined
)
material
.
reflectivity
=
json
.
reflectivity
;
if
(
json
.
refractionRatio
!==
undefined
)
material
.
refractionRatio
=
json
.
refractionRatio
;
if
(
json
.
lightMap
!==
undefined
)
material
.
lightMap
=
getTexture
(
json
.
lightMap
);
if
(
json
.
lightMap
!==
undefined
)
material
.
lightMap
=
getTexture
(
json
.
lightMap
);
if
(
json
.
lightMapIntensity
!==
undefined
)
material
.
lightMapIntensity
=
json
.
lightMapIntensity
;
if
(
json
.
lightMapIntensity
!==
undefined
)
material
.
lightMapIntensity
=
json
.
lightMapIntensity
;
...
...
src/materials/Material.js
浏览文件 @
707d9471
...
@@ -160,7 +160,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
...
@@ -160,7 +160,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
if
(
this
.
metalness
!==
undefined
)
data
.
metalness
=
this
.
metalness
;
if
(
this
.
metalness
!==
undefined
)
data
.
metalness
=
this
.
metalness
;
if
(
this
.
emissive
&&
this
.
emissive
.
isColor
)
data
.
emissive
=
this
.
emissive
.
getHex
();
if
(
this
.
emissive
&&
this
.
emissive
.
isColor
)
data
.
emissive
=
this
.
emissive
.
getHex
();
if
(
this
.
emissiveIntensity
!==
1
)
data
.
emissiveIntensity
=
this
.
emissiveIntensity
;
if
(
this
.
emissiveIntensity
&&
this
.
emissiveIntensity
!==
1
)
data
.
emissiveIntensity
=
this
.
emissiveIntensity
;
if
(
this
.
specular
&&
this
.
specular
.
isColor
)
data
.
specular
=
this
.
specular
.
getHex
();
if
(
this
.
specular
&&
this
.
specular
.
isColor
)
data
.
specular
=
this
.
specular
.
getHex
();
if
(
this
.
shininess
!==
undefined
)
data
.
shininess
=
this
.
shininess
;
if
(
this
.
shininess
!==
undefined
)
data
.
shininess
=
this
.
shininess
;
...
@@ -212,6 +212,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
...
@@ -212,6 +212,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
data
.
envMap
=
this
.
envMap
.
toJSON
(
meta
).
uuid
;
data
.
envMap
=
this
.
envMap
.
toJSON
(
meta
).
uuid
;
data
.
reflectivity
=
this
.
reflectivity
;
// Scale behind envMap
data
.
reflectivity
=
this
.
reflectivity
;
// Scale behind envMap
data
.
refractionRatio
=
this
.
refractionRatio
;
if
(
this
.
combine
!==
undefined
)
data
.
combine
=
this
.
combine
;
if
(
this
.
combine
!==
undefined
)
data
.
combine
=
this
.
combine
;
if
(
this
.
envMapIntensity
!==
undefined
)
data
.
envMapIntensity
=
this
.
envMapIntensity
;
if
(
this
.
envMapIntensity
!==
undefined
)
data
.
envMapIntensity
=
this
.
envMapIntensity
;
...
@@ -240,13 +241,13 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
...
@@ -240,13 +241,13 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
data
.
depthWrite
=
this
.
depthWrite
;
data
.
depthWrite
=
this
.
depthWrite
;
// rotation (SpriteMaterial)
// rotation (SpriteMaterial)
if
(
this
.
rotation
!==
0
)
data
.
rotation
=
this
.
rotation
;
if
(
this
.
rotation
&&
this
.
rotation
!==
0
)
data
.
rotation
=
this
.
rotation
;
if
(
this
.
polygonOffset
===
true
)
data
.
polygonOffset
=
true
;
if
(
this
.
polygonOffset
===
true
)
data
.
polygonOffset
=
true
;
if
(
this
.
polygonOffsetFactor
!==
0
)
data
.
polygonOffsetFactor
=
this
.
polygonOffsetFactor
;
if
(
this
.
polygonOffsetFactor
!==
0
)
data
.
polygonOffsetFactor
=
this
.
polygonOffsetFactor
;
if
(
this
.
polygonOffsetUnits
!==
0
)
data
.
polygonOffsetUnits
=
this
.
polygonOffsetUnits
;
if
(
this
.
polygonOffsetUnits
!==
0
)
data
.
polygonOffsetUnits
=
this
.
polygonOffsetUnits
;
if
(
this
.
linewidth
!==
1
)
data
.
linewidth
=
this
.
linewidth
;
if
(
this
.
linewidth
&&
this
.
linewidth
!==
1
)
data
.
linewidth
=
this
.
linewidth
;
if
(
this
.
dashSize
!==
undefined
)
data
.
dashSize
=
this
.
dashSize
;
if
(
this
.
dashSize
!==
undefined
)
data
.
dashSize
=
this
.
dashSize
;
if
(
this
.
gapSize
!==
undefined
)
data
.
gapSize
=
this
.
gapSize
;
if
(
this
.
gapSize
!==
undefined
)
data
.
gapSize
=
this
.
gapSize
;
if
(
this
.
scale
!==
undefined
)
data
.
scale
=
this
.
scale
;
if
(
this
.
scale
!==
undefined
)
data
.
scale
=
this
.
scale
;
...
@@ -262,6 +263,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
...
@@ -262,6 +263,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
if
(
this
.
wireframeLinejoin
!==
'
round
'
)
data
.
wireframeLinejoin
=
this
.
wireframeLinejoin
;
if
(
this
.
wireframeLinejoin
!==
'
round
'
)
data
.
wireframeLinejoin
=
this
.
wireframeLinejoin
;
if
(
this
.
morphTargets
===
true
)
data
.
morphTargets
=
true
;
if
(
this
.
morphTargets
===
true
)
data
.
morphTargets
=
true
;
if
(
this
.
morphNormals
===
true
)
data
.
morphNormals
=
true
;
if
(
this
.
skinning
===
true
)
data
.
skinning
=
true
;
if
(
this
.
skinning
===
true
)
data
.
skinning
=
true
;
if
(
this
.
visible
===
false
)
data
.
visible
=
false
;
if
(
this
.
visible
===
false
)
data
.
visible
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录