|
@@ -266,6 +266,16 @@
|
|
|
var GreaterEqualStencilFunc = 518;
|
|
|
var AlwaysStencilFunc = 519;
|
|
|
|
|
|
+ var StaticDrawUsage = 35044;
|
|
|
+ var DynamicDrawUsage = 35048;
|
|
|
+ var StreamDrawUsage = 35040;
|
|
|
+ var StaticReadUsage = 35045;
|
|
|
+ var DynamicReadUsage = 35049;
|
|
|
+ var StreamReadUsage = 35041;
|
|
|
+ var StaticCopyUsage = 35046;
|
|
|
+ var DynamicCopyUsage = 35050;
|
|
|
+ var StreamCopyUsage = 35042;
|
|
|
+
|
|
|
/**
|
|
|
* https://github.com/mrdoob/eventdispatcher.js/
|
|
|
*/
|
|
@@ -8858,7 +8868,7 @@
|
|
|
this.count = array !== undefined ? array.length / itemSize : 0;
|
|
|
this.normalized = normalized === true;
|
|
|
|
|
|
- this.dynamic = false;
|
|
|
+ this.usage = StaticDrawUsage;
|
|
|
this.updateRange = { offset: 0, count: - 1 };
|
|
|
|
|
|
this.version = 0;
|
|
@@ -8881,9 +8891,9 @@
|
|
|
|
|
|
onUploadCallback: function () {},
|
|
|
|
|
|
- setDynamic: function ( value ) {
|
|
|
+ setUsage: function ( value ) {
|
|
|
|
|
|
- this.dynamic = value;
|
|
|
+ this.usage = value;
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -8897,7 +8907,7 @@
|
|
|
this.count = source.count;
|
|
|
this.normalized = source.normalized;
|
|
|
|
|
|
- this.dynamic = source.dynamic;
|
|
|
+ this.usage = source.usage;
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -14940,7 +14950,7 @@
|
|
|
function createBuffer( attribute, bufferType ) {
|
|
|
|
|
|
var array = attribute.array;
|
|
|
- var usage = attribute.dynamic ? 35048 : 35044;
|
|
|
+ var usage = attribute.usage;
|
|
|
|
|
|
var buffer = gl.createBuffer();
|
|
|
|
|
@@ -15001,20 +15011,12 @@
|
|
|
|
|
|
gl.bindBuffer( bufferType, buffer );
|
|
|
|
|
|
- if ( attribute.dynamic === false ) {
|
|
|
-
|
|
|
- gl.bufferData( bufferType, array, 35044 );
|
|
|
-
|
|
|
- } else if ( updateRange.count === - 1 ) {
|
|
|
+ if ( updateRange.count === - 1 ) {
|
|
|
|
|
|
// Not using update ranges
|
|
|
|
|
|
gl.bufferSubData( bufferType, 0, array );
|
|
|
|
|
|
- } else if ( updateRange.count === 0 ) {
|
|
|
-
|
|
|
- console.error( 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.' );
|
|
|
-
|
|
|
} else {
|
|
|
|
|
|
gl.bufferSubData( bufferType, updateRange.offset * array.BYTES_PER_ELEMENT,
|
|
@@ -25338,7 +25340,7 @@
|
|
|
|
|
|
if ( material.isShaderMaterial ) {
|
|
|
|
|
|
- material.uniformsNeedUpdate = false;
|
|
|
+ material.uniformsNeedUpdate = false; // #15581
|
|
|
|
|
|
}
|
|
|
|
|
@@ -26143,7 +26145,7 @@
|
|
|
this.stride = stride;
|
|
|
this.count = array !== undefined ? array.length / stride : 0;
|
|
|
|
|
|
- this.dynamic = false;
|
|
|
+ this.usage = StaticDrawUsage;
|
|
|
this.updateRange = { offset: 0, count: - 1 };
|
|
|
|
|
|
this.version = 0;
|
|
@@ -26166,9 +26168,9 @@
|
|
|
|
|
|
onUploadCallback: function () {},
|
|
|
|
|
|
- setDynamic: function ( value ) {
|
|
|
+ setUsage: function ( value ) {
|
|
|
|
|
|
- this.dynamic = value;
|
|
|
+ this.usage = value;
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -26179,7 +26181,7 @@
|
|
|
this.array = new source.array.constructor( source.array );
|
|
|
this.count = source.count;
|
|
|
this.stride = source.stride;
|
|
|
- this.dynamic = source.dynamic;
|
|
|
+ this.usage = source.usage;
|
|
|
|
|
|
return this;
|
|
|
|
|
@@ -48368,13 +48370,33 @@
|
|
|
console.warn( 'THREE.BufferAttribute: .length has been deprecated. Use .count instead.' );
|
|
|
return this.array.length;
|
|
|
|
|
|
+ }
|
|
|
+ },
|
|
|
+ dynamic: {
|
|
|
+ get: function () {
|
|
|
+
|
|
|
+ console.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' );
|
|
|
+ return this.usage === DynamicDrawUsage;
|
|
|
+
|
|
|
+ },
|
|
|
+ set: function ( value ) {
|
|
|
+
|
|
|
+ console.warn( 'THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.' );
|
|
|
+ this.setUsage( value );
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} );
|
|
|
|
|
|
Object.assign( BufferAttribute.prototype, {
|
|
|
+ setDynamic: function ( value ) {
|
|
|
|
|
|
+ console.warn( 'THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.' );
|
|
|
+ this.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage );
|
|
|
+ return this;
|
|
|
+
|
|
|
+ },
|
|
|
copyIndicesArray: function ( /* indices */ ) {
|
|
|
|
|
|
console.error( 'THREE.BufferAttribute: .copyIndicesArray() has been removed.' );
|
|
@@ -48390,7 +48412,6 @@
|
|
|
return this;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
} );
|
|
|
|
|
|
Object.assign( BufferGeometry.prototype, {
|
|
@@ -48452,8 +48473,33 @@
|
|
|
|
|
|
} );
|
|
|
|
|
|
+ Object.defineProperties( InterleavedBuffer.prototype, {
|
|
|
+
|
|
|
+ dynamic: {
|
|
|
+ get: function () {
|
|
|
+
|
|
|
+ console.warn( 'THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead.' );
|
|
|
+ return this.usage === DynamicDrawUsage;
|
|
|
+
|
|
|
+ },
|
|
|
+ set: function ( value ) {
|
|
|
+
|
|
|
+ console.warn( 'THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead.' );
|
|
|
+ this.setUsage( value );
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ } );
|
|
|
+
|
|
|
Object.assign( InterleavedBuffer.prototype, {
|
|
|
+ setDynamic: function ( value ) {
|
|
|
+
|
|
|
+ console.warn( 'THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.' );
|
|
|
+ this.setUsage( value === true ? DynamicDrawUsage : StaticDrawUsage );
|
|
|
+ return this;
|
|
|
|
|
|
+ },
|
|
|
setArray: function ( array ) {
|
|
|
|
|
|
console.warn( 'THREE.InterleavedBuffer: .setArray has been deprecated. Use BufferGeometry .setAttribute to replace/resize attribute buffers' );
|
|
@@ -48464,7 +48510,6 @@
|
|
|
return this;
|
|
|
|
|
|
}
|
|
|
-
|
|
|
} );
|
|
|
|
|
|
//
|
|
@@ -49319,6 +49364,9 @@
|
|
|
exports.DstAlphaFactor = DstAlphaFactor;
|
|
|
exports.DstColorFactor = DstColorFactor;
|
|
|
exports.DynamicBufferAttribute = DynamicBufferAttribute;
|
|
|
+ exports.DynamicCopyUsage = DynamicCopyUsage;
|
|
|
+ exports.DynamicDrawUsage = DynamicDrawUsage;
|
|
|
+ exports.DynamicReadUsage = DynamicReadUsage;
|
|
|
exports.EdgesGeometry = EdgesGeometry;
|
|
|
exports.EdgesHelper = EdgesHelper;
|
|
|
exports.EllipseCurve = EllipseCurve;
|
|
@@ -49590,7 +49638,13 @@
|
|
|
exports.SrcAlphaFactor = SrcAlphaFactor;
|
|
|
exports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor;
|
|
|
exports.SrcColorFactor = SrcColorFactor;
|
|
|
+ exports.StaticCopyUsage = StaticCopyUsage;
|
|
|
+ exports.StaticDrawUsage = StaticDrawUsage;
|
|
|
+ exports.StaticReadUsage = StaticReadUsage;
|
|
|
exports.StereoCamera = StereoCamera;
|
|
|
+ exports.StreamCopyUsage = StreamCopyUsage;
|
|
|
+ exports.StreamDrawUsage = StreamDrawUsage;
|
|
|
+ exports.StreamReadUsage = StreamReadUsage;
|
|
|
exports.StringKeyframeTrack = StringKeyframeTrack;
|
|
|
exports.SubtractEquation = SubtractEquation;
|
|
|
exports.SubtractiveBlending = SubtractiveBlending;
|