提交 1e30568e 编写于 作者: O OpenShift guest

Merge remote-tracking branch 'origin/dev' into removeHackery

Conflicts:
	src/renderers/WebGLRenderer.js
......@@ -678,12 +678,13 @@ THREE.Geometry.prototype = {
return function ( usesFaceMaterial, maxVerticesInGroup ) {
var f, fl, face, materialIndex,
groupHash, hash_map = {};
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 ++ ) {
......@@ -700,8 +701,9 @@ THREE.Geometry.prototype = {
if ( ! ( groupHash in this.geometryGroups ) ) {
this.geometryGroups[ groupHash ] = { 'faces3': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets, 'numMorphNormals': numMorphNormals };
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 ) {
......@@ -711,8 +713,10 @@ THREE.Geometry.prototype = {
if ( ! ( groupHash in this.geometryGroups ) ) {
this.geometryGroups[ groupHash ] = { 'faces3': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets, 'numMorphNormals': numMorphNormals };
geometryGroup = { 'id': geometryGroupCounter++, 'faces3': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets, 'numMorphNormals': numMorphNormals };
this.geometryGroups[ groupHash ] = geometryGroup;
this.geometryGroupsList.push(geometryGroup);
}
}
......@@ -722,16 +726,6 @@ THREE.Geometry.prototype = {
}
this.geometryGroupsList = [];
for ( var g in this.geometryGroups ) {
this.geometryGroups[ g ].id = geometryGroupCounter ++;
this.geometryGroupsList.push( this.geometryGroups[ g ] );
}
};
} )(),
......
......@@ -623,9 +623,9 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( geometry.geometryGroups !== undefined ) {
for ( var g in geometry.geometryGroups ) {
for ( var i = 0,l = geometry.geometryGroupsList.length; i<l;i++ ) {
var geometryGroup = geometry.geometryGroups[ g ];
var geometryGroup = geometry.geometryGroupsList[ i ];
if ( geometryGroup.numMorphTargets !== undefined ) {
......@@ -2734,7 +2734,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
_gl.drawElements( _gl.LINES, index.array.length, type, 0 ); // 2 bytes per Uint16Array
_gl.drawElements( mode, index.array.length, type, 0 ); // 2 bytes per Uint16Array
_this.info.render.calls ++;
_this.info.render.vertices += index.array.length; // not really true, here vertices can be shared
......@@ -2760,7 +2760,7 @@ THREE.WebGLRenderer = function ( parameters ) {
// render indexed lines
_gl.drawElements( _gl.LINES, offsets[ i ].count, type, offsets[ i ].start * size ); // 2 bytes per Uint16Array
_gl.drawElements( mode, offsets[ i ].count, type, offsets[ i ].start * size ); // 2 bytes per Uint16Array
_this.info.render.calls ++;
_this.info.render.vertices += offsets[ i ].count; // not really true, here vertices can be shared
......@@ -3780,12 +3780,13 @@ THREE.WebGLRenderer = function ( parameters ) {
addBuffer( scene.__webglObjects, geometry, object );
} else {
for ( g in geometry.geometryGroups ) {
} else if ( geometry instanceof THREE.Geometry ) {
geometryGroup = geometry.geometryGroups[ g ];
for ( var i = 0,l = geometry.geometryGroupsList.length; i<l;i++ ) {
geometryGroup = geometry.geometryGroupsList[ i ];
addBuffer( scene.__webglObjects, geometryGroup, object );
}
}
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册