Skip to content

Commit

Permalink
Update builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Aug 26, 2021
1 parent 447f434 commit 4f7e0e9
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 63 deletions.
173 changes: 117 additions & 56 deletions build/three.js
Original file line number Diff line number Diff line change
Expand Up @@ -5910,9 +5910,13 @@
this.version = 0;
}

onBuild() {}
onBuild()
/* shaderobject, renderer */
{}

onBeforeCompile() {}
onBeforeCompile()
/* shaderobject, renderer */
{}

customProgramCacheKey() {
return this.onBeforeCompile.toString();
Expand Down Expand Up @@ -7943,17 +7947,17 @@
clone() {
/*
// Handle primitives
const parameters = this.parameters;
if ( parameters !== undefined ) {
const values = [];
for ( const key in parameters ) {
values.push( parameters[ key ] );
}
const geometry = Object.create( this.constructor.prototype );
const parameters = this.parameters;
if ( parameters !== undefined ) {
const values = [];
for ( const key in parameters ) {
values.push( parameters[ key ] );
}
const geometry = Object.create( this.constructor.prototype );
this.constructor.apply( geometry, values );
return geometry;
}
return new this.constructor().copy( this );
}
return new this.constructor().copy( this );
*/
return new BufferGeometry().copy(this);
}
Expand Down Expand Up @@ -9706,7 +9710,7 @@

var morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1.0, 2.0 ) * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif";

var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargets;\n\t\tuniform int morphTargetsSize;\n\t\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in float offset, const in float stride ) {\n\t\t\tfloat j = float( vertexIndex ) * stride + offset;\n\t\t\tfloat x = mod( j, float( morphTargetsSize ) );\n\t\t\tfloat y = floor( j / float( morphTargetsSize ) );\n\t\t\tfloat dx = 1.0 / float( morphTargetsSize );\n\t\t\tfloat dy = 1.0 / float( morphTargetsSize );\n\t\t\tx = dx * ( x + 0.5 );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec3 morphUV = vec3( x, y, morphTargetIndex );\n\t\t\treturn texture( morphTargets, morphUV ).xyz;\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif";
var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargets;\n\t\tuniform int morphTargetsWidth;\n\t\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in float offset, const in float stride ) {\n\t\t\tfloat j = float( vertexIndex ) * stride + offset;\n\t\t\tfloat x = mod( j, float( morphTargetsWidth ) );\n\t\t\tfloat y = floor( j / float( morphTargetsWidth ) );\n\t\t\tfloat dx = 1.0 / float( morphTargetsWidth );\n\t\t\tfloat dy = 1.0 / float( morphTargetsWidth );\n\t\t\tx = dx * ( x + 0.5 );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec3 morphUV = vec3( x, y, morphTargetIndex );\n\t\t\treturn texture( morphTargets, morphUV ).xyz;\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif";

var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\t#ifndef USE_MORPHNORMALS\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0.0, 1.0 ) * morphTargetInfluences[ i ];\n\t\t\t#else\n\t\t\t\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0.0, 2.0 ) * morphTargetInfluences[ i ];\n\t\t\t#endif\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif";

Expand Down Expand Up @@ -12742,9 +12746,16 @@
const numberOfVertices = geometry.attributes.position.count;
const numberOfVertexData = hasMorphNormals === true ? 2 : 1; // (v,n) vs. (v)

const size = Math.ceil(Math.sqrt(numberOfVertices * numberOfVertexData));
const buffer = new Float32Array(size * size * 3 * numberOfMorphTargets);
const texture = new DataTexture2DArray(buffer, size, size, numberOfMorphTargets);
let width = numberOfVertices * numberOfVertexData;
let height = 1;

if (width > capabilities.maxTextureSize) {
height = Math.ceil(width / capabilities.maxTextureSize);
width = capabilities.maxTextureSize;
}

const buffer = new Float32Array(width * height * 3 * numberOfMorphTargets);
const texture = new DataTexture2DArray(buffer, width, height, numberOfMorphTargets);
texture.format = RGBFormat;
texture.type = FloatType; // fill buffer

Expand All @@ -12753,7 +12764,7 @@
for (let i = 0; i < numberOfMorphTargets; i++) {
const morphTarget = morphTargets[i];
const morphNormal = morphNormals[i];
const offset = size * size * 3 * i;
const offset = width * height * 3 * i;

for (let j = 0; j < morphTarget.count; j++) {
morph.fromBufferAttribute(morphTarget, j);
Expand Down Expand Up @@ -12789,7 +12800,7 @@
program.getUniforms().setValue(gl, 'morphTargetBaseInfluence', morphBaseInfluence);
program.getUniforms().setValue(gl, 'morphTargetInfluences', objectInfluences);
program.getUniforms().setValue(gl, 'morphTargets', entry.texture, textures);
program.getUniforms().setValue(gl, 'morphTargetsSize', entry.texture.image.width);
program.getUniforms().setValue(gl, 'morphTargetsWidth', entry.texture.image.width);
} else {
// When object doesn't have morph target influences defined, we treat it as a 0-length array
// This is important to make sure we set up morphTargetBaseInfluence / morphTargetInfluences
Expand Down Expand Up @@ -18921,7 +18932,9 @@
_isContextLost = true;
}

function onContextRestore() {
function onContextRestore()
/* event */
{
console.log('THREE.WebGLRenderer: Context Restored.');
_isContextLost = false;
const infoAutoReset = info.autoReset;
Expand Down Expand Up @@ -20062,7 +20075,9 @@
return new FogExp2(this.color, this.density);
}

toJSON() {
toJSON()
/* meta */
{
return {
type: 'FogExp2',
color: this.color.getHex(),
Expand All @@ -20086,7 +20101,9 @@
return new Fog(this.color, this.near, this.far);
}

toJSON() {
toJSON()
/* meta */
{
return {
type: 'Fog',
color: this.color.getHex(),
Expand Down Expand Up @@ -22314,7 +22331,9 @@
// - t [0 .. 1]


getPoint() {
getPoint()
/* t, optionalTarget */
{
console.warn('THREE.Curve: .getPoint() not implemented.');
return null;
} // Get point at relative position in curve according to arc length
Expand Down Expand Up @@ -23728,7 +23747,9 @@


function isValidDiagonal(a, b) {
return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && ( // dones't intersect other edges
locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && ( // locally visible
area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case
} // signed area of a triangle

Expand Down Expand Up @@ -26593,11 +26614,15 @@
} // Template methods for derived classes:


interpolate_() {
interpolate_()
/* i1, t0, t, t1 */
{
throw new Error('call to abstract method'); // implementations shall return this.resultBuffer
}

intervalChanged_() {// empty
intervalChanged_()
/* i1, t0, t1 */
{// empty
}

} // ALIAS DEFINITIONS
Expand Down Expand Up @@ -27590,7 +27615,9 @@
this.requestHeader = {};
}

load() {}
load()
/* url, onLoad, onProgress, onError */
{}

loadAsync(url, onProgress) {
const scope = this;
Expand All @@ -27599,7 +27626,9 @@
});
}

parse() {}
parse()
/* data */
{}

setCrossOrigin(crossOrigin) {
this.crossOrigin = crossOrigin;
Expand Down Expand Up @@ -33854,7 +33883,9 @@
super();
this.material = material;

this.render = function () {};
this.render = function ()
/* renderCallback */
{};

this.hasPositions = false;
this.hasNormals = false;
Expand Down Expand Up @@ -34034,15 +34065,15 @@
// TODO: delete this comment?
const distanceGeometry = new THREE.IcosahedronBufferGeometry( 1, 2 );
const distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } );
this.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );
this.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );
this.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial );
const d = light.distance;
if ( d === 0.0 ) {
this.lightDistance.visible = false;
} else {
this.lightDistance.scale.set( d, d, d );
}
this.add( this.lightDistance );
const d = light.distance;
if ( d === 0.0 ) {
this.lightDistance.visible = false;
} else {
this.lightDistance.scale.set( d, d, d );
}
this.add( this.lightDistance );
*/
}

Expand All @@ -34059,12 +34090,12 @@
}
/*
const d = this.light.distance;
if ( d === 0.0 ) {
this.lightDistance.visible = false;
} else {
this.lightDistance.visible = true;
if ( d === 0.0 ) {
this.lightDistance.visible = false;
} else {
this.lightDistance.visible = true;
this.lightDistance.scale.set( d, d, d );
}
}
*/

}
Expand Down Expand Up @@ -34463,7 +34494,7 @@
1/___0/|
| 6__|_7
2/___3/
0: max.x, max.y, max.z
0: max.x, max.y, max.z
1: min.x, max.y, max.z
2: min.x, min.y, max.z
3: max.x, min.y, max.z
Expand Down Expand Up @@ -34896,10 +34927,14 @@
};

Loader.Handlers = {
add: function () {
add: function ()
/* regex, loader */
{
console.error('THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.');
},
get: function () {
get: function ()
/* file */
{
console.error('THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.');
}
};
Expand Down Expand Up @@ -34987,7 +35022,9 @@
return vector.applyMatrix3(this);
};

Matrix3.prototype.multiplyVector3Array = function () {
Matrix3.prototype.multiplyVector3Array = function ()
/* a */
{
console.error('THREE.Matrix3: .multiplyVector3Array() has been removed.');
};

Expand All @@ -34996,7 +35033,9 @@
return attribute.applyMatrix3(this);
};

Matrix3.prototype.applyToVector3Array = function () {
Matrix3.prototype.applyToVector3Array = function ()
/* array, offset, length */
{
console.error('THREE.Matrix3: .applyToVector3Array() has been removed.');
};

Expand Down Expand Up @@ -35040,7 +35079,9 @@
return vector.applyMatrix4(this);
};

Matrix4.prototype.multiplyVector3Array = function () {
Matrix4.prototype.multiplyVector3Array = function ()
/* a */
{
console.error('THREE.Matrix4: .multiplyVector3Array() has been removed.');
};

Expand Down Expand Up @@ -35079,7 +35120,9 @@
return attribute.applyMatrix4(this);
};

Matrix4.prototype.applyToVector3Array = function () {
Matrix4.prototype.applyToVector3Array = function ()
/* array, offset, length */
{
console.error('THREE.Matrix4: .applyToVector3Array() has been removed.');
};

Expand Down Expand Up @@ -35412,7 +35455,9 @@
console.warn('THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.');
return this.usage === DynamicDrawUsage;
},
set: function () {
set: function ()
/* value */
{
console.warn('THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.');
this.setUsage(DynamicDrawUsage);
}
Expand All @@ -35425,9 +35470,13 @@
return this;
};

BufferAttribute.prototype.copyIndicesArray = function () {
BufferAttribute.prototype.copyIndicesArray = function ()
/* indices */
{
console.error('THREE.BufferAttribute: .copyIndicesArray() has been removed.');
}, BufferAttribute.prototype.setArray = function () {
}, BufferAttribute.prototype.setArray = function ()
/* array */
{
console.error('THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers');
}; //

Expand Down Expand Up @@ -35502,7 +35551,9 @@
return this;
};

InterleavedBuffer.prototype.setArray = function () {
InterleavedBuffer.prototype.setArray = function ()
/* array */
{
console.error('THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers');
}; //

Expand Down Expand Up @@ -35736,7 +35787,9 @@
console.warn('THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.');
return undefined;
},
set: function () {
set: function ()
/* value */
{
console.warn('THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.');
}
},
Expand Down Expand Up @@ -35787,7 +35840,9 @@
console.warn('THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.');
return undefined;
},
set: function () {
set: function ()
/* cullFace */
{
console.warn('THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.');
}
},
Expand Down Expand Up @@ -35982,13 +36037,19 @@
} //

const SceneUtils = {
createMultiMaterialObject: function () {
createMultiMaterialObject: function ()
/* geometry, materials */
{
console.error('THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js');
},
detach: function () {
detach: function ()
/* child, parent, scene */
{
console.error('THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js');
},
attach: function () {
attach: function ()
/* child, scene, parent */
{
console.error('THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js');
}
}; //
Expand Down
2 changes: 1 addition & 1 deletion build/three.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 4f7e0e9

Please sign in to comment.