|
@@ -7307,9 +7307,7 @@ class BufferAttribute {
|
|
|
|
|
|
applyMatrix4(m) {
|
|
|
for (let i = 0, l = this.count; i < l; i++) {
|
|
|
- _vector$9.x = this.getX(i);
|
|
|
- _vector$9.y = this.getY(i);
|
|
|
- _vector$9.z = this.getZ(i);
|
|
|
+ _vector$9.fromBufferAttribute(this, i);
|
|
|
|
|
|
_vector$9.applyMatrix4(m);
|
|
|
|
|
@@ -7321,9 +7319,7 @@ class BufferAttribute {
|
|
|
|
|
|
applyNormalMatrix(m) {
|
|
|
for (let i = 0, l = this.count; i < l; i++) {
|
|
|
- _vector$9.x = this.getX(i);
|
|
|
- _vector$9.y = this.getY(i);
|
|
|
- _vector$9.z = this.getZ(i);
|
|
|
+ _vector$9.fromBufferAttribute(this, i);
|
|
|
|
|
|
_vector$9.applyNormalMatrix(m);
|
|
|
|
|
@@ -7335,9 +7331,7 @@ class BufferAttribute {
|
|
|
|
|
|
transformDirection(m) {
|
|
|
for (let i = 0, l = this.count; i < l; i++) {
|
|
|
- _vector$9.x = this.getX(i);
|
|
|
- _vector$9.y = this.getY(i);
|
|
|
- _vector$9.z = this.getZ(i);
|
|
|
+ _vector$9.fromBufferAttribute(this, i);
|
|
|
|
|
|
_vector$9.transformDirection(m);
|
|
|
|
|
@@ -10039,7 +10033,7 @@ var uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 =
|
|
|
var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";
|
|
|
|
|
|
const vertex$g = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
|
|
|
-const fragment$g = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
|
|
|
+const fragment$g = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
|
|
|
|
|
|
const vertex$f = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
|
|
|
const fragment$f = "#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
|
|
@@ -16592,13 +16586,15 @@ function WebGLTextures(_gl, extensions, state, properties, capabilities, utils,
|
|
|
let useOffscreenCanvas = false;
|
|
|
|
|
|
try {
|
|
|
- useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined' && new OffscreenCanvas(1, 1).getContext('2d') !== null;
|
|
|
+ useOffscreenCanvas = typeof OffscreenCanvas !== 'undefined' // eslint-disable-next-line compat/compat
|
|
|
+ && new OffscreenCanvas(1, 1).getContext('2d') !== null;
|
|
|
} catch (err) {// Ignore any errors
|
|
|
}
|
|
|
|
|
|
function createCanvas(width, height) {
|
|
|
// Use OffscreenCanvas when available. Specially needed in web workers
|
|
|
- return useOffscreenCanvas ? new OffscreenCanvas(width, height) : createElementNS('canvas');
|
|
|
+ return useOffscreenCanvas ? // eslint-disable-next-line compat/compat
|
|
|
+ new OffscreenCanvas(width, height) : createElementNS('canvas');
|
|
|
}
|
|
|
|
|
|
function resizeImage(image, needsPowerOfTwo, needsNewCanvas, maxSize) {
|
|
@@ -20452,15 +20448,11 @@ function WebGLRenderer(parameters = {}) {
|
|
|
!halfFloatSupportedByExt) {
|
|
|
console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.');
|
|
|
return;
|
|
|
- }
|
|
|
+ } // the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)
|
|
|
|
|
|
- if (_gl.checkFramebufferStatus(_gl.FRAMEBUFFER) === _gl.FRAMEBUFFER_COMPLETE) {
|
|
|
- // the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)
|
|
|
- if (x >= 0 && x <= renderTarget.width - width && y >= 0 && y <= renderTarget.height - height) {
|
|
|
- _gl.readPixels(x, y, width, height, utils.convert(textureFormat), utils.convert(textureType), buffer);
|
|
|
- }
|
|
|
- } else {
|
|
|
- console.error('THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.');
|
|
|
+
|
|
|
+ if (x >= 0 && x <= renderTarget.width - width && y >= 0 && y <= renderTarget.height - height) {
|
|
|
+ _gl.readPixels(x, y, width, height, utils.convert(textureFormat), utils.convert(textureType), buffer);
|
|
|
}
|
|
|
} finally {
|
|
|
// restore framebuffer of current render target if necessary
|
|
@@ -20831,9 +20823,7 @@ class InterleavedBufferAttribute {
|
|
|
|
|
|
applyMatrix4(m) {
|
|
|
for (let i = 0, l = this.data.count; i < l; i++) {
|
|
|
- _vector$6.x = this.getX(i);
|
|
|
- _vector$6.y = this.getY(i);
|
|
|
- _vector$6.z = this.getZ(i);
|
|
|
+ _vector$6.fromBufferAttribute(this, i);
|
|
|
|
|
|
_vector$6.applyMatrix4(m);
|
|
|
|
|
@@ -20845,9 +20835,7 @@ class InterleavedBufferAttribute {
|
|
|
|
|
|
applyNormalMatrix(m) {
|
|
|
for (let i = 0, l = this.count; i < l; i++) {
|
|
|
- _vector$6.x = this.getX(i);
|
|
|
- _vector$6.y = this.getY(i);
|
|
|
- _vector$6.z = this.getZ(i);
|
|
|
+ _vector$6.fromBufferAttribute(this, i);
|
|
|
|
|
|
_vector$6.applyNormalMatrix(m);
|
|
|
|
|
@@ -20859,9 +20847,7 @@ class InterleavedBufferAttribute {
|
|
|
|
|
|
transformDirection(m) {
|
|
|
for (let i = 0, l = this.count; i < l; i++) {
|
|
|
- _vector$6.x = this.getX(i);
|
|
|
- _vector$6.y = this.getY(i);
|
|
|
- _vector$6.z = this.getZ(i);
|
|
|
+ _vector$6.fromBufferAttribute(this, i);
|
|
|
|
|
|
_vector$6.transformDirection(m);
|
|
|
|
|
@@ -21354,10 +21340,7 @@ class SkinnedMesh extends Mesh {
|
|
|
const skinWeight = this.geometry.attributes.skinWeight;
|
|
|
|
|
|
for (let i = 0, l = skinWeight.count; i < l; i++) {
|
|
|
- vector.x = skinWeight.getX(i);
|
|
|
- vector.y = skinWeight.getY(i);
|
|
|
- vector.z = skinWeight.getZ(i);
|
|
|
- vector.w = skinWeight.getW(i);
|
|
|
+ vector.fromBufferAttribute(skinWeight, i);
|
|
|
const scale = 1.0 / vector.manhattanLength();
|
|
|
|
|
|
if (scale !== Infinity) {
|