Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
bb13087a
T
three.js
项目概览
Ablesons
/
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,发现更多精彩内容 >>
提交
bb13087a
编写于
11月 18, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
cffefa4b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
11 deletion
+12
-11
build/three.js
build/three.js
+1
-0
build/three.min.js
build/three.min.js
+11
-11
未找到文件。
build/three.js
浏览文件 @
bb13087a
...
...
@@ -22415,6 +22415,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( material instanceof THREE.MeshPhongMaterial ||
material instanceof THREE.MeshLambertMaterial ||
material instanceof THREE.MeshBasicMaterial ||
material instanceof THREE.ShaderMaterial ||
material.skinning ) {
...
...
build/three.min.js
浏览文件 @
bb13087a
...
...
@@ -489,17 +489,17 @@ Z=I}var R={precision:Y,supportsVertexTextures:sc,map:!!d.map,envMap:!!d.envMap,l
maxMorphNormals
:
H
.
maxMorphNormals
,
maxDirLights
:
f
,
maxPointLights
:
g
,
maxSpotLights
:
h
,
maxHemiLights
:
k
,
maxShadows
:
x
,
shadowMapEnabled
:
H
.
shadowMapEnabled
&&
e
.
receiveShadow
&&
0
<
x
,
shadowMapType
:
H
.
shadowMapType
,
shadowMapDebug
:
H
.
shadowMapDebug
,
shadowMapCascade
:
H
.
shadowMapCascade
,
alphaTest
:
d
.
alphaTest
,
metal
:
d
.
metal
,
wrapAround
:
d
.
wrapAround
,
doubleSided
:
d
.
side
===
THREE
.
DoubleSide
,
flipSided
:
d
.
side
===
THREE
.
BackSide
},
O
=
[];
m
?
O
.
push
(
m
):(
O
.
push
(
d
.
fragmentShader
),
O
.
push
(
d
.
vertexShader
));
if
(
void
0
!==
d
.
defines
)
for
(
var
T
in
d
.
defines
)
O
.
push
(
T
),
O
.
push
(
d
.
defines
[
T
]);
for
(
T
in
R
)
O
.
push
(
T
),
O
.
push
(
R
[
T
]);
for
(
var
P
=
O
.
join
(),
V
,
eb
=
0
,
da
=
cb
.
length
;
eb
<
da
;
eb
++
){
var
ob
=
cb
[
eb
];
if
(
ob
.
code
===
P
){
V
=
ob
;
V
.
usedTimes
++
;
break
}}
void
0
===
V
&&
(
V
=
new
THREE
.
WebGLProgram
(
H
,
P
,
d
,
R
),
cb
.
push
(
V
),
H
.
info
.
memory
.
programs
=
cb
.
length
);
d
.
program
=
V
;
var
db
=
V
.
attributes
;
if
(
d
.
morphTargets
){
d
.
numSupportedMorphTargets
=
0
;
for
(
var
ha
,
oa
=
"
morphTarget
"
,
bb
=
0
;
bb
<
H
.
maxMorphTargets
;
bb
++
)
ha
=
oa
+
bb
,
0
<=
db
[
ha
]
&&
d
.
numSupportedMorphTargets
++
}
if
(
d
.
morphNormals
)
for
(
d
.
numSupportedMorphNormals
=
0
,
oa
=
"
morphNormal
"
,
bb
=
0
;
bb
<
H
.
maxMorphNormals
;
bb
++
)
ha
=
oa
+
bb
,
0
<=
db
[
ha
]
&&
d
.
numSupportedMorphNormals
++
;
d
.
uniformsList
=
[];
for
(
var
ya
in
d
.
__webglShader
.
uniforms
){
var
za
=
d
.
program
.
uniforms
[
ya
];
za
&&
d
.
uniformsList
.
push
([
d
.
__webglShader
.
uniforms
[
ya
],
za
])}
d
.
needsUpdate
=!
1
}
d
.
morphTargets
&&!
e
.
__webglMorphTargetInfluences
&&
(
e
.
__webglMorphTargetInfluences
=
new
Float32Array
(
H
.
maxMorphTargets
));
var
ba
=!
1
,
aa
=!
1
,
$
=!
1
,
yb
=
d
.
program
,
pa
=
yb
.
uniforms
,
N
=
d
.
__webglShader
.
uniforms
;
yb
.
id
!==
tc
&&
(
l
.
useProgram
(
yb
.
program
),
tc
=
yb
.
id
,
$
=
aa
=
ba
=!
0
);
d
.
id
!==
Jb
&&
(
-
1
===
Jb
&&
(
$
=!
0
),
Jb
=
d
.
id
,
aa
=!
0
);
if
(
ba
||
a
!==
dc
)
l
.
uniformMatrix4fv
(
pa
.
projectionMatrix
,
!
1
,
a
.
projectionMatrix
.
elements
),
xa
&&
l
.
uniform1f
(
pa
.
logDepthBufFC
,
2
/
(
Math
.
log
(
a
.
far
+
1
)
/
Math
.
LN2
)),
a
!==
dc
&&
(
dc
=
a
),(
d
instanceof
THREE
.
ShaderMaterial
||
d
instanceof
THREE
.
MeshPhongMaterial
||
d
.
envMap
)
&&
null
!==
pa
.
cameraPosition
&&
(
Na
.
setFromMatrixPosition
(
a
.
matrixWorld
),
l
.
uniform3f
(
pa
.
cameraPosition
,
Na
.
x
,
Na
.
y
,
Na
.
z
)),(
d
instanceof
THREE
.
MeshPhongMaterial
||
d
instanceof
THREE
.
MeshLambertMaterial
||
d
instanceof
THREE
.
Shader
Material
||
d
.
skinning
)
&&
null
!==
pa
.
viewMatrix
&&
l
.
uniformMatrix4fv
(
pa
.
viewMatrix
,
!
1
,
a
.
matrixWorldInverse
.
elements
);
if
(
d
.
skinning
)
if
(
e
.
bindMatrix
&&
null
!==
pa
.
bindMatrix
&&
l
.
uniformMatrix4fv
(
pa
.
bindMatrix
,
!
1
,
e
.
bindMatrix
.
elements
),
e
.
bindMatrixInverse
&&
null
!==
pa
.
bindMatrixInverse
&&
l
.
uniformMatrix4fv
(
pa
.
bindMatrixInverse
,
!
1
,
e
.
bindMatrixInverse
.
elements
),
ic
&&
e
.
skeleton
&&
e
.
skeleton
.
useVertexTexture
){
if
(
null
!==
pa
.
boneTexture
){
var
Ib
=
M
();
l
.
uniform1i
(
pa
.
boneTexture
,
Ib
);
H
.
setTexture
(
e
.
skeleton
.
boneTexture
,
Ib
)}
null
!==
pa
.
boneTextureWidth
&&
l
.
uniform1i
(
pa
.
boneTextureWidth
,
e
.
skeleton
.
boneTextureWidth
);
null
!==
pa
.
boneTextureHeight
&&
l
.
uniform1i
(
pa
.
boneTextureHeight
,
e
.
skeleton
.
boneTextureHeight
)}
else
e
.
skeleton
&&
e
.
skeleton
.
boneMatrices
&&
null
!==
pa
.
boneGlobalMatrices
&&
l
.
uniformMatrix4fv
(
pa
.
boneGlobalMatrices
,
!
1
,
e
.
skeleton
.
boneMatrices
);
if
(
aa
){
c
&&
d
.
fog
&&
(
N
.
fogColor
.
value
=
c
.
color
,
c
instanceof
THREE
.
Fog
?(
N
.
fogNear
.
value
=
c
.
near
,
N
.
fogFar
.
value
=
c
.
far
):
c
instanceof
THREE
.
FogExp2
&&
(
N
.
fogDensity
.
value
=
c
.
density
));
if
(
d
instanceof
THREE
.
MeshPhongMaterial
||
d
instanceof
THREE
.
MeshLambertMaterial
||
d
.
lights
){
if
(
ec
){
var
$
=!
0
,
ma
,
Ra
,
ja
,
Ca
=
0
,
Ga
=
0
,
Oa
=
0
,
Ba
,
zb
,
Ab
,
Ha
,
Bb
,
Aa
,
ua
=
Mc
,
Cb
=
ua
.
directional
.
colors
,
jb
=
ua
.
directional
.
positions
,
Pb
=
ua
.
point
.
colors
,
Ma
=
ua
.
point
.
positions
,
xb
=
ua
.
point
.
distances
,
Ya
=
ua
.
spot
.
colors
,
Za
=
ua
.
spot
.
positions
,
Lb
=
ua
.
spot
.
distances
,
Qb
=
ua
.
spot
.
directions
,
fb
=
ua
.
spot
.
anglesCos
,
gb
=
ua
.
spot
.
exponents
,
qb
=
ua
.
hemi
.
skyColors
,
rb
=
ua
.
hemi
.
groundColors
,
Db
=
ua
.
hemi
.
positions
,
Sa
=
0
,
Da
=
0
,
Pa
=
0
,
Ka
=
0
,
ka
=
0
,
ra
=
0
,
F
=
0
,
Ia
=
0
,
Qa
=
0
,
sb
=
0
,
hb
=
0
,
Ta
=
0
;
ma
=
0
;
for
(
Ra
=
b
.
length
;
ma
<
Ra
;
ma
++
)
ja
=
b
[
ma
],
ja
.
onlyShadow
||
(
Ba
=
ja
.
color
,
Ha
=
ja
.
intensity
,
Aa
=
ja
.
distance
,
ja
instanceof
THREE
.
AmbientLight
?
ja
.
visible
&&
(
H
.
gammaInput
?(
Ca
+=
Ba
.
r
*
Ba
.
r
,
Ga
+=
Ba
.
g
*
Ba
.
g
,
Oa
+=
Ba
.
b
*
Ba
.
b
):(
Ca
+=
Ba
.
r
,
Ga
+=
Ba
.
g
,
Oa
+=
Ba
.
b
)):
ja
instanceof
THREE
.
DirectionalLight
?(
ka
+=
1
,
ja
.
visible
&&
(
ta
.
setFromMatrixPosition
(
ja
.
matrixWorld
),
Na
.
setFromMatrixPosition
(
ja
.
target
.
matrixWorld
),
ta
.
sub
(
Na
),
ta
.
normalize
(),
Qa
=
3
*
Sa
,
jb
[
Qa
]
=
ta
.
x
,
jb
[
Qa
+
1
]
=
ta
.
y
,
jb
[
Qa
+
2
]
=
ta
.
z
,
H
.
gammaInput
?
C
(
Cb
,
Qa
,
Ba
,
Ha
*
Ha
):
D
(
Cb
,
Qa
,
Ba
,
Ha
),
Sa
+=
1
)):
ja
instanceof
THREE
.
PointLight
?
(
ra
+=
1
,
ja
.
visible
&&
(
sb
=
3
*
Da
,
H
.
gammaInput
?
C
(
Pb
,
sb
,
Ba
,
Ha
*
Ha
):
D
(
Pb
,
sb
,
Ba
,
Ha
),
Na
.
setFromMatrixPosition
(
ja
.
matrixWorld
),
Ma
[
sb
]
=
Na
.
x
,
Ma
[
sb
+
1
]
=
Na
.
y
,
Ma
[
sb
+
2
]
=
Na
.
z
,
xb
[
Da
]
=
Aa
,
Da
+=
1
)):
ja
instanceof
THREE
.
SpotLight
?(
F
+=
1
,
ja
.
visible
&&
(
hb
=
3
*
Pa
,
H
.
gammaInput
?
C
(
Ya
,
hb
,
Ba
,
Ha
*
Ha
):
D
(
Ya
,
hb
,
Ba
,
Ha
),
ta
.
setFromMatrixPosition
(
ja
.
matrixWorld
),
Za
[
hb
]
=
ta
.
x
,
Za
[
hb
+
1
]
=
ta
.
y
,
Za
[
hb
+
2
]
=
ta
.
z
,
Lb
[
Pa
]
=
Aa
,
Na
.
setFromMatrixPosition
(
ja
.
target
.
matrixWorld
),
ta
.
sub
(
Na
),
ta
.
normalize
(),
Qb
[
hb
]
=
ta
.
x
,
Qb
[
hb
+
1
]
=
ta
.
y
,
Qb
[
hb
+
2
]
=
ta
.
z
,
fb
[
Pa
]
=
Math
.
cos
(
ja
.
angle
),
gb
[
Pa
]
=
ja
.
exponent
,
Pa
+=
1
)):
ja
instanceof
THREE
.
HemisphereLight
&&
(
Ia
+=
1
,
ja
.
visible
&&
(
ta
.
setFromMatrixPosition
(
ja
.
matrixWorld
),
ta
.
normalize
(),
Ta
=
3
*
Ka
,
Db
[
Ta
]
=
ta
.
x
,
Db
[
Ta
+
1
]
=
ta
.
y
,
Db
[
Ta
+
2
]
=
ta
.
z
,
zb
=
ja
.
color
,
Ab
=
ja
.
groundColor
,
H
.
gammaInput
?(
Bb
=
Ha
*
Ha
,
C
(
qb
,
Ta
,
zb
,
Bb
),
C
(
rb
,
Ta
,
Ab
,
Bb
)):(
D
(
qb
,
Ta
,
zb
,
Ha
),
D
(
rb
,
Ta
,
Ab
,
Ha
)),
Ka
+=
1
)));
ma
=
3
*
Sa
;
for
(
Ra
=
Math
.
max
(
Cb
.
length
,
3
*
ka
);
ma
<
Ra
;
ma
++
)
Cb
[
ma
]
=
0
;
ma
=
3
*
Da
;
for
(
Ra
=
Math
.
max
(
Pb
.
length
,
3
*
ra
);
ma
<
Ra
;
ma
++
)
Pb
[
ma
]
=
0
;
ma
=
3
*
Pa
;
for
(
Ra
=
Math
.
max
(
Ya
.
length
,
3
*
F
);
ma
<
Ra
;
ma
++
)
Ya
[
ma
]
=
0
;
ma
=
3
*
Ka
;
for
(
Ra
=
Math
.
max
(
qb
.
length
,
3
*
Ia
);
ma
<
Ra
;
ma
++
)
qb
[
ma
]
=
0
;
ma
=
3
*
Ka
;
for
(
Ra
=
Math
.
max
(
rb
.
length
,
3
*
Ia
);
ma
<
Ra
;
ma
++
)
rb
[
ma
]
=
0
;
ua
.
directional
.
length
=
Sa
;
ua
.
point
.
length
=
Da
;
ua
.
spot
.
length
=
Pa
;
ua
.
hemi
.
length
=
Ka
;
ua
.
ambient
[
0
]
=
Ca
;
ua
.
ambient
[
1
]
=
Ga
;
ua
.
ambient
[
2
]
=
Oa
;
ec
=!
1
}
if
(
$
){
var
qa
=
Mc
;
N
.
ambientLightColor
.
value
=
qa
.
ambient
;
N
.
directionalLightColor
.
value
=
qa
.
directional
.
colors
;
N
.
directionalLightDirection
.
value
=
qa
.
directional
.
positions
;
N
.
pointLightColor
.
value
=
qa
.
point
.
colors
;
N
.
pointLightPosition
.
value
=
qa
.
point
.
positions
;
N
.
pointLightDistance
.
value
=
qa
.
point
.
distances
;
N
.
spotLightColor
.
value
=
qa
.
spot
.
colors
;
N
.
spotLightPosition
.
value
=
qa
.
spot
.
positions
;
N
.
spotLightDistance
.
value
=
qa
.
spot
.
distances
;
N
.
spotLightDirection
.
value
=
qa
.
spot
.
directions
;
N
.
spotLightAngleCos
.
value
=
qa
.
spot
.
anglesCos
;
N
.
spotLightExponent
.
value
=
qa
.
spot
.
exponents
;
N
.
hemisphereLightSkyColor
.
value
=
qa
.
hemi
.
skyColors
;
N
.
hemisphereLightGroundColor
.
value
=
qa
.
hemi
.
groundColors
;
N
.
hemisphereLightDirection
.
value
=
qa
.
hemi
.
positions
;
w
(
N
,
!
0
)}
else
w
(
N
,
!
1
)}
if
(
d
instanceof
THREE
.
MeshBasicMaterial
||
d
instanceof
THREE
.
Mesh
LambertMaterial
||
d
instanceof
THREE
.
MeshPhongMaterial
){
N
.
opacity
.
value
=
d
.
opacity
;
H
.
gammaInput
?
N
.
diffuse
.
value
.
copyGammaToLinear
(
d
.
color
):
N
.
diffuse
.
value
=
d
.
color
;
N
.
map
.
value
=
d
.
map
;
N
.
lightMap
.
value
=
d
.
lightMap
;
N
.
specularMap
.
value
=
d
.
specularMap
;
N
.
alphaMap
.
value
=
d
.
alphaMap
;
d
.
bumpMap
&&
(
N
.
bumpMap
.
value
=
d
.
bumpMap
,
N
.
bumpScale
.
value
=
d
.
bumpScale
);
d
.
normalMap
&&
(
N
.
normalMap
.
value
=
d
.
normalMap
,
N
.
normalScale
.
value
.
copy
(
d
.
normalScale
));
var
La
;
d
.
map
?
La
=
d
.
map
:
d
.
specularMap
?
La
=
d
.
specularMap
:
d
.
normalMap
?
La
=
d
.
normalMap
:
d
.
bumpMap
?
La
=
d
.
bumpMap
:
d
.
alphaMap
&&
(
La
=
d
.
alphaMap
);
if
(
void
0
!==
La
){
var
Ua
=
La
.
offset
,
Va
=
La
.
repeat
;
N
.
offsetRepeat
.
value
.
set
(
Ua
.
x
,
Ua
.
y
,
Va
.
x
,
Va
.
y
)}
N
.
envMap
.
value
=
d
.
envMap
;
N
.
flipEnvMap
.
value
=
d
.
envMap
instanceof
THREE
.
WebGLRenderTargetCube
?
1
:
-
1
;
N
.
reflectivity
.
value
=
d
.
reflectivity
;
N
.
refractionRatio
.
value
=
d
.
refractionRatio
;
N
.
combine
.
value
=
d
.
combine
;
N
.
useRefract
.
value
=
d
.
envMap
&&
(
d
.
envMap
.
mapping
===
THREE
.
CubeRefractionMapping
||
d
.
envMap
.
mapping
===
THREE
.
EquirectangularRefractionMapping
)}
d
instanceof
Jb
&&
(
-
1
===
Jb
&&
(
$
=!
0
),
Jb
=
d
.
id
,
aa
=!
0
);
if
(
ba
||
a
!==
dc
)
l
.
uniformMatrix4fv
(
pa
.
projectionMatrix
,
!
1
,
a
.
projectionMatrix
.
elements
),
xa
&&
l
.
uniform1f
(
pa
.
logDepthBufFC
,
2
/
(
Math
.
log
(
a
.
far
+
1
)
/
Math
.
LN2
)),
a
!==
dc
&&
(
dc
=
a
),(
d
instanceof
THREE
.
ShaderMaterial
||
d
instanceof
THREE
.
MeshPhongMaterial
||
d
.
envMap
)
&&
null
!==
pa
.
cameraPosition
&&
(
Na
.
setFromMatrixPosition
(
a
.
matrixWorld
),
l
.
uniform3f
(
pa
.
cameraPosition
,
Na
.
x
,
Na
.
y
,
Na
.
z
)),(
d
instanceof
THREE
.
MeshPhongMaterial
||
d
instanceof
THREE
.
MeshLambertMaterial
||
d
instanceof
THREE
.
MeshBasic
Material
||
d
instanceof
THREE
.
ShaderMaterial
||
d
.
skinning
)
&&
null
!==
pa
.
viewMatrix
&&
l
.
uniformMatrix4fv
(
pa
.
viewMatrix
,
!
1
,
a
.
matrixWorldInverse
.
elements
);
if
(
d
.
skinning
)
if
(
e
.
bindMatrix
&&
null
!==
pa
.
bindMatrix
&&
l
.
uniformMatrix4fv
(
pa
.
bindMatrix
,
!
1
,
e
.
bindMatrix
.
elements
),
e
.
bindMatrixInverse
&&
null
!==
pa
.
bindMatrixInverse
&&
l
.
uniformMatrix4fv
(
pa
.
bindMatrixInverse
,
!
1
,
e
.
bindMatrixInverse
.
elements
),
ic
&&
e
.
skeleton
&&
e
.
skeleton
.
useVertexTexture
){
if
(
null
!==
pa
.
boneTexture
){
var
Ib
=
M
();
l
.
uniform1i
(
pa
.
boneTexture
,
Ib
);
H
.
setTexture
(
e
.
skeleton
.
boneTexture
,
Ib
)}
null
!==
pa
.
boneTextureWidth
&&
l
.
uniform1i
(
pa
.
boneTextureWidth
,
e
.
skeleton
.
boneTextureWidth
);
null
!==
pa
.
boneTextureHeight
&&
l
.
uniform1i
(
pa
.
boneTextureHeight
,
e
.
skeleton
.
boneTextureHeight
)}
else
e
.
skeleton
&&
e
.
skeleton
.
boneMatrices
&&
null
!==
pa
.
boneGlobalMatrices
&&
l
.
uniformMatrix4fv
(
pa
.
boneGlobalMatrices
,
!
1
,
e
.
skeleton
.
boneMatrices
);
if
(
aa
){
c
&&
d
.
fog
&&
(
N
.
fogColor
.
value
=
c
.
color
,
c
instanceof
THREE
.
Fog
?(
N
.
fogNear
.
value
=
c
.
near
,
N
.
fogFar
.
value
=
c
.
far
):
c
instanceof
THREE
.
FogExp2
&&
(
N
.
fogDensity
.
value
=
c
.
density
));
if
(
d
instanceof
THREE
.
MeshPhongMaterial
||
d
instanceof
THREE
.
MeshLambertMaterial
||
d
.
lights
){
if
(
ec
){
var
$
=!
0
,
ma
,
Ra
,
ja
,
Ca
=
0
,
Ga
=
0
,
Oa
=
0
,
Ba
,
zb
,
Ab
,
Ha
,
Bb
,
Aa
,
ua
=
Mc
,
Cb
=
ua
.
directional
.
colors
,
jb
=
ua
.
directional
.
positions
,
Pb
=
ua
.
point
.
colors
,
Ma
=
ua
.
point
.
positions
,
xb
=
ua
.
point
.
distances
,
Ya
=
ua
.
spot
.
colors
,
Za
=
ua
.
spot
.
positions
,
Lb
=
ua
.
spot
.
distances
,
Qb
=
ua
.
spot
.
directions
,
fb
=
ua
.
spot
.
anglesCos
,
gb
=
ua
.
spot
.
exponents
,
qb
=
ua
.
hemi
.
skyColors
,
rb
=
ua
.
hemi
.
groundColors
,
Db
=
ua
.
hemi
.
positions
,
Sa
=
0
,
Da
=
0
,
Pa
=
0
,
Ka
=
0
,
ka
=
0
,
ra
=
0
,
F
=
0
,
Ia
=
0
,
Qa
=
0
,
sb
=
0
,
hb
=
0
,
Ta
=
0
;
ma
=
0
;
for
(
Ra
=
b
.
length
;
ma
<
Ra
;
ma
++
)
ja
=
b
[
ma
],
ja
.
onlyShadow
||
(
Ba
=
ja
.
color
,
Ha
=
ja
.
intensity
,
Aa
=
ja
.
distance
,
ja
instanceof
THREE
.
AmbientLight
?
ja
.
visible
&&
(
H
.
gammaInput
?(
Ca
+=
Ba
.
r
*
Ba
.
r
,
Ga
+=
Ba
.
g
*
Ba
.
g
,
Oa
+=
Ba
.
b
*
Ba
.
b
):(
Ca
+=
Ba
.
r
,
Ga
+=
Ba
.
g
,
Oa
+=
Ba
.
b
)):
ja
instanceof
THREE
.
DirectionalLight
?(
ka
+=
1
,
ja
.
visible
&&
(
ta
.
setFromMatrixPosition
(
ja
.
matrixWorld
),
Na
.
setFromMatrixPosition
(
ja
.
target
.
matrixWorld
),
ta
.
sub
(
Na
),
ta
.
normalize
(),
Qa
=
3
*
Sa
,
jb
[
Qa
]
=
ta
.
x
,
jb
[
Qa
+
1
]
=
ta
.
y
,
jb
[
Qa
+
2
]
=
ta
.
z
,
H
.
gammaInput
?
C
(
Cb
,
Qa
,
Ba
,
Ha
*
Ha
):
D
(
Cb
,
Qa
,
Ba
,
Ha
),
Sa
+=
1
)):
ja
instanceof
THREE
.
PointLight
?(
ra
+=
1
,
ja
.
visible
&&
(
sb
=
3
*
Da
,
H
.
gammaInput
?
C
(
Pb
,
sb
,
Ba
,
Ha
*
Ha
):
D
(
Pb
,
sb
,
Ba
,
Ha
),
Na
.
setFromMatrixPosition
(
ja
.
matrixWorld
),
Ma
[
sb
]
=
Na
.
x
,
Ma
[
sb
+
1
]
=
Na
.
y
,
Ma
[
sb
+
2
]
=
Na
.
z
,
xb
[
Da
]
=
Aa
,
Da
+=
1
)):
ja
instanceof
THREE
.
SpotLight
?(
F
+=
1
,
ja
.
visible
&&
(
hb
=
3
*
Pa
,
H
.
gammaInput
?
C
(
Ya
,
hb
,
Ba
,
Ha
*
Ha
):
D
(
Ya
,
hb
,
Ba
,
Ha
),
ta
.
setFromMatrixPosition
(
ja
.
matrixWorld
),
Za
[
hb
]
=
ta
.
x
,
Za
[
hb
+
1
]
=
ta
.
y
,
Za
[
hb
+
2
]
=
ta
.
z
,
Lb
[
Pa
]
=
Aa
,
Na
.
setFromMatrixPosition
(
ja
.
target
.
matrixWorld
),
ta
.
sub
(
Na
),
ta
.
normalize
(),
Qb
[
hb
]
=
ta
.
x
,
Qb
[
hb
+
1
]
=
ta
.
y
,
Qb
[
hb
+
2
]
=
ta
.
z
,
fb
[
Pa
]
=
Math
.
cos
(
ja
.
angle
),
gb
[
Pa
]
=
ja
.
exponent
,
Pa
+=
1
)):
ja
instanceof
THREE
.
HemisphereLight
&&
(
Ia
+=
1
,
ja
.
visible
&&
(
ta
.
setFromMatrixPosition
(
ja
.
matrixWorld
),
ta
.
normalize
(),
Ta
=
3
*
Ka
,
Db
[
Ta
]
=
ta
.
x
,
Db
[
Ta
+
1
]
=
ta
.
y
,
Db
[
Ta
+
2
]
=
ta
.
z
,
zb
=
ja
.
color
,
Ab
=
ja
.
groundColor
,
H
.
gammaInput
?(
Bb
=
Ha
*
Ha
,
C
(
qb
,
Ta
,
zb
,
Bb
),
C
(
rb
,
Ta
,
Ab
,
Bb
)):(
D
(
qb
,
Ta
,
zb
,
Ha
),
D
(
rb
,
Ta
,
Ab
,
Ha
)),
Ka
+=
1
)));
ma
=
3
*
Sa
;
for
(
Ra
=
Math
.
max
(
Cb
.
length
,
3
*
ka
);
ma
<
Ra
;
ma
++
)
Cb
[
ma
]
=
0
;
ma
=
3
*
Da
;
for
(
Ra
=
Math
.
max
(
Pb
.
length
,
3
*
ra
);
ma
<
Ra
;
ma
++
)
Pb
[
ma
]
=
0
;
ma
=
3
*
Pa
;
for
(
Ra
=
Math
.
max
(
Ya
.
length
,
3
*
F
);
ma
<
Ra
;
ma
++
)
Ya
[
ma
]
=
0
;
ma
=
3
*
Ka
;
for
(
Ra
=
Math
.
max
(
qb
.
length
,
3
*
Ia
);
ma
<
Ra
;
ma
++
)
qb
[
ma
]
=
0
;
ma
=
3
*
Ka
;
for
(
Ra
=
Math
.
max
(
rb
.
length
,
3
*
Ia
);
ma
<
Ra
;
ma
++
)
rb
[
ma
]
=
0
;
ua
.
directional
.
length
=
Sa
;
ua
.
point
.
length
=
Da
;
ua
.
spot
.
length
=
Pa
;
ua
.
hemi
.
length
=
Ka
;
ua
.
ambient
[
0
]
=
Ca
;
ua
.
ambient
[
1
]
=
Ga
;
ua
.
ambient
[
2
]
=
Oa
;
ec
=!
1
}
if
(
$
){
var
qa
=
Mc
;
N
.
ambientLightColor
.
value
=
qa
.
ambient
;
N
.
directionalLightColor
.
value
=
qa
.
directional
.
colors
;
N
.
directionalLightDirection
.
value
=
qa
.
directional
.
positions
;
N
.
pointLightColor
.
value
=
qa
.
point
.
colors
;
N
.
pointLightPosition
.
value
=
qa
.
point
.
positions
;
N
.
pointLightDistance
.
value
=
qa
.
point
.
distances
;
N
.
spotLightColor
.
value
=
qa
.
spot
.
colors
;
N
.
spotLightPosition
.
value
=
qa
.
spot
.
positions
;
N
.
spotLightDistance
.
value
=
qa
.
spot
.
distances
;
N
.
spotLightDirection
.
value
=
qa
.
spot
.
directions
;
N
.
spotLightAngleCos
.
value
=
qa
.
spot
.
anglesCos
;
N
.
spotLightExponent
.
value
=
qa
.
spot
.
exponents
;
N
.
hemisphereLightSkyColor
.
value
=
qa
.
hemi
.
skyColors
;
N
.
hemisphereLightGroundColor
.
value
=
qa
.
hemi
.
groundColors
;
N
.
hemisphereLightDirection
.
value
=
qa
.
hemi
.
positions
;
w
(
N
,
!
0
)}
else
w
(
N
,
!
1
)}
if
(
d
instanceof
THREE
.
Mesh
BasicMaterial
||
d
instanceof
THREE
.
MeshLambertMaterial
||
d
instanceof
THREE
.
MeshPhongMaterial
){
N
.
opacity
.
value
=
d
.
opacity
;
H
.
gammaInput
?
N
.
diffuse
.
value
.
copyGammaToLinear
(
d
.
color
):
N
.
diffuse
.
value
=
d
.
color
;
N
.
map
.
value
=
d
.
map
;
N
.
lightMap
.
value
=
d
.
lightMap
;
N
.
specularMap
.
value
=
d
.
specularMap
;
N
.
alphaMap
.
value
=
d
.
alphaMap
;
d
.
bumpMap
&&
(
N
.
bumpMap
.
value
=
d
.
bumpMap
,
N
.
bumpScale
.
value
=
d
.
bumpScale
);
d
.
normalMap
&&
(
N
.
normalMap
.
value
=
d
.
normalMap
,
N
.
normalScale
.
value
.
copy
(
d
.
normalScale
));
var
La
;
d
.
map
?
La
=
d
.
map
:
d
.
specularMap
?
La
=
d
.
specularMap
:
d
.
normalMap
?
La
=
d
.
normalMap
:
d
.
bumpMap
?
La
=
d
.
bumpMap
:
d
.
alphaMap
&&
(
La
=
d
.
alphaMap
);
if
(
void
0
!==
La
){
var
Ua
=
La
.
offset
,
Va
=
La
.
repeat
;
N
.
offsetRepeat
.
value
.
set
(
Ua
.
x
,
Ua
.
y
,
Va
.
x
,
Va
.
y
)}
N
.
envMap
.
value
=
d
.
envMap
;
N
.
flipEnvMap
.
value
=
d
.
envMap
instanceof
THREE
.
WebGLRenderTargetCube
?
1
:
-
1
;
N
.
reflectivity
.
value
=
d
.
reflectivity
;
N
.
refractionRatio
.
value
=
d
.
refractionRatio
;
N
.
combine
.
value
=
d
.
combine
;
N
.
useRefract
.
value
=
d
.
envMap
&&
(
d
.
envMap
.
mapping
===
THREE
.
CubeRefractionMapping
||
d
.
envMap
.
mapping
===
THREE
.
EquirectangularRefractionMapping
)}
d
instanceof
THREE
.
LineBasicMaterial
?(
N
.
diffuse
.
value
=
d
.
color
,
N
.
opacity
.
value
=
d
.
opacity
):
d
instanceof
THREE
.
LineDashedMaterial
?(
N
.
diffuse
.
value
=
d
.
color
,
N
.
opacity
.
value
=
d
.
opacity
,
N
.
dashSize
.
value
=
d
.
dashSize
,
N
.
totalSize
.
value
=
d
.
dashSize
+
d
.
gapSize
,
N
.
scale
.
value
=
d
.
scale
):
d
instanceof
THREE
.
PointCloudMaterial
?(
N
.
psColor
.
value
=
d
.
color
,
N
.
opacity
.
value
=
d
.
opacity
,
N
.
size
.
value
=
d
.
size
,
N
.
scale
.
value
=
J
.
height
/
2
,
N
.
map
.
value
=
d
.
map
):
d
instanceof
THREE
.
MeshPhongMaterial
?(
N
.
shininess
.
value
=
d
.
shininess
,
H
.
gammaInput
?(
N
.
ambient
.
value
.
copyGammaToLinear
(
d
.
ambient
),
N
.
emissive
.
value
.
copyGammaToLinear
(
d
.
emissive
),
N
.
specular
.
value
.
copyGammaToLinear
(
d
.
specular
)):(
N
.
ambient
.
value
=
d
.
ambient
,
N
.
emissive
.
value
=
d
.
emissive
,
N
.
specular
.
value
=
d
.
specular
),
d
.
wrapAround
&&
N
.
wrapRGB
.
value
.
copy
(
d
.
wrapRGB
)):
d
instanceof
THREE
.
MeshLambertMaterial
?(
H
.
gammaInput
?(
N
.
ambient
.
value
.
copyGammaToLinear
(
d
.
ambient
),
N
.
emissive
.
value
.
copyGammaToLinear
(
d
.
emissive
)):(
N
.
ambient
.
value
=
d
.
ambient
,
N
.
emissive
.
value
=
d
.
emissive
),
d
.
wrapAround
&&
N
.
wrapRGB
.
value
.
copy
(
d
.
wrapRGB
)):
d
instanceof
THREE
.
MeshDepthMaterial
?
(
N
.
mNear
.
value
=
a
.
near
,
N
.
mFar
.
value
=
a
.
far
,
N
.
opacity
.
value
=
d
.
opacity
):
d
instanceof
THREE
.
MeshNormalMaterial
&&
(
N
.
opacity
.
value
=
d
.
opacity
);
if
(
e
.
receiveShadow
&&!
d
.
_shadowPass
&&
N
.
shadowMatrix
)
for
(
var
Eb
=
0
,
pb
=
0
,
Mb
=
b
.
length
;
pb
<
Mb
;
pb
++
){
var
z
=
b
[
pb
];
z
.
castShadow
&&
(
z
instanceof
THREE
.
SpotLight
||
z
instanceof
THREE
.
DirectionalLight
&&!
z
.
shadowCascade
)
&&
(
N
.
shadowMap
.
value
[
Eb
]
=
z
.
shadowMap
,
N
.
shadowMapSize
.
value
[
Eb
]
=
z
.
shadowMapSize
,
N
.
shadowMatrix
.
value
[
Eb
]
=
z
.
shadowMatrix
,
N
.
shadowDarkness
.
value
[
Eb
]
=
z
.
shadowDarkness
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录