|
@@ -526,6 +526,10 @@ function denormalize( value, array ) {
|
|
|
|
|
|
return value;
|
|
|
|
|
|
+ case Uint32Array:
|
|
|
+
|
|
|
+ return value / 4294967295.0;
|
|
|
+
|
|
|
case Uint16Array:
|
|
|
|
|
|
return value / 65535.0;
|
|
@@ -534,6 +538,10 @@ function denormalize( value, array ) {
|
|
|
|
|
|
return value / 255.0;
|
|
|
|
|
|
+ case Int32Array:
|
|
|
+
|
|
|
+ return Math.max( value / 2147483647.0, - 1.0 );
|
|
|
+
|
|
|
case Int16Array:
|
|
|
|
|
|
return Math.max( value / 32767.0, - 1.0 );
|
|
@@ -558,6 +566,10 @@ function normalize( value, array ) {
|
|
|
|
|
|
return value;
|
|
|
|
|
|
+ case Uint32Array:
|
|
|
+
|
|
|
+ return Math.round( value * 4294967295.0 );
|
|
|
+
|
|
|
case Uint16Array:
|
|
|
|
|
|
return Math.round( value * 65535.0 );
|
|
@@ -566,6 +578,10 @@ function normalize( value, array ) {
|
|
|
|
|
|
return Math.round( value * 255.0 );
|
|
|
|
|
|
+ case Int32Array:
|
|
|
+
|
|
|
+ return Math.round( value * 2147483647.0 );
|
|
|
+
|
|
|
case Int16Array:
|
|
|
|
|
|
return Math.round( value * 32767.0 );
|
|
@@ -10008,6 +10024,18 @@ class Int8BufferAttribute extends BufferAttribute {
|
|
|
|
|
|
super( new Int8Array( array ), itemSize, normalized );
|
|
|
|
|
|
+ this.gpuType = FloatType;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.gpuType = source.gpuType;
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -10018,6 +10046,18 @@ class Uint8BufferAttribute extends BufferAttribute {
|
|
|
|
|
|
super( new Uint8Array( array ), itemSize, normalized );
|
|
|
|
|
|
+ this.gpuType = FloatType;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.gpuType = source.gpuType;
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -10038,6 +10078,18 @@ class Int16BufferAttribute extends BufferAttribute {
|
|
|
|
|
|
super( new Int16Array( array ), itemSize, normalized );
|
|
|
|
|
|
+ this.gpuType = FloatType;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.gpuType = source.gpuType;
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -10048,6 +10100,18 @@ class Uint16BufferAttribute extends BufferAttribute {
|
|
|
|
|
|
super( new Uint16Array( array ), itemSize, normalized );
|
|
|
|
|
|
+ this.gpuType = FloatType;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ copy( source ) {
|
|
|
+
|
|
|
+ super.copy( source );
|
|
|
+
|
|
|
+ this.gpuType = source.gpuType;
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -15006,9 +15070,9 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- function vertexAttribPointer( index, size, type, normalized, stride, offset ) {
|
|
|
+ function vertexAttribPointer( index, size, type, normalized, stride, offset, integer ) {
|
|
|
|
|
|
- if ( capabilities.isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT ) ) {
|
|
|
+ if ( integer === true ) {
|
|
|
|
|
|
gl.vertexAttribIPointer( index, size, type, stride, offset );
|
|
|
|
|
@@ -15066,6 +15130,10 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
|
|
|
const type = attribute.type;
|
|
|
const bytesPerElement = attribute.bytesPerElement;
|
|
|
|
|
|
+ // check for integer attributes (WebGL 2 only)
|
|
|
+
|
|
|
+ const integer = ( capabilities.isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType ) );
|
|
|
+
|
|
|
if ( geometryAttribute.isInterleavedBufferAttribute ) {
|
|
|
|
|
|
const data = geometryAttribute.data;
|
|
@@ -15106,7 +15174,8 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
|
|
|
type,
|
|
|
normalized,
|
|
|
stride * bytesPerElement,
|
|
|
- ( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement
|
|
|
+ ( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement,
|
|
|
+ integer
|
|
|
);
|
|
|
|
|
|
}
|
|
@@ -15147,7 +15216,8 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
|
|
|
type,
|
|
|
normalized,
|
|
|
size * bytesPerElement,
|
|
|
- ( size / programAttribute.locationSize ) * i * bytesPerElement
|
|
|
+ ( size / programAttribute.locationSize ) * i * bytesPerElement,
|
|
|
+ integer
|
|
|
);
|
|
|
|
|
|
}
|
|
@@ -17285,7 +17355,6 @@ function WebGLInfo( gl ) {
|
|
|
|
|
|
function reset() {
|
|
|
|
|
|
- render.frame ++;
|
|
|
render.calls = 0;
|
|
|
render.triangles = 0;
|
|
|
render.points = 0;
|
|
@@ -17710,6 +17779,7 @@ function WebGLObjects( gl, geometries, attributes, info ) {
|
|
|
*
|
|
|
*/
|
|
|
|
|
|
+
|
|
|
const emptyTexture = /*@__PURE__*/ new Texture();
|
|
|
const emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture();
|
|
|
const empty3dTexture = /*@__PURE__*/ new Data3DTexture();
|
|
@@ -27923,6 +27993,12 @@ class WebGLRenderer {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ if ( _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
|
|
|
+
|
|
|
+ console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
// Some experimental-webgl implementations do not have getShaderPrecisionFormat
|
|
|
|
|
|
if ( _gl.getShaderPrecisionFormat === undefined ) {
|
|
@@ -28733,6 +28809,8 @@ class WebGLRenderer {
|
|
|
|
|
|
if ( this.info.autoReset === true ) this.info.reset();
|
|
|
|
|
|
+ this.info.render.frame ++;
|
|
|
+
|
|
|
//
|
|
|
|
|
|
background.render( currentRenderList, scene );
|
|
@@ -36568,6 +36646,7 @@ function addContour( vertices, contour ) {
|
|
|
* }
|
|
|
*/
|
|
|
|
|
|
+
|
|
|
class ExtrudeGeometry extends BufferGeometry {
|
|
|
|
|
|
constructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( - 0.5, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), options = {} ) {
|
|
@@ -49005,6 +49084,7 @@ function intersectObject( object, raycaster, intersects, recursive ) {
|
|
|
* The azimuthal angle (theta) is measured from the positive z-axis.
|
|
|
*/
|
|
|
|
|
|
+
|
|
|
class Spherical {
|
|
|
|
|
|
constructor( radius = 1, phi = 0, theta = 0 ) {
|