Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
d1e8efae
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,发现更多精彩内容 >>
提交
d1e8efae
编写于
5月 28, 2019
作者:
A
aardgoose
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use new hash value
上级
55d8eb49
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
32 addition
and
38 deletion
+32
-38
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+4
-24
src/renderers/webgl/WebGLLights.js
src/renderers/webgl/WebGLLights.js
+28
-14
未找到文件。
src/renderers/WebGLRenderer.js
浏览文件 @
d1e8efae
...
...
@@ -1463,20 +1463,10 @@ function WebGLRenderer( parameters ) {
releaseMaterialProgramReference
(
material
);
}
else
if
(
lightsHash
.
stateID
!==
lightsStateHash
.
stateID
||
lightsHash
.
directionalLength
!==
lightsStateHash
.
directionalLength
||
lightsHash
.
pointLength
!==
lightsStateHash
.
pointLength
||
lightsHash
.
spotLength
!==
lightsStateHash
.
spotLength
||
lightsHash
.
rectAreaLength
!==
lightsStateHash
.
rectAreaLength
||
lightsHash
.
hemiLength
!==
lightsStateHash
.
hemiLength
||
lightsHash
.
shadowsLength
!==
lightsStateHash
.
shadowsLength
)
{
lightsHash
.
value
!==
lightsStateHash
.
directionalLength
)
{
lightsHash
.
stateID
=
lightsStateHash
.
stateID
;
lightsHash
.
directionalLength
=
lightsStateHash
.
directionalLength
;
lightsHash
.
pointLength
=
lightsStateHash
.
pointLength
;
lightsHash
.
spotLength
=
lightsStateHash
.
spotLength
;
lightsHash
.
rectAreaLength
=
lightsStateHash
.
rectAreaLength
;
lightsHash
.
hemiLength
=
lightsStateHash
.
hemiLength
;
lightsHash
.
shadowsLength
=
lightsStateHash
.
shadowsLength
;
lightsHash
.
value
=
lightsStateHash
.
value
;
programChange
=
false
;
...
...
@@ -1584,12 +1574,7 @@ function WebGLRenderer( parameters ) {
}
lightsHash
.
stateID
=
lightsStateHash
.
stateID
;
lightsHash
.
directionalLength
=
lightsStateHash
.
directionalLength
;
lightsHash
.
pointLength
=
lightsStateHash
.
pointLength
;
lightsHash
.
spotLength
=
lightsStateHash
.
spotLength
;
lightsHash
.
rectAreaLength
=
lightsStateHash
.
rectAreaLength
;
lightsHash
.
hemiLength
=
lightsStateHash
.
hemiLength
;
lightsHash
.
shadowsLength
=
lightsStateHash
.
shadowsLength
;
lightsHash
.
value
=
lightsStateHash
.
value
;
if
(
material
.
lights
)
{
...
...
@@ -1661,12 +1646,7 @@ function WebGLRenderer( parameters ) {
material
.
needsUpdate
=
true
;
}
else
if
(
material
.
lights
&&
(
lightsHash
.
stateID
!==
lightsStateHash
.
stateID
||
lightsHash
.
directionalLength
!==
lightsStateHash
.
directionalLength
||
lightsHash
.
pointLength
!==
lightsStateHash
.
pointLength
||
lightsHash
.
spotLength
!==
lightsStateHash
.
spotLength
||
lightsHash
.
rectAreaLength
!==
lightsStateHash
.
rectAreaLength
||
lightsHash
.
hemiLength
!==
lightsStateHash
.
hemiLength
||
lightsHash
.
shadowsLength
!==
lightsStateHash
.
shadowsLength
)
)
{
lightsHash
.
value
!==
lightsStateHash
.
value
)
)
{
material
.
needsUpdate
=
true
;
...
...
src/renderers/webgl/WebGLLights.js
浏览文件 @
d1e8efae
...
...
@@ -117,7 +117,8 @@ function WebGLLights() {
spotLength
:
-
1
,
rectAreaLength
:
-
1
,
hemiLength
:
-
1
,
shadowsLength
:
-
1
shadowsLength
:
-
1
,
value
:
0
},
ambient
:
[
0
,
0
,
0
],
...
...
@@ -331,19 +332,32 @@ function WebGLLights() {
state
.
ambient
[
1
]
=
g
;
state
.
ambient
[
2
]
=
b
;
var
hash
=
state
.
hash
;
if
(
hash
.
directionalLength
!==
directionalLength
||
hash
.
pointLength
!==
pointLength
||
hash
.
spotLength
!==
spotLength
||
hash
.
rectAreaLength
!==
rectAreaLength
||
hash
.
hemiLength
!==
hemiLength
||
hash
.
shadowsLength
!==
shadows
.
length
)
{
state
.
directional
.
length
=
directionalLength
;
state
.
spot
.
length
=
spotLength
;
state
.
rectArea
.
length
=
rectAreaLength
;
state
.
point
.
length
=
pointLength
;
state
.
hemi
.
length
=
hemiLength
;
state
.
hash
.
stateID
=
state
.
id
;
state
.
hash
.
directionalLength
=
directionalLength
;
state
.
hash
.
pointLength
=
pointLength
;
state
.
hash
.
spotLength
=
spotLength
;
state
.
hash
.
rectAreaLength
=
rectAreaLength
;
state
.
hash
.
hemiLength
=
hemiLength
;
state
.
hash
.
shadowsLength
=
shadows
.
length
;
hash
.
stateID
=
state
.
id
;
hash
.
directionalLength
=
directionalLength
;
hash
.
pointLength
=
pointLength
;
hash
.
spotLength
=
spotLength
;
hash
.
rectAreaLength
=
rectAreaLength
;
hash
.
hemiLength
=
hemiLength
;
hash
.
shadowsLength
=
shadows
.
length
;
hash
.
value
++
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录