|
@@ -3,7 +3,7 @@
|
|
|
* Copyright 2010-2022 Three.js Authors
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
*/
|
|
|
-const REVISION = '146';
|
|
|
+const REVISION = '147dev';
|
|
|
const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
|
const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
|
const CullFaceNone = 0;
|
|
@@ -26845,28 +26845,6 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
this.toneMapping = NoToneMapping;
|
|
|
this.toneMappingExposure = 1.0;
|
|
|
|
|
|
- //
|
|
|
-
|
|
|
- Object.defineProperties( this, {
|
|
|
-
|
|
|
- // @deprecated since r136, 0e21088102b4de7e0a0a33140620b7a3424b9e6d
|
|
|
-
|
|
|
- gammaFactor: {
|
|
|
- get: function () {
|
|
|
-
|
|
|
- console.warn( 'THREE.WebGLRenderer: .gammaFactor has been removed.' );
|
|
|
- return 2;
|
|
|
-
|
|
|
- },
|
|
|
- set: function () {
|
|
|
-
|
|
|
- console.warn( 'THREE.WebGLRenderer: .gammaFactor has been removed.' );
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- } );
|
|
|
-
|
|
|
// internal properties
|
|
|
|
|
|
const _this = this;
|
|
@@ -27433,31 +27411,48 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
//
|
|
|
|
|
|
let index = geometry.index;
|
|
|
- const position = geometry.attributes.position;
|
|
|
+ let rangeFactor = 1;
|
|
|
+
|
|
|
+ if ( material.wireframe === true ) {
|
|
|
+
|
|
|
+ index = geometries.getWireframeAttribute( geometry );
|
|
|
+ rangeFactor = 2;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
//
|
|
|
|
|
|
- if ( index === null ) {
|
|
|
+ const drawRange = geometry.drawRange;
|
|
|
+ const position = geometry.attributes.position;
|
|
|
|
|
|
- if ( position === undefined || position.count === 0 ) return;
|
|
|
+ let drawStart = drawRange.start * rangeFactor;
|
|
|
+ let drawEnd = ( drawRange.start + drawRange.count ) * rangeFactor;
|
|
|
|
|
|
- } else if ( index.count === 0 ) {
|
|
|
+ if ( group !== null ) {
|
|
|
|
|
|
- return;
|
|
|
+ drawStart = Math.max( drawStart, group.start * rangeFactor );
|
|
|
+ drawEnd = Math.min( drawEnd, ( group.start + group.count ) * rangeFactor );
|
|
|
|
|
|
}
|
|
|
|
|
|
- //
|
|
|
+ if ( index !== null ) {
|
|
|
|
|
|
- let rangeFactor = 1;
|
|
|
+ drawStart = Math.max( drawStart, 0 );
|
|
|
+ drawEnd = Math.min( drawEnd, index.count );
|
|
|
|
|
|
- if ( material.wireframe === true ) {
|
|
|
+ } else if ( position !== undefined && position !== null ) {
|
|
|
|
|
|
- index = geometries.getWireframeAttribute( geometry );
|
|
|
- rangeFactor = 2;
|
|
|
+ drawStart = Math.max( drawStart, 0 );
|
|
|
+ drawEnd = Math.min( drawEnd, position.count );
|
|
|
|
|
|
}
|
|
|
|
|
|
+ const drawCount = drawEnd - drawStart;
|
|
|
+
|
|
|
+ if ( drawCount < 0 || drawCount === Infinity ) return;
|
|
|
+
|
|
|
+ //
|
|
|
+
|
|
|
bindingStates.setup( object, material, program, geometry, index );
|
|
|
|
|
|
let attribute;
|
|
@@ -27474,23 +27469,6 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
|
|
|
//
|
|
|
|
|
|
- const dataCount = ( index !== null ) ? index.count : position.count;
|
|
|
-
|
|
|
- const rangeStart = geometry.drawRange.start * rangeFactor;
|
|
|
- const rangeCount = geometry.drawRange.count * rangeFactor;
|
|
|
-
|
|
|
- const groupStart = group !== null ? group.start * rangeFactor : 0;
|
|
|
- const groupCount = group !== null ? group.count * rangeFactor : Infinity;
|
|
|
-
|
|
|
- const drawStart = Math.max( rangeStart, groupStart );
|
|
|
- const drawEnd = Math.min( dataCount, rangeStart + rangeCount, groupStart + groupCount ) - 1;
|
|
|
-
|
|
|
- const drawCount = Math.max( 0, drawEnd - drawStart + 1 );
|
|
|
-
|
|
|
- if ( drawCount === 0 ) return;
|
|
|
-
|
|
|
- //
|
|
|
-
|
|
|
if ( object.isMesh ) {
|
|
|
|
|
|
if ( material.wireframe === true ) {
|
|
@@ -27542,7 +27520,8 @@ function WebGLRenderer( parameters = {} ) {
|
|
|
|
|
|
} else if ( geometry.isInstancedBufferGeometry ) {
|
|
|
|
|
|
- const instanceCount = Math.min( geometry.instanceCount, geometry._maxInstanceCount );
|
|
|
+ const maxInstanceCount = geometry._maxInstanceCount !== undefined ? geometry._maxInstanceCount : Infinity;
|
|
|
+ const instanceCount = Math.min( geometry.instanceCount, maxInstanceCount );
|
|
|
|
|
|
renderer.renderInstances( drawStart, drawCount, instanceCount );
|
|
|
|