Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
7d3e4825
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,发现更多精彩内容 >>
提交
7d3e4825
编写于
10月 08, 2011
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'alteredq/dev' into dev
上级
b66c1e57
51b6db1c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
4 deletion
+12
-4
build/Three.js
build/Three.js
+1
-1
build/custom/ThreeWebGL.js
build/custom/ThreeWebGL.js
+1
-1
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+10
-2
未找到文件。
build/Three.js
浏览文件 @
7d3e4825
...
...
@@ -236,7 +236,7 @@ n);else if(x=="v3v"){if(!w._array)w._array=new Float32Array(3*n.length);x=0;for(
n
),
v
=
w
.
texture
)
if
(
v
.
image
instanceof
Array
&&
v
.
image
.
length
==
6
){
if
(
w
=
v
,
w
.
image
.
length
==
6
)
if
(
w
.
needsUpdate
){
if
(
!
w
.
image
.
__webglTextureCube
)
w
.
image
.
__webglTextureCube
=
o
.
createTexture
();
o
.
activeTexture
(
o
.
TEXTURE0
+
n
);
o
.
bindTexture
(
o
.
TEXTURE_CUBE_MAP
,
w
.
image
.
__webglTextureCube
);
for
(
n
=
0
;
n
<
6
;
n
++
)
o
.
texImage2D
(
o
.
TEXTURE_CUBE_MAP_POSITIVE_X
+
n
,
0
,
o
.
RGBA
,
o
.
RGBA
,
o
.
UNSIGNED_BYTE
,
w
.
image
[
n
]);
B
(
o
.
TEXTURE_CUBE_MAP
,
w
,
w
.
image
[
0
]);
w
.
needsUpdate
=!
1
}
else
o
.
activeTexture
(
o
.
TEXTURE0
+
n
),
o
.
bindTexture
(
o
.
TEXTURE_CUBE_MAP
,
w
.
image
.
__webglTextureCube
)}
else
v
instanceof
THREE
.
WebGLRenderTargetCube
?(
w
=
v
,
o
.
activeTexture
(
o
.
TEXTURE0
+
n
),
o
.
bindTexture
(
o
.
TEXTURE_CUBE_MAP
,
w
.
__webglTexture
)):
M
(
v
,
n
)}
else
if
(
x
==
"
tv
"
){
if
(
!
w
.
_array
){
w
.
_array
=
[];
x
=
0
;
for
(
H
=
w
.
texture
.
length
;
x
<
H
;
x
++
)
w
.
_array
[
x
]
=
n
+
x
}
o
.
uniform1iv
(
v
,
w
.
_array
);
x
=
0
;
for
(
H
=
w
.
texture
.
length
;
x
<
H
;
x
++
)(
v
=
w
.
texture
[
x
])
&&
M
(
v
,
w
.
_array
[
x
])}(
f
instanceof
THREE
.
ShaderMaterial
||
f
instanceof
THREE
.
MeshPhongMaterial
||
f
.
envMap
)
&&
m
.
cameraPosition
!==
null
&&
o
.
uniform3f
(
m
.
cameraPosition
,
b
.
position
.
x
,
b
.
position
.
y
,
b
.
position
.
z
);(
f
instanceof
THREE
.
MeshPhongMaterial
||
f
instanceof
THREE
.
MeshLambertMaterial
||
f
instanceof
THREE
.
ShaderMaterial
||
f
.
skinning
)
&&
m
.
viewMatrix
!==
null
&&
o
.
uniformMatrix4fv
(
m
.
viewMatrix
,
!
1
,
Ea
);
f
.
skinning
&&
(
o
.
uniformMatrix4fv
(
m
.
cameraInverseMatrix
,
!
1
,
Ea
),
o
.
uniformMatrix4fv
(
m
.
boneGlobalMatrices
,
!
1
,
k
.
boneMatrices
))}
o
.
uniformMatrix4fv
(
m
.
modelViewMatrix
,
!
1
,
k
.
_modelViewMatrixArray
);
m
.
normalMatrix
&&
o
.
uniformMatrix3fv
(
m
.
normalMatrix
,
!
1
,
k
.
_normalMatrixArray
);(
f
instanceof
THREE
.
ShaderMaterial
||
f
.
envMap
||
f
.
skinning
||
k
.
receiveShadow
)
&&
m
.
objectMatrix
!==
null
&&
o
.
uniformMatrix4fv
(
m
.
objectMatrix
,
!
1
,
k
.
_objectMatrixArray
);
return
h
}
function
f
(
b
,
c
,
f
,
k
,
h
,
m
){
if
(
k
.
opacity
!=
0
){
var
n
,
f
=
e
(
b
,
c
,
f
,
k
,
m
),
b
=
f
.
attributes
,
c
=!
1
,
f
=
h
.
id
*
16777215
+
f
.
id
;
f
!=
oa
&&
(
oa
=
f
,
c
=!
0
);
if
(
!
k
.
morphTargets
&&
b
.
position
>=
0
)
c
&&
(
o
.
bindBuffer
(
o
.
ARRAY_BUFFER
,
h
.
__webglVertexBuffer
),
o
.
vertexAttribPointer
(
b
.
position
,
3
,
o
.
FLOAT
,
!
1
,
0
,
0
));
else
if
(
m
.
morphTargetBase
){
f
=
k
.
program
.
attributes
;
m
.
morphTargetBase
!==-
1
?(
o
.
bindBuffer
(
o
.
ARRAY_BUFFER
,
h
.
__webglMorphTargetsBuffers
[
m
.
morphTargetBase
]),
m
.
objectMatrix
!==
null
&&
o
.
uniformMatrix4fv
(
m
.
objectMatrix
,
!
1
,
k
.
_objectMatrixArray
);
return
h
}
function
f
(
b
,
c
,
f
,
k
,
h
,
m
){
if
(
k
.
opacity
!=
0
){
var
n
,
f
=
e
(
b
,
c
,
f
,
k
,
m
),
b
=
f
.
attributes
,
c
=!
1
,
f
=
h
.
id
*
16777215
+
f
.
id
*
2
+
(
k
.
wireframe
?
1
:
0
)
;
f
!=
oa
&&
(
oa
=
f
,
c
=!
0
);
if
(
!
k
.
morphTargets
&&
b
.
position
>=
0
)
c
&&
(
o
.
bindBuffer
(
o
.
ARRAY_BUFFER
,
h
.
__webglVertexBuffer
),
o
.
vertexAttribPointer
(
b
.
position
,
3
,
o
.
FLOAT
,
!
1
,
0
,
0
));
else
if
(
m
.
morphTargetBase
){
f
=
k
.
program
.
attributes
;
m
.
morphTargetBase
!==-
1
?(
o
.
bindBuffer
(
o
.
ARRAY_BUFFER
,
h
.
__webglMorphTargetsBuffers
[
m
.
morphTargetBase
]),
o
.
vertexAttribPointer
(
f
.
position
,
3
,
o
.
FLOAT
,
!
1
,
0
,
0
)):
f
.
position
>=
0
&&
(
o
.
bindBuffer
(
o
.
ARRAY_BUFFER
,
h
.
__webglVertexBuffer
),
o
.
vertexAttribPointer
(
f
.
position
,
3
,
o
.
FLOAT
,
!
1
,
0
,
0
));
if
(
m
.
morphTargetForcedOrder
.
length
)
for
(
var
p
=
0
,
t
=
m
.
morphTargetForcedOrder
,
u
=
m
.
morphTargetInfluences
;
p
<
k
.
numSupportedMorphTargets
&&
p
<
t
.
length
;)
o
.
bindBuffer
(
o
.
ARRAY_BUFFER
,
h
.
__webglMorphTargetsBuffers
[
t
[
p
]]),
o
.
vertexAttribPointer
(
f
[
"
morphTarget
"
+
p
],
3
,
o
.
FLOAT
,
!
1
,
0
,
0
),
m
.
__webglMorphTargetInfluences
[
p
]
=
u
[
t
[
p
]],
p
++
;
else
{
var
t
=
[],
w
=-
1
,
x
=
0
,
u
=
m
.
morphTargetInfluences
,
v
,
H
=
u
.
length
,
p
=
0
;
for
(
m
.
morphTargetBase
!==-
1
&&
(
t
[
m
.
morphTargetBase
]
=!
0
);
p
<
k
.
numSupportedMorphTargets
;){
for
(
v
=
0
;
v
<
H
;
v
++
)
!
t
[
v
]
&&
u
[
v
]
>
w
&&
(
x
=
v
,
w
=
u
[
x
]);
o
.
bindBuffer
(
o
.
ARRAY_BUFFER
,
h
.
__webglMorphTargetsBuffers
[
x
]);
o
.
vertexAttribPointer
(
f
[
"
morphTarget
"
+
p
],
3
,
o
.
FLOAT
,
!
1
,
0
,
0
);
m
.
__webglMorphTargetInfluences
[
p
]
=
w
;
t
[
x
]
=
1
;
w
=-
1
;
p
++
}}
k
.
program
.
uniforms
.
morphTargetInfluences
!==
null
&&
o
.
uniform1fv
(
k
.
program
.
uniforms
.
morphTargetInfluences
,
m
.
__webglMorphTargetInfluences
)}
if
(
c
){
if
(
h
.
__webglCustomAttributes
)
for
(
n
in
h
.
__webglCustomAttributes
)
b
[
n
]
>=
0
&&
(
f
=
h
.
__webglCustomAttributes
[
n
],
o
.
bindBuffer
(
o
.
ARRAY_BUFFER
,
f
.
buffer
),
o
.
vertexAttribPointer
(
b
[
n
],
f
.
size
,
o
.
FLOAT
,
!
1
,
0
,
0
));
b
.
color
>=
0
&&
(
o
.
bindBuffer
(
o
.
ARRAY_BUFFER
,
h
.
__webglColorBuffer
),
o
.
vertexAttribPointer
(
b
.
color
,
3
,
o
.
FLOAT
,
!
1
,
0
,
0
));
b
.
normal
>=
0
&&
(
o
.
bindBuffer
(
o
.
ARRAY_BUFFER
,
h
.
__webglNormalBuffer
),
o
.
vertexAttribPointer
(
b
.
normal
,
3
,
o
.
FLOAT
,
!
1
,
0
,
0
));
b
.
tangent
>=
0
&&
(
o
.
bindBuffer
(
o
.
ARRAY_BUFFER
,
h
.
__webglTangentBuffer
),
o
.
vertexAttribPointer
(
b
.
tangent
,
4
,
o
.
FLOAT
,
!
1
,
0
,
0
));
b
.
uv
>=
0
&&
(
h
.
__webglUVBuffer
?(
o
.
bindBuffer
(
o
.
ARRAY_BUFFER
,
...
...
build/custom/ThreeWebGL.js
浏览文件 @
7d3e4825
...
...
@@ -192,7 +192,7 @@ k);else if(C=="v3v"){if(!n._array)n._array=new Float32Array(3*k.length);C=0;for(
k
),
q
=
n
.
texture
)
if
(
q
.
image
instanceof
Array
&&
q
.
image
.
length
==
6
){
if
(
n
=
q
,
n
.
image
.
length
==
6
)
if
(
n
.
needsUpdate
){
if
(
!
n
.
image
.
__webglTextureCube
)
n
.
image
.
__webglTextureCube
=
f
.
createTexture
();
f
.
activeTexture
(
f
.
TEXTURE0
+
k
);
f
.
bindTexture
(
f
.
TEXTURE_CUBE_MAP
,
n
.
image
.
__webglTextureCube
);
for
(
k
=
0
;
k
<
6
;
k
++
)
f
.
texImage2D
(
f
.
TEXTURE_CUBE_MAP_POSITIVE_X
+
k
,
0
,
f
.
RGBA
,
f
.
RGBA
,
f
.
UNSIGNED_BYTE
,
n
.
image
[
k
]);
v
(
f
.
TEXTURE_CUBE_MAP
,
n
,
n
.
image
[
0
]);
n
.
needsUpdate
=!
1
}
else
f
.
activeTexture
(
f
.
TEXTURE0
+
k
),
f
.
bindTexture
(
f
.
TEXTURE_CUBE_MAP
,
n
.
image
.
__webglTextureCube
)}
else
q
instanceof
THREE
.
WebGLRenderTargetCube
?(
n
=
q
,
f
.
activeTexture
(
f
.
TEXTURE0
+
k
),
f
.
bindTexture
(
f
.
TEXTURE_CUBE_MAP
,
n
.
__webglTexture
)):
U
(
q
,
k
)}
else
if
(
C
==
"
tv
"
){
if
(
!
n
.
_array
){
n
.
_array
=
[];
C
=
0
;
for
(
m
=
n
.
texture
.
length
;
C
<
m
;
C
++
)
n
.
_array
[
C
]
=
k
+
C
}
f
.
uniform1iv
(
q
,
n
.
_array
);
C
=
0
;
for
(
m
=
n
.
texture
.
length
;
C
<
m
;
C
++
)(
q
=
n
.
texture
[
C
])
&&
U
(
q
,
n
.
_array
[
C
])}(
e
instanceof
THREE
.
ShaderMaterial
||
e
instanceof
THREE
.
MeshPhongMaterial
||
e
.
envMap
)
&&
j
.
cameraPosition
!==
null
&&
f
.
uniform3f
(
j
.
cameraPosition
,
b
.
position
.
x
,
b
.
position
.
y
,
b
.
position
.
z
);(
e
instanceof
THREE
.
MeshPhongMaterial
||
e
instanceof
THREE
.
MeshLambertMaterial
||
e
instanceof
THREE
.
ShaderMaterial
||
e
.
skinning
)
&&
j
.
viewMatrix
!==
null
&&
f
.
uniformMatrix4fv
(
j
.
viewMatrix
,
!
1
,
Va
);
e
.
skinning
&&
(
f
.
uniformMatrix4fv
(
j
.
cameraInverseMatrix
,
!
1
,
Va
),
f
.
uniformMatrix4fv
(
j
.
boneGlobalMatrices
,
!
1
,
i
.
boneMatrices
))}
f
.
uniformMatrix4fv
(
j
.
modelViewMatrix
,
!
1
,
i
.
_modelViewMatrixArray
);
j
.
normalMatrix
&&
f
.
uniformMatrix3fv
(
j
.
normalMatrix
,
!
1
,
i
.
_normalMatrixArray
);(
e
instanceof
THREE
.
ShaderMaterial
||
e
.
envMap
||
e
.
skinning
||
i
.
receiveShadow
)
&&
j
.
objectMatrix
!==
null
&&
f
.
uniformMatrix4fv
(
j
.
objectMatrix
,
!
1
,
i
.
_objectMatrixArray
);
return
h
}
function
e
(
b
,
c
,
e
,
i
,
h
,
j
){
if
(
i
.
opacity
!=
0
){
var
k
,
e
=
d
(
b
,
c
,
e
,
i
,
j
),
b
=
e
.
attributes
,
c
=!
1
,
e
=
h
.
id
*
16777215
+
e
.
id
;
e
!=
S
&&
(
S
=
e
,
c
=!
0
);
if
(
!
i
.
morphTargets
&&
b
.
position
>=
0
)
c
&&
(
f
.
bindBuffer
(
f
.
ARRAY_BUFFER
,
h
.
__webglVertexBuffer
),
f
.
vertexAttribPointer
(
b
.
position
,
3
,
f
.
FLOAT
,
!
1
,
0
,
0
));
else
if
(
j
.
morphTargetBase
){
e
=
i
.
program
.
attributes
;
j
.
morphTargetBase
!==-
1
?(
f
.
bindBuffer
(
f
.
ARRAY_BUFFER
,
h
.
__webglMorphTargetsBuffers
[
j
.
morphTargetBase
]),
j
.
objectMatrix
!==
null
&&
f
.
uniformMatrix4fv
(
j
.
objectMatrix
,
!
1
,
i
.
_objectMatrixArray
);
return
h
}
function
e
(
b
,
c
,
e
,
i
,
h
,
j
){
if
(
i
.
opacity
!=
0
){
var
k
,
e
=
d
(
b
,
c
,
e
,
i
,
j
),
b
=
e
.
attributes
,
c
=!
1
,
e
=
h
.
id
*
16777215
+
e
.
id
*
2
+
(
i
.
wireframe
?
1
:
0
)
;
e
!=
S
&&
(
S
=
e
,
c
=!
0
);
if
(
!
i
.
morphTargets
&&
b
.
position
>=
0
)
c
&&
(
f
.
bindBuffer
(
f
.
ARRAY_BUFFER
,
h
.
__webglVertexBuffer
),
f
.
vertexAttribPointer
(
b
.
position
,
3
,
f
.
FLOAT
,
!
1
,
0
,
0
));
else
if
(
j
.
morphTargetBase
){
e
=
i
.
program
.
attributes
;
j
.
morphTargetBase
!==-
1
?(
f
.
bindBuffer
(
f
.
ARRAY_BUFFER
,
h
.
__webglMorphTargetsBuffers
[
j
.
morphTargetBase
]),
f
.
vertexAttribPointer
(
e
.
position
,
3
,
f
.
FLOAT
,
!
1
,
0
,
0
)):
e
.
position
>=
0
&&
(
f
.
bindBuffer
(
f
.
ARRAY_BUFFER
,
h
.
__webglVertexBuffer
),
f
.
vertexAttribPointer
(
e
.
position
,
3
,
f
.
FLOAT
,
!
1
,
0
,
0
));
if
(
j
.
morphTargetForcedOrder
.
length
)
for
(
var
n
=
0
,
x
=
j
.
morphTargetForcedOrder
,
p
=
j
.
morphTargetInfluences
;
n
<
i
.
numSupportedMorphTargets
&&
n
<
x
.
length
;)
f
.
bindBuffer
(
f
.
ARRAY_BUFFER
,
h
.
__webglMorphTargetsBuffers
[
x
[
n
]]),
f
.
vertexAttribPointer
(
e
[
"
morphTarget
"
+
n
],
3
,
f
.
FLOAT
,
!
1
,
0
,
0
),
j
.
__webglMorphTargetInfluences
[
n
]
=
p
[
x
[
n
]],
n
++
;
else
{
var
x
=
[],
q
=-
1
,
m
=
0
,
p
=
j
.
morphTargetInfluences
,
t
,
C
=
p
.
length
,
n
=
0
;
for
(
j
.
morphTargetBase
!==-
1
&&
(
x
[
j
.
morphTargetBase
]
=!
0
);
n
<
i
.
numSupportedMorphTargets
;){
for
(
t
=
0
;
t
<
C
;
t
++
)
!
x
[
t
]
&&
p
[
t
]
>
q
&&
(
m
=
t
,
q
=
p
[
m
]);
f
.
bindBuffer
(
f
.
ARRAY_BUFFER
,
h
.
__webglMorphTargetsBuffers
[
m
]);
f
.
vertexAttribPointer
(
e
[
"
morphTarget
"
+
n
],
3
,
f
.
FLOAT
,
!
1
,
0
,
0
);
j
.
__webglMorphTargetInfluences
[
n
]
=
q
;
x
[
m
]
=
1
;
q
=-
1
;
n
++
}}
i
.
program
.
uniforms
.
morphTargetInfluences
!==
null
&&
f
.
uniform1fv
(
i
.
program
.
uniforms
.
morphTargetInfluences
,
j
.
__webglMorphTargetInfluences
)}
if
(
c
){
if
(
h
.
__webglCustomAttributes
)
for
(
k
in
h
.
__webglCustomAttributes
)
b
[
k
]
>=
0
&&
(
e
=
h
.
__webglCustomAttributes
[
k
],
f
.
bindBuffer
(
f
.
ARRAY_BUFFER
,
e
.
buffer
),
f
.
vertexAttribPointer
(
b
[
k
],
e
.
size
,
f
.
FLOAT
,
!
1
,
0
,
0
));
b
.
color
>=
0
&&
(
f
.
bindBuffer
(
f
.
ARRAY_BUFFER
,
h
.
__webglColorBuffer
),
f
.
vertexAttribPointer
(
b
.
color
,
3
,
f
.
FLOAT
,
!
1
,
0
,
0
));
b
.
normal
>=
0
&&
(
f
.
bindBuffer
(
f
.
ARRAY_BUFFER
,
h
.
__webglNormalBuffer
),
f
.
vertexAttribPointer
(
b
.
normal
,
3
,
f
.
FLOAT
,
!
1
,
0
,
0
));
b
.
tangent
>=
0
&&
(
f
.
bindBuffer
(
f
.
ARRAY_BUFFER
,
h
.
__webglTangentBuffer
),
f
.
vertexAttribPointer
(
b
.
tangent
,
4
,
f
.
FLOAT
,
!
1
,
0
,
0
));
b
.
uv
>=
0
&&
(
h
.
__webglUVBuffer
?(
f
.
bindBuffer
(
f
.
ARRAY_BUFFER
,
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
7d3e4825
...
...
@@ -2893,7 +2893,8 @@ THREE.WebGLRenderer = function ( parameters ) {
attributes
=
program
.
attributes
;
var
updateBuffers
=
false
,
geometryGroupHash
=
geometryGroup
.
id
*
0xffffff
+
program
.
id
;
wireframeBit
=
material
.
wireframe
?
1
:
0
,
geometryGroupHash
=
(
geometryGroup
.
id
*
0xffffff
)
+
(
program
.
id
*
2
)
+
wireframeBit
;
if
(
geometryGroupHash
!=
_currentGeometryGroupHash
)
{
...
...
@@ -3694,12 +3695,19 @@ THREE.WebGLRenderer = function ( parameters ) {
_this
.
info
.
render
.
faces
=
0
;
// hack: find parent of camera.
if
(
camera
.
matrixAutoUpdate
)
{
if
(
camera
.
matrixAutoUpdate
)
{
var
parent
=
camera
;
while
(
parent
.
parent
)
{
parent
=
parent
.
parent
;
}
parent
.
update
(
undefined
,
true
);
}
scene
.
update
(
undefined
,
false
,
camera
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录