Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
79c41972
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,发现更多精彩内容 >>
提交
79c41972
编写于
10月 10, 2014
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
06d98a36
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
367 addition
and
344 deletion
+367
-344
build/three.js
build/three.js
+109
-85
build/three.min.js
build/three.min.js
+258
-259
未找到文件。
build/three.js
浏览文件 @
79c41972
...
...
@@ -9978,67 +9978,6 @@ THREE.Geometry.prototype = {
},
// Geometry splitting
makeGroups: ( function () {
var geometryGroupCounter = 0;
return function ( usesFaceMaterial, maxVerticesInGroup ) {
var f, fl, face, materialIndex,
groupHash, hash_map = {},geometryGroup;
var numMorphTargets = this.morphTargets.length;
var numMorphNormals = this.morphNormals.length;
this.geometryGroups = {};
this.geometryGroupsList = [];
for ( f = 0, fl = this.faces.length; f < fl; f ++ ) {
face = this.faces[ f ];
materialIndex = usesFaceMaterial ? face.materialIndex : 0;
if ( ! ( materialIndex in hash_map ) ) {
hash_map[ materialIndex ] = { 'hash': materialIndex, 'counter': 0 };
}
groupHash = hash_map[ materialIndex ].hash + '_' + hash_map[ materialIndex ].counter;
if ( ! ( groupHash in this.geometryGroups ) ) {
geometryGroup = { 'id': geometryGroupCounter++, 'faces3': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets, 'numMorphNormals': numMorphNormals };
this.geometryGroups[ groupHash ] = geometryGroup;
this.geometryGroupsList.push(geometryGroup);
}
if ( this.geometryGroups[ groupHash ].vertices + 3 > maxVerticesInGroup ) {
hash_map[ materialIndex ].counter += 1;
groupHash = hash_map[ materialIndex ].hash + '_' + hash_map[ materialIndex ].counter;
if ( ! ( groupHash in this.geometryGroups ) ) {
geometryGroup = { 'id': geometryGroupCounter++, 'faces3': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets, 'numMorphNormals': numMorphNormals };
this.geometryGroups[ groupHash ] = geometryGroup;
this.geometryGroupsList.push(geometryGroup);
}
}
this.geometryGroups[ groupHash ].faces3.push( f );
this.geometryGroups[ groupHash ].vertices += 3;
}
};
} )(),
toJSON: function () {
var output = {
...
...
@@ -18321,11 +18260,13 @@ THREE.WebGLRenderer = function ( parameters ) {
} else {
if ( geometry.geometryGroups !== undefined ) {
var geometryGroupsList = geometryGroups[ geometry.id ];
if ( geometryGroupsList !== undefined ) {
for ( var i = 0,l = geometry
.geometryGroupsList.length; i<l;i
++ ) {
for ( var i = 0,l = geometry
GroupsList.length; i < l; i
++ ) {
var geometryGroup = geometry
.geometry
GroupsList[ i ];
var geometryGroup = geometryGroupsList[ i ];
if ( geometryGroup.numMorphTargets !== undefined ) {
...
...
@@ -20829,7 +20770,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
}
;
}
// Sorting
...
...
@@ -20849,7 +20790,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
}
;
}
function reversePainterSortStable ( a, b ) {
...
...
@@ -20863,13 +20804,13 @@ THREE.WebGLRenderer = function ( parameters ) {
}
}
;
}
function numericalSort ( a, b ) {
return b[ 0 ] - a[ 0 ];
}
;
}
// Rendering
...
...
@@ -21095,7 +21036,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
}
;
}
function renderObjects( renderList, camera, lights, fog, useBlending, overrideMaterial ) {
...
...
@@ -21142,7 +21083,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
}
;
}
function renderObjectsImmediate ( renderList, materialType, camera, lights, fog, useBlending, overrideMaterial ) {
...
...
@@ -21179,7 +21120,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
}
;
}
this.renderImmediateObject = function ( camera, lights, fog, material, object ) {
...
...
@@ -21218,7 +21159,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
}
;
}
function unrollBufferMaterial ( globject ) {
...
...
@@ -21262,7 +21203,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
}
;
}
function initObject( object, scene ) {
...
...
@@ -21336,9 +21277,11 @@ THREE.WebGLRenderer = function ( parameters ) {
} else if ( geometry instanceof THREE.Geometry ) {
for ( var i = 0,l = geometry.geometryGroupsList.length; i < l; i ++ ) {
var geometryGroupsList = geometryGroups[ geometry.id ];
for ( var i = 0,l = geometryGroupsList.length; i < l; i ++ ) {
addBuffer( _webglObjects, geometry
.geometry
GroupsList[ i ], object );
addBuffer( _webglObjects, geometryGroupsList[ i ], object );
}
...
...
@@ -21356,26 +21299,106 @@ THREE.WebGLRenderer = function ( parameters ) {
}
};
}
// Geometry splitting
var geometryGroups = {};
var geometryGroupCounter = 0;
function makeGroups( geometry, usesFaceMaterial, maxVerticesInGroup ) {
var groupHash, hash_map = {};
var numMorphTargets = geometry.morphTargets.length;
var numMorphNormals = geometry.morphNormals.length;
var group;
var groups = {};
var groupsList = [];
for ( var f = 0, fl = geometry.faces.length; f < fl; f ++ ) {
var face = geometry.faces[ f ];
var materialIndex = usesFaceMaterial ? face.materialIndex : 0;
if ( ! ( materialIndex in hash_map ) ) {
hash_map[ materialIndex ] = { hash: materialIndex, counter: 0 };
}
groupHash = hash_map[ materialIndex ].hash + '_' + hash_map[ materialIndex ].counter;
if ( ! ( groupHash in groups ) ) {
group = {
id: geometryGroupCounter ++,
faces3: [],
materialIndex: materialIndex,
vertices: 0,
numMorphTargets: numMorphTargets,
numMorphNormals: numMorphNormals
};
groups[ groupHash ] = group;
groupsList.push( group );
}
if ( groups[ groupHash ].vertices + 3 > maxVerticesInGroup ) {
hash_map[ materialIndex ].counter += 1;
groupHash = hash_map[ materialIndex ].hash + '_' + hash_map[ materialIndex ].counter;
if ( ! ( groupHash in groups ) ) {
group = {
id: geometryGroupCounter ++,
faces3: [],
materialIndex: materialIndex,
vertices: 0,
numMorphTargets: numMorphTargets,
numMorphNormals: numMorphNormals
};
groups[ groupHash ] = group;
groupsList.push( group );
}
}
groups[ groupHash ].faces3.push( f );
groups[ groupHash ].vertices += 3;
}
return groupsList;
}
function initGeometryGroups( scene, object, geometry ) {
var
g, geometryGroup,
material = object.material, addBuffers = false;
var material = object.material, addBuffers = false;
if ( geometry
.geometryGroups
=== undefined || geometry.groupsNeedUpdate === true ) {
if ( geometry
Groups[ geometry.id ]
=== undefined || geometry.groupsNeedUpdate === true ) {
delete _webglObjects[ object.id ];
geometry.makeGroups( material instanceof THREE.MeshFaceMaterial, _glExtensionElementIndexUint ? 4294967296 : 65535 );
geometryGroups[ geometry.id ] = makeGroups( geometry, material instanceof THREE.MeshFaceMaterial, _glExtensionElementIndexUint ? 4294967296 : 65535 );
geometry.groupsNeedUpdate = false;
}
var geometryGroupsList = geometryGroups[ geometry.id ];
// create separate VBOs per geometry chunk
for ( var i = 0, il = geometry
.geometry
GroupsList.length; i < il; i ++ ) {
for ( var i = 0, il = geometryGroupsList.length; i < il; i ++ ) {
geometryGroup = geometry.
geometryGroupsList[ i ];
var geometryGroup =
geometryGroupsList[ i ];
// initialise VBO on the first access
...
...
@@ -21446,8 +21469,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function updateObject( object, scene ) {
var geometry = object.geometry,
geometryGroup, customAttributesDirty, material;
var geometry = object.geometry, customAttributesDirty, material;
if ( geometry instanceof THREE.BufferGeometry ) {
...
...
@@ -21463,9 +21485,11 @@ THREE.WebGLRenderer = function ( parameters ) {
}
for ( var i = 0, il = geometry.geometryGroupsList.length; i < il; i ++ ) {
var geometryGroupsList = geometryGroups[ geometry.id ];
for ( var i = 0, il = geometryGroupsList.length; i < il; i ++ ) {
geometryGroup = geometry.
geometryGroupsList[ i ];
var geometryGroup =
geometryGroupsList[ i ];
material = getBufferMaterial( object, geometryGroup );
...
...
build/three.min.js
浏览文件 @
79c41972
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录