Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
34836d44
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,发现更多精彩内容 >>
提交
34836d44
编写于
4月 03, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up
上级
9ff4f7ac
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
51 addition
and
55 deletion
+51
-55
src/renderers/webgl/WebGLBuffers.js
src/renderers/webgl/WebGLBuffers.js
+43
-43
src/renderers/webgl/WebGLObjects.js
src/renderers/webgl/WebGLObjects.js
+6
-7
src/renderers/webgl/WebGLProgram.js
src/renderers/webgl/WebGLProgram.js
+2
-5
未找到文件。
src/renderers/webgl/WebGLBuffers.js
浏览文件 @
34836d44
...
...
@@ -4,7 +4,7 @@
THREE
.
WebGLBuffers
=
function
(
gl
,
info
,
extensions
,
getBufferMaterial
)
{
function
initCustomAttributes
(
object
)
{
function
initCustomAttributes
(
object
)
{
var
geometry
=
object
.
geometry
;
var
material
=
object
.
material
;
...
...
@@ -154,11 +154,11 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
//
var
geometry
=
object
.
geometry
,
faces
3
=
geometryGroup
.
faces3
,
faces
=
geometryGroup
.
faces
,
nvertices
=
faces
3
.
length
*
3
,
ntris
=
faces
3
.
length
*
1
,
nlines
=
faces
3
.
length
*
3
,
nvertices
=
faces
.
length
*
3
,
ntris
=
faces
.
length
*
1
,
nlines
=
faces
.
length
*
3
,
material
=
getBufferMaterial
(
object
,
geometryGroup
);
...
...
@@ -681,7 +681,7 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
dirtyMorphTargets
=
geometry
.
morphTargetsNeedUpdate
,
vertices
=
geometry
.
vertices
,
chunk_faces
3
=
geometryGroup
.
faces3
,
chunk_faces
=
geometryGroup
.
faces
,
obj_faces
=
geometry
.
faces
,
obj_uvs
=
geometry
.
faceVertexUvs
[
0
],
...
...
@@ -695,9 +695,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
if
(
dirtyVertices
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
face
=
obj_faces
[
chunk_faces
3
[
f
]
];
face
=
obj_faces
[
chunk_faces
[
f
]
];
v1
=
vertices
[
face
.
a
];
v2
=
vertices
[
face
.
b
];
...
...
@@ -730,9 +730,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
offset_morphTarget
=
0
;
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
chf
=
chunk_faces
3
[
f
];
chf
=
chunk_faces
[
f
];
face
=
obj_faces
[
chf
];
// morph positions
...
...
@@ -813,9 +813,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
if
(
obj_skinWeights
.
length
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
face
=
obj_faces
[
chunk_faces
3
[
f
]
];
face
=
obj_faces
[
chunk_faces
[
f
]
];
// weights
...
...
@@ -877,9 +877,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
if
(
dirtyColors
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
face
=
obj_faces
[
chunk_faces
3
[
f
]
];
face
=
obj_faces
[
chunk_faces
[
f
]
];
vertexColors
=
face
.
vertexColors
;
faceColor
=
face
.
color
;
...
...
@@ -925,9 +925,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
if
(
dirtyTangents
&&
geometry
.
hasTangents
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
face
=
obj_faces
[
chunk_faces
3
[
f
]
];
face
=
obj_faces
[
chunk_faces
[
f
]
];
vertexTangents
=
face
.
vertexTangents
;
...
...
@@ -961,9 +961,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
if
(
dirtyNormals
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
face
=
obj_faces
[
chunk_faces
3
[
f
]
];
face
=
obj_faces
[
chunk_faces
[
f
]
];
vertexNormals
=
face
.
vertexNormals
;
faceNormal
=
face
.
normal
;
...
...
@@ -1005,9 +1005,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
if
(
dirtyUvs
&&
obj_uvs
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
fi
=
chunk_faces
3
[
f
];
fi
=
chunk_faces
[
f
];
uv
=
obj_uvs
[
fi
];
...
...
@@ -1037,9 +1037,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
if
(
dirtyUvs
&&
obj_uvs2
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
fi
=
chunk_faces
3
[
f
];
fi
=
chunk_faces
[
f
];
uv2
=
obj_uvs2
[
fi
];
...
...
@@ -1069,7 +1069,7 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
if
(
dirtyElements
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
faceArray
[
offset_face
]
=
vertexIndex
;
faceArray
[
offset_face
+
1
]
=
vertexIndex
+
1
;
...
...
@@ -1114,9 +1114,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
if
(
customAttribute
.
boundTo
===
undefined
||
customAttribute
.
boundTo
===
'
vertices
'
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
face
=
obj_faces
[
chunk_faces
3
[
f
]
];
face
=
obj_faces
[
chunk_faces
[
f
]
];
customAttribute
.
array
[
offset_custom
]
=
customAttribute
.
value
[
face
.
a
];
customAttribute
.
array
[
offset_custom
+
1
]
=
customAttribute
.
value
[
face
.
b
];
...
...
@@ -1128,9 +1128,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
}
else
if
(
customAttribute
.
boundTo
===
'
faces
'
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
value
=
customAttribute
.
value
[
chunk_faces
3
[
f
]
];
value
=
customAttribute
.
value
[
chunk_faces
[
f
]
];
customAttribute
.
array
[
offset_custom
]
=
value
;
customAttribute
.
array
[
offset_custom
+
1
]
=
value
;
...
...
@@ -1146,9 +1146,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
if
(
customAttribute
.
boundTo
===
undefined
||
customAttribute
.
boundTo
===
'
vertices
'
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
face
=
obj_faces
[
chunk_faces
3
[
f
]
];
face
=
obj_faces
[
chunk_faces
[
f
]
];
v1
=
customAttribute
.
value
[
face
.
a
];
v2
=
customAttribute
.
value
[
face
.
b
];
...
...
@@ -1169,9 +1169,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
}
else
if
(
customAttribute
.
boundTo
===
'
faces
'
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
value
=
customAttribute
.
value
[
chunk_faces
3
[
f
]
];
value
=
customAttribute
.
value
[
chunk_faces
[
f
]
];
v1
=
value
;
v2
=
value
;
...
...
@@ -1208,9 +1208,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
if
(
customAttribute
.
boundTo
===
undefined
||
customAttribute
.
boundTo
===
'
vertices
'
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
face
=
obj_faces
[
chunk_faces
3
[
f
]
];
face
=
obj_faces
[
chunk_faces
[
f
]
];
v1
=
customAttribute
.
value
[
face
.
a
];
v2
=
customAttribute
.
value
[
face
.
b
];
...
...
@@ -1234,9 +1234,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
}
else
if
(
customAttribute
.
boundTo
===
'
faces
'
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
value
=
customAttribute
.
value
[
chunk_faces
3
[
f
]
];
value
=
customAttribute
.
value
[
chunk_faces
[
f
]
];
v1
=
value
;
v2
=
value
;
...
...
@@ -1260,9 +1260,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
}
else
if
(
customAttribute
.
boundTo
===
'
faceVertices
'
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
value
=
customAttribute
.
value
[
chunk_faces
3
[
f
]
];
value
=
customAttribute
.
value
[
chunk_faces
[
f
]
];
v1
=
value
[
0
];
v2
=
value
[
1
];
...
...
@@ -1290,9 +1290,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
if
(
customAttribute
.
boundTo
===
undefined
||
customAttribute
.
boundTo
===
'
vertices
'
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
face
=
obj_faces
[
chunk_faces
3
[
f
]
];
face
=
obj_faces
[
chunk_faces
[
f
]
];
v1
=
customAttribute
.
value
[
face
.
a
];
v2
=
customAttribute
.
value
[
face
.
b
];
...
...
@@ -1319,9 +1319,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
}
else
if
(
customAttribute
.
boundTo
===
'
faces
'
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
value
=
customAttribute
.
value
[
chunk_faces
3
[
f
]
];
value
=
customAttribute
.
value
[
chunk_faces
[
f
]
];
v1
=
value
;
v2
=
value
;
...
...
@@ -1348,9 +1348,9 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) {
}
else
if
(
customAttribute
.
boundTo
===
'
faceVertices
'
)
{
for
(
f
=
0
,
fl
=
chunk_faces
3
.
length
;
f
<
fl
;
f
++
)
{
for
(
f
=
0
,
fl
=
chunk_faces
.
length
;
f
<
fl
;
f
++
)
{
value
=
customAttribute
.
value
[
chunk_faces
3
[
f
]
];
value
=
customAttribute
.
value
[
chunk_faces
[
f
]
];
v1
=
value
[
0
];
v2
=
value
[
1
];
...
...
src/renderers/webgl/WebGLObjects.js
浏览文件 @
34836d44
...
...
@@ -44,7 +44,7 @@ THREE.WebGLObjects = function ( gl, info, extensions, getBufferMaterial ) {
group
=
{
id
:
geometryGroupCounter
++
,
faces
3
:
[],
faces
:
[],
materialIndex
:
materialIndex
,
vertices
:
0
,
numMorphTargets
:
numMorphTargets
,
...
...
@@ -65,7 +65,7 @@ THREE.WebGLObjects = function ( gl, info, extensions, getBufferMaterial ) {
group
=
{
id
:
geometryGroupCounter
++
,
faces
3
:
[],
faces
:
[],
materialIndex
:
materialIndex
,
vertices
:
0
,
numMorphTargets
:
numMorphTargets
,
...
...
@@ -79,7 +79,7 @@ THREE.WebGLObjects = function ( gl, info, extensions, getBufferMaterial ) {
}
groups
[
groupHash
].
faces
3
.
push
(
f
);
groups
[
groupHash
].
faces
.
push
(
f
);
groups
[
groupHash
].
vertices
+=
3
;
}
...
...
@@ -202,14 +202,13 @@ THREE.WebGLObjects = function ( gl, info, extensions, getBufferMaterial ) {
//
function
onObjectRemoved
(
event
)
{
function
onObjectRemoved
(
event
)
{
var
object
=
event
.
target
;
object
.
traverse
(
function
(
child
)
{
child
.
removeEventListener
(
'
remove
'
,
onObjectRemoved
);
removeObject
(
child
);
}
);
...
...
@@ -254,7 +253,7 @@ THREE.WebGLObjects = function ( gl, info, extensions, getBufferMaterial ) {
//
function
onGeometryDispose
(
event
)
{
function
onGeometryDispose
(
event
)
{
var
geometry
=
event
.
target
;
...
...
@@ -264,7 +263,7 @@ THREE.WebGLObjects = function ( gl, info, extensions, getBufferMaterial ) {
};
function
deallocateGeometry
(
geometry
)
{
function
deallocateGeometry
(
geometry
)
{
delete
geometries
[
geometry
.
id
];
...
...
src/renderers/webgl/WebGLProgram.js
浏览文件 @
34836d44
...
...
@@ -381,9 +381,7 @@ THREE.WebGLProgram = ( function () {
if
(
parameters
.
useVertexTexture
)
{
identifiers
.
push
(
'
boneTexture
'
);
identifiers
.
push
(
'
boneTextureWidth
'
);
identifiers
.
push
(
'
boneTextureHeight
'
);
identifiers
.
push
(
'
boneTexture
'
,
'
boneTextureWidth
'
,
'
boneTextureHeight
'
);
}
else
{
...
...
@@ -393,11 +391,10 @@ THREE.WebGLProgram = ( function () {
if
(
parameters
.
logarithmicDepthBuffer
)
{
identifiers
.
push
(
'
logDepthBufFC
'
);
identifiers
.
push
(
'
logDepthBufFC
'
);
}
for
(
var
u
in
uniforms
)
{
identifiers
.
push
(
u
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录