language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
mrdoob
three.js
bfe473a81ed320e950759052e687e19146e39fba.json
fix Object3D.updateMatrixWorld definition Judging by the implementation, the `force` parameter should be optional.
src/core/Object3D.d.ts
@@ -306,7 +306,7 @@ export class Object3D extends EventDispatcher { /** * Updates global transform of the object and its children. */ - updateMatrixWorld(force: boolean): void; + updateMatrixWorld(force?: boolean): void; updateWorldMatrix(updateParents: boolean, updateChildren: boolean): void;
false
Other
mrdoob
three.js
deecc75ca313e6c281ede482493f01d1647bb0a1.json
Fix minor bug
examples/js/cameras/CinematicCamera.js
@@ -193,7 +193,7 @@ THREE.CinematicCamera.prototype.renderCinematic = function ( scene, renderer ) { scene.overrideMaterial = this.materialDepth; renderer.setRenderTarget( this.postprocessing.rtTextureDepth ); renderer.clear(); - renderer.render( scene, camera, this.postprocessing.rtTextureDepth ); + renderer.render( scene, camera ); // Render bokeh composite
false
Other
mrdoob
three.js
ae64821d1d94fecf4aeb6d80b27c4146816b40b0.json
Update stats every frame
examples/misc_controls_trackball.html
@@ -150,14 +150,16 @@ function animate() { requestAnimationFrame( animate ); + controls.update(); + + stats.update(); } function render() { renderer.render( scene, camera ); - stats.update(); }
false
Other
mrdoob
three.js
42f7040b26bdfcbb3c400506465c1352f9ad8adf.json
Fix incorrect body size
examples/misc_controls_trackball.html
@@ -5,7 +5,7 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> <style> - html { + html, body { width: 100%; height: 100%; overflow: hidden;
false
Other
mrdoob
three.js
961708ba75196ece15aa82811eba405d34dacfcd.json
Fix the overflowing div The side padding with 100% width causes the div to overflow the screen. So we remove the side padding (no used anyways), and also tell it to use box-sizing: border box to properly calculate the box sizing as expected.
examples/misc_controls_trackball.html
@@ -3,7 +3,7 @@ <head> <title>three.js webgl - trackball controls</title> <meta charset="utf-8"> - <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1"> + <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> <style> html { width: 100%; @@ -20,19 +20,14 @@ background-color: #fff; margin: 0px; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; } #info { color:#000; position: absolute; top: 0px; width: 100%; - padding: 5px; - + padding: 5px 0; + box-sizing: border-box; } a {
false
Other
mrdoob
three.js
a5dc13b1a0b8d09d683618fd16db1f3b2c2d0f1f.json
update code style all sea3d examples
examples/webgl_loader_sea3d_bvh_retarget.html
@@ -157,12 +157,11 @@ scene.add( bvhSkeletonHelper ); scene.add( boneContainer ); - // play animation - bvhMixer = new THREE.AnimationMixer( bvhSkeletonHelper ); - // get offsets when it is in T-Pose options.offsets = THREE.SkeletonUtils.getSkeletonOffsets( player, bvhSkeletonHelper, options ); + // play animation + bvhMixer = new THREE.AnimationMixer( bvhSkeletonHelper ); bvhMixer.clipAction( result.clip ).setEffectiveWeight( 1.0 ).play(); } );
true
Other
mrdoob
three.js
a5dc13b1a0b8d09d683618fd16db1f3b2c2d0f1f.json
update code style all sea3d examples
examples/webgl_loader_sea3d_hierarchy.html
@@ -59,11 +59,11 @@ if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); - console.log("Visit https://github.com/sunag/sea3d to all codes and builds under development."); + console.log( "Visit https://github.com/sunag/sea3d to all codes and builds under development." ); var container, stats; - var camera, scene, renderer, composer, controls; + var camera, scene, renderer, composer; var loader; @@ -77,30 +77,30 @@ loader = new THREE.SEA3D( { - autoPlay : false, // Auto play animations - container : scene // Container to add models + autoPlay: false, // Auto play animations + container: scene // Container to add models } ); - loader.onComplete = function( e ) { + loader.onComplete = function ( e ) { // play all animations - for(var i = 0; i < loader.meshes.length; i++) { + for ( var i = 0; i < loader.meshes.length; i ++ ) { - if (loader.meshes[i].animator) - loader.meshes[i].animator.play( "root" ); + if ( loader.meshes[ i ].animator ) + loader.meshes[ i ].animator.play( "root" ); } // Get the first camera from SEA3D Studio // use loader.get... to get others objects - var cam = loader.cameras[0]; + var cam = loader.cameras[ 0 ]; camera.position.copy( cam.position ); camera.rotation.copy( cam.rotation ); - controls = new THREE.OrbitControls( camera ); + new THREE.OrbitControls( camera ); animate();
true
Other
mrdoob
three.js
a5dc13b1a0b8d09d683618fd16db1f3b2c2d0f1f.json
update code style all sea3d examples
examples/webgl_loader_sea3d_keyframe.html
@@ -56,11 +56,11 @@ if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); - console.log("Visit https://github.com/sunag/sea3d to all codes and builds under development."); + console.log( "Visit https://github.com/sunag/sea3d to all codes and builds under development." ); var container, stats; - var camera, scene, renderer, composer, controls, demoAt = -1; + var camera, scene, renderer, composer, demoAt = - 1; var loader; @@ -74,25 +74,25 @@ loader = new THREE.SEA3D( { - autoPlay : false, // Manual play animations - container : scene // Container to add models + autoPlay: false, // Manual play animations + container: scene // Container to add models } ); - loader.onComplete = function( e ) { + loader.onComplete = function ( e ) { // Get the first camera from 3ds Max // use loader.get... to get others objects - var cam = loader.cameras[0]; + var cam = loader.cameras[ 0 ]; camera.position.copy( cam.position ); camera.rotation.copy( cam.rotation ); - controls = new THREE.OrbitControls( camera ); + new THREE.OrbitControls( camera ); // events - window.addEventListener('click', onMouseClick, false); + window.addEventListener( 'click', onMouseClick, false ); animate(); @@ -104,36 +104,36 @@ // Animation Functions // - function playAll(id, crossfade, offset) { + function playAll( id, crossfade, offset ) { // play all animations - for(var i = 0; i < loader.meshes.length; i++) { + for ( var i = 0; i < loader.meshes.length; i ++ ) { - if (loader.meshes[i].animator) - loader.meshes[i].animator.play(id, crossfade, offset); + if ( loader.meshes[ i ].animator ) + loader.meshes[ i ].animator.play( id, crossfade, offset ); } } function setTimeScale( timeScale ) { - for(var i = 0; i < loader.meshes.length; i++) { + for ( var i = 0; i < loader.meshes.length; i ++ ) { - if (loader.meshes[i].animator) - loader.meshes[i].animator.setTimeScale( timeScale ); + if ( loader.meshes[ i ].animator ) + loader.meshes[ i ].animator.setTimeScale( timeScale ); } } function stopAll() { - for(var i = 0; i < loader.meshes.length; i++) { + for ( var i = 0; i < loader.meshes.length; i ++ ) { - if (loader.meshes[i].animator) - loader.meshes[i].animator.stop(); + if ( loader.meshes[ i ].animator ) + loader.meshes[ i ].animator.stop(); } @@ -201,72 +201,74 @@ // - function description(msg) { + function description( msg ) { - document.getElementById('description').innerHTML = (demoAt + 1) + " - " + msg; + document.getElementById( 'description' ).innerHTML = ( demoAt + 1 ) + " - " + msg; } function onMouseClick( e ) { // 0 at 3 demos - switch( demoAt = ++demoAt % 4 ) { + switch ( demoAt = ++ demoAt % 4 ) { - // play all animation to sequence "crash#1" + // play all animation to sequence "crash#1" case 0: - playAll("crash#1", .5); - setTimeScale(1); + playAll( "crash#1", .5 ); + setTimeScale( 1 ); - description("crash#1 - crossfade 0.5 seconds"); + description( "crash#1 - crossfade 0.5 seconds" ); break; - // play all animation to sequence "crash#2" + // play all animation to sequence "crash#2" case 1: - playAll("crash#2", .5); + playAll( "crash#2", .5 ); - description("crash#2 - crossfade 0.5 seconds"); + description( "crash#2 - crossfade 0.5 seconds" ); break; - // play animation in single object + // play animation in single object case 2: stopAll(); - var fracture99 = loader.getMesh("Object099"); + var fracture99 = loader.getMesh( "Object099" ); //fracture99.animator.setTimeScale( 1 ); //fracture99.animator.playing //fracture99.animator.currentAnimation //fracture99.animator.previousAnimation - fracture99.animator.play("crash#2", .5, 0); + fracture99.animator.play( "crash#2", .5, 0 ); //fracture99.animator.stop(); //fracture99.animator.pause(); //fracture99.animator.resume(); - description("crash#2 in single object - crossfade 0.5 seconds"); + description( "crash#2 in single object - crossfade 0.5 seconds" ); break; - // set time scale + // set time scale case 3: - playAll("crash#2", .5); - setTimeScale(.1); + playAll( "crash#2", .5 ); + setTimeScale( .1 ); - description("time scale / 10 - crossfade 0.5 seconds"); + description( "time scale / 10 - crossfade 0.5 seconds" ); break; + } + } //
true
Other
mrdoob
three.js
a5dc13b1a0b8d09d683618fd16db1f3b2c2d0f1f.json
update code style all sea3d examples
examples/webgl_loader_sea3d_morph.html
@@ -56,11 +56,11 @@ if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); - console.log("Visit https://github.com/sunag/sea3d to all codes and builds under development."); + console.log( "Visit https://github.com/sunag/sea3d to all codes and builds under development." ); var container, stats; - var camera, scene, renderer, composer, controls, teapot; + var camera, scene, renderer, composer, teapot; var loader; @@ -74,26 +74,26 @@ loader = new THREE.SEA3D( { - autoPlay : true, // Auto play animations - scripts : false, // Disable embed scripts - container : scene // Container to add models + autoPlay: true, // Auto play animations + scripts: false, // Disable embed scripts + container: scene // Container to add models } ); - loader.onComplete = function( e ) { + loader.onComplete = function ( e ) { // Get the first camera from SEA3D Studio // use loader.get... to get others objects - var cam = loader.cameras[0]; + var cam = loader.cameras[ 0 ]; camera.position.copy( cam.position ); camera.rotation.copy( cam.rotation ); - controls = new THREE.OrbitControls( camera ); + new THREE.OrbitControls( camera ); // get mesh - teapot = loader.getMesh("Teapot01"); + teapot = loader.getMesh( "Teapot01" ); // events @@ -161,8 +161,8 @@ // change morph weight: 0 at 1 // names from modifier Morph of 3ds Max - teapot.setWeight("OldTeapot", mouseX / window.innerWidth); - teapot.setWeight("Sphere", mouseY / window.innerHeight); + teapot.setWeight( "OldTeapot", mouseX / window.innerWidth ); + teapot.setWeight( "Sphere", mouseY / window.innerHeight ); }
true
Other
mrdoob
three.js
a5dc13b1a0b8d09d683618fd16db1f3b2c2d0f1f.json
update code style all sea3d examples
examples/webgl_loader_sea3d_skinning.html
@@ -58,11 +58,11 @@ if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); - console.log("Visit https://github.com/sunag/sea3d to all codes and builds under development."); + console.log( "Visit https://github.com/sunag/sea3d to all codes and builds under development." ); var container, stats; - var camera, scene, renderer, composer, controls, player, hat; + var camera, scene, renderer, composer, player, hat; var loader; @@ -76,36 +76,36 @@ loader = new THREE.SEA3D( { - autoPlay : true, // Auto play animations - container : scene, // Container to add models - multiplier : .6 // Light multiplier + autoPlay: true, // Auto play animations + container: scene, // Container to add models + multiplier: .6 // Light multiplier } ); - loader.onComplete = function( e ) { + loader.onComplete = function ( e ) { // Get the first camera from SEA3D Studio // use loader.get... to get others objects - var cam = loader.cameras[0]; + var cam = loader.cameras[ 0 ]; camera.position.copy( cam.position ); camera.rotation.copy( cam.rotation ); controls = new THREE.OrbitControls( camera ); // get meshes - player = loader.getMesh("Player"); - hat = loader.getMesh("Hat"); + player = loader.getMesh( "Player" ); + hat = loader.getMesh( "Hat" ); // on animation complete example //player.animation['pass#1'].onComplete = function(e) { console.log("Animation completed!", e); }; // or - player.animation['pass#1'].addEventListener(THREE.SEA3D.Animation.COMPLETE, function(e) { + player.animation[ 'pass#1' ].addEventListener( THREE.SEA3D.Animation.COMPLETE, function ( e ) { - console.log("Animation completed!", e); + console.log( "Animation completed!", e ); } ); @@ -124,34 +124,34 @@ function updatePlayerCountDescription( count ) { - document.getElementById("playercount").innerText = "Numbers of players " + count + " | Middle click to clone"; + document.getElementById( "playercount" ).innerText = "Numbers of players " + count + " | Middle click to clone"; } - var cloneAsset = function() { + var cloneAsset = function () { var count = 2, size = 25; - return function() { + return function () { updatePlayerCountDescription( count ); - var PHI = Math.PI * 2 * (Math.sqrt(5) + 1) / 2; // golden ratio - var angle = PHI * count++; + var PHI = Math.PI * 2 * ( Math.sqrt( 5 ) + 1 ) / 2; // golden ratio + var angle = PHI * count ++; var container = new THREE.Object3D(); container.position.z = ( size * count ) * Math.cos( angle ); container.position.x = ( size * count ) * Math.sin( angle ); scene.add( container ); - - var domain = loader.clone( { - autoPlay : true, - container : container, - lights : false - }); - } + var domain = loader.clone( { + autoPlay: true, + container: container, + lights: false + } ); + + }; }(); @@ -205,22 +205,22 @@ function onRightClick( e ) { // play character animation - if (player.currentAnimation.name == "idle") - player.play("run", .5);// play "pass#1" to caller .onComplete animation example + if ( player.currentAnimation.name == "idle" ) + player.play( "run", .5 );// play "pass#1" to caller .onComplete animation example else - player.play("idle", .5); + player.play( "idle", .5 ); e.preventDefault(); } function onMouseClick( e ) { - if (e.button === 0) { + if ( e.button === 0 ) { - hat.visible = !hat.visible; + hat.visible = ! hat.visible; - } else if (e.button === 1) { + } else if ( e.button === 1 ) { cloneAsset();
true
Other
mrdoob
three.js
a5dc13b1a0b8d09d683618fd16db1f3b2c2d0f1f.json
update code style all sea3d examples
examples/webgl_loader_sea3d_sound.html
@@ -103,7 +103,7 @@ if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); - console.log("Visit https://github.com/sunag/sea3d to all codes and builds under development."); + console.log( "Visit https://github.com/sunag/sea3d to all codes and builds under development." ); var container, raycaster, stats; @@ -126,12 +126,12 @@ loader = new THREE.SEA3D( { - autoPlay : true, // Auto play animations - container : scene // Container to add models + autoPlay: true, // Auto play animations + container: scene // Container to add models } ); - loader.onComplete = function( e ) { + loader.onComplete = function ( e ) { audioListener = loader.audioListener; @@ -144,19 +144,19 @@ // sound asset 1 - lightOutside = loader.getLight("Light1"); + lightOutside = loader.getLight( "Light1" ); - var soundOutside = loader.getSound3D("Point001"); + var soundOutside = loader.getSound3D( "Point001" ); soundOutsideAnalyser = new THREE.AudioAnalyser( soundOutside, 32 ); // sound asset 2 + area - lightArea = loader.getLight("Light2"); + lightArea = loader.getLight( "Light2" ); - soundArea = loader.getSound3D("Point002"); + soundArea = loader.getSound3D( "Point002" ); soundAreaAnalyser = new THREE.AudioAnalyser( soundArea, 512 ); - collisionArea = loader.getMesh("Torus003"); + collisionArea = loader.getMesh( "Torus003" ); animate(); @@ -394,18 +394,18 @@ function updateSoundFilter() { // difference position between sound and listener - var difPos = new THREE.Vector3().setFromMatrixPosition( soundArea.matrixWorld ).sub(audioPos); + var difPos = new THREE.Vector3().setFromMatrixPosition( soundArea.matrixWorld ).sub( audioPos ); var length = difPos.length(); // pick a vector from camera to sound raycaster.set( audioPos, difPos.normalize() ); // intersecting sound1 - if ( length > 50 && raycaster.intersectObjects( [collisionArea] ).length ) { + if ( length > 50 && raycaster.intersectObjects( [ collisionArea ] ).length ) { - if ( soundArea.getFilters()[0] !== soundFilter ) soundArea.setFilters( [ soundFilter ] ); + if ( soundArea.getFilters()[ 0 ] !== soundFilter ) soundArea.setFilters( [ soundFilter ] ); - } else if ( soundArea.getFilters()[0] === soundFilter ) { + } else if ( soundArea.getFilters()[ 0 ] === soundFilter ) { soundArea.setFilters( [] );
true
Other
mrdoob
three.js
79b1f64acb4a0975fda7c23f70831e14da1fcaf6.json
remove unneeded parameters
examples/js/loaders/FBXLoader.js
@@ -555,7 +555,7 @@ THREE.FBXLoader = ( function () { switch ( type ) { case 'Bump': - parameters.bumpMap = self.getTexture( FBXTree, textureMap, child.ID, connections ); + parameters.bumpMap = self.getTexture( textureMap, child.ID ); break; case 'DiffuseColor':
false
Other
mrdoob
three.js
1e2885f4bc95ab3c7e1558b2b6ee4b5841304dd1.json
Fix quotation marks
src/objects/Line.d.ts
@@ -15,7 +15,7 @@ export class Line extends Object3D { geometry: Geometry | BufferGeometry; material: Material | Material[]; - type: "Line" | "LineLoop" | "LineSegments"; + type: 'Line' | 'LineLoop' | 'LineSegments'; isLine: true; computeLineDistances(): this;
true
Other
mrdoob
three.js
1e2885f4bc95ab3c7e1558b2b6ee4b5841304dd1.json
Fix quotation marks
src/objects/LineLoop.d.ts
@@ -9,6 +9,6 @@ export class LineLoop extends Line { material?: Material | Material[] ); - type: "LineLoop"; + type: 'LineLoop'; isLineLoop: true; }
true
Other
mrdoob
three.js
1e2885f4bc95ab3c7e1558b2b6ee4b5841304dd1.json
Fix quotation marks
src/objects/LineSegments.d.ts
@@ -19,6 +19,6 @@ export class LineSegments extends Line { mode?: number ); - type: "LineSegments"; + type: 'LineSegments'; isLineSegments: true; }
true
Other
mrdoob
three.js
b36f4af69db693a4c2a6466352b1bbfc0062380a.json
Clarify availability of renderers
README.md
@@ -10,7 +10,7 @@ three.js #### JavaScript 3D library #### -The aim of the project is to create an easy to use, lightweight, 3D library. The library provides Canvas 2D, SVG, CSS3D and WebGL renderers. +The aim of the project is to create an easy to use, lightweight, 3D library with a default WebGL renderer. The library also provides Canvas 2D, SVG and CSS3D renderers in the examples. [Examples](http://threejs.org/examples/) &mdash; [Documentation](http://threejs.org/docs/) &mdash;
false
Other
mrdoob
three.js
8ac32926c7d0e1bd2dcd0de79178ecb938889261.json
Fix a wrong character.
docs/api/zh/renderers/WebGLRenderer.html
@@ -348,7 +348,7 @@ <h3>[method:null resetGLState]( )</h3> <p>将GL状态重置为默认值。WebGL环境丢失时会内部调用</p> <h3>[method:null readRenderTargetPixels]( [param:WebGLRenderTarget renderTarget], [param:Float x], [param:Float y], [param:Float width], [param:Float height], buffer )</h3> - <p>将enderTarget中的像素数据读取到传入的缓冲区中。这是link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/readPixels WebGLRenderingContext.readPixels]()的包装器<br /> + <p>将enderTarget中的像素数据读取到传入的缓冲区中。这是[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/readPixels WebGLRenderingContext.readPixels]()的包装器<br /> 示例:[example:webgl_interactive_cubes_gpu interactive / cubes / gpu] </p>
false
Other
mrdoob
three.js
bcd4bec92609ce8af76a590b0f281ecf71019c2b.json
Use PMREMGenerator in webgl_loader_gltf example.
examples/webgl_loader_gltf.html
@@ -40,6 +40,9 @@ <script src="js/controls/OrbitControls.js"></script> <script src="js/loaders/GLTFLoader.js"></script> + <script src="js/pmrem/PMREMGenerator.js"></script> + <script src="js/pmrem/PMREMCubeUVPacker.js"></script> + <script src="js/WebGL.js"></script> <script src="js/libs/stats.min.js"></script> @@ -52,7 +55,7 @@ } var container, stats, controls; - var camera, scene, renderer, light; + var camera, scene, renderer; init(); animate(); @@ -69,36 +72,43 @@ controls.target.set( 0, - 0.2, - 0.2 ); controls.update(); + scene = new THREE.Scene(); + var urls = [ 'posx.jpg', 'negx.jpg', 'posy.jpg', 'negy.jpg', 'posz.jpg', 'negz.jpg' ]; var loader = new THREE.CubeTextureLoader().setPath( 'textures/cube/Bridge2/' ); - var background = loader.load( urls ); + loader.load( urls, function ( texture ) { - scene = new THREE.Scene(); - scene.background = background; + var pmremGenerator = new THREE.PMREMGenerator( texture ); + pmremGenerator.update( renderer ); - light = new THREE.HemisphereLight( 0xbbbbff, 0x444422 ); - light.position.set( 0, 1, 0 ); - scene.add( light ); + var pmremCubeUVPacker = new THREE.PMREMCubeUVPacker( pmremGenerator.cubeLods ); + pmremCubeUVPacker.update( renderer ); - // model - var loader = new THREE.GLTFLoader().setPath( 'models/gltf/DamagedHelmet/glTF/' ); - loader.load( 'DamagedHelmet.gltf', function ( gltf ) { + var envMap = pmremCubeUVPacker.CubeUVRenderTarget.texture; - gltf.scene.traverse( function ( child ) { + // model - if ( child.isMesh ) { + var loader = new THREE.GLTFLoader().setPath( 'models/gltf/DamagedHelmet/glTF/' ); + loader.load( 'DamagedHelmet.gltf', function ( gltf ) { - child.material.envMap = background; + gltf.scene.traverse( function ( child ) { - } + if ( child.isMesh ) { - } ); + child.material.envMap = envMap; - scene.add( gltf.scene ); + } + + } ); + + scene.add( gltf.scene ); + + } ); - }, undefined, function ( e ) { + pmremGenerator.dispose(); + pmremCubeUVPacker.dispose(); - console.error( e ); + scene.background = texture; } );
false
Other
mrdoob
three.js
7c0f31b6bce1b5a4e951bd5a0b7d46d0650c7bac.json
Add a collada exporter link to the docs
docs/list.js
@@ -382,7 +382,8 @@ var list = { "Exporters": { "GLTFExporter": "examples/exporters/GLTFExporter", - "PLYExporter": "examples/exporters/PLYExporter" + "PLYExporter": "examples/exporters/PLYExporter", + "ColladaExporter": "examples/exporters/ColladaExporter" }, "Plugins": {
false
Other
mrdoob
three.js
2a2451b76717cfff000d1289a5e344a02ac4f707.json
Export all types from all type definition files
src/Three.d.ts
@@ -1,160 +1,174 @@ -import './polyfills'; - -export { - WebGLMultisampleRenderTarget, -} from './renderers/WebGLMultisampleRenderTarget'; -export { WebGLRenderTargetCube } from './renderers/WebGLRenderTargetCube'; -export { WebGLRenderTarget } from './renderers/WebGLRenderTarget'; -export { WebGLRenderer } from './renderers/WebGLRenderer'; -export { ShaderLib } from './renderers/shaders/ShaderLib'; -export { UniformsLib } from './renderers/shaders/UniformsLib'; -export { UniformsUtils } from './renderers/shaders/UniformsUtils'; -export { ShaderChunk } from './renderers/shaders/ShaderChunk'; -export { FogExp2 } from './scenes/FogExp2'; -export { Fog } from './scenes/Fog'; -export { Scene } from './scenes/Scene'; -export { Sprite } from './objects/Sprite'; -export { LOD } from './objects/LOD'; -export { SkinnedMesh } from './objects/SkinnedMesh'; -export { Skeleton } from './objects/Skeleton'; -export { Bone } from './objects/Bone'; -export { Mesh } from './objects/Mesh'; -export { LineSegments } from './objects/LineSegments'; -export { LineLoop } from './objects/LineLoop'; -export { Line } from './objects/Line'; -export { Points } from './objects/Points'; -export { Group } from './objects/Group'; -export { VideoTexture } from './textures/VideoTexture'; -export { DataTexture } from './textures/DataTexture'; -export { DataTexture3D } from './textures/DataTexture3D'; -export { CompressedTexture } from './textures/CompressedTexture'; -export { CubeTexture } from './textures/CubeTexture'; -export { CanvasTexture } from './textures/CanvasTexture'; -export { DepthTexture } from './textures/DepthTexture'; -export { Texture } from './textures/Texture'; +export * from './polyfills'; +export * from './renderers/WebGLMultisampleRenderTarget'; +export * from './renderers/WebGLRenderTargetCube'; +export * from './renderers/WebGLRenderTarget'; +export * from './renderers/WebGLRenderer'; +export * from './renderers/shaders/ShaderLib'; +export * from './renderers/shaders/UniformsLib'; +export * from './renderers/shaders/UniformsUtils'; +export * from './renderers/shaders/ShaderChunk'; +export * from './scenes/FogExp2'; +export * from './scenes/Fog'; +export * from './scenes/Scene'; +export * from './objects/Sprite'; +export * from './objects/LOD'; +export * from './objects/SkinnedMesh'; +export * from './objects/Skeleton'; +export * from './objects/Bone'; +export * from './objects/Mesh'; +export * from './objects/LineSegments'; +export * from './objects/LineLoop'; +export * from './objects/Line'; +export * from './objects/Points'; +export * from './objects/Group'; +export * from './textures/VideoTexture'; +export * from './textures/DataTexture'; +export * from './textures/DataTexture3D'; +export * from './textures/CompressedTexture'; +export * from './textures/CubeTexture'; +export * from './textures/CanvasTexture'; +export * from './textures/DepthTexture'; +export * from './textures/Texture'; export * from './geometries/Geometries'; export * from './materials/Materials'; -//export { AnimationLoader } from './loaders/AnimationLoader'; -export { CompressedTextureLoader } from './loaders/CompressedTextureLoader'; -export { DataTextureLoader } from './loaders/DataTextureLoader'; -export { CubeTextureLoader } from './loaders/CubeTextureLoader'; -export { TextureLoader } from './loaders/TextureLoader'; -export { ObjectLoader } from './loaders/ObjectLoader'; -export { MaterialLoader } from './loaders/MaterialLoader'; -export { BufferGeometryLoader } from './loaders/BufferGeometryLoader'; -export { LoadingManager } from './loaders/LoadingManager'; -export { ImageLoader } from './loaders/ImageLoader'; -export { ImageBitmapLoader } from './loaders/ImageBitmapLoader'; -export { FontLoader } from './loaders/FontLoader'; -export { FileLoader } from './loaders/FileLoader'; -export { Loader } from './loaders/Loader'; -export { LoaderUtils } from './loaders/LoaderUtils'; -export { Cache } from './loaders/Cache'; -export { AudioLoader } from './loaders/AudioLoader'; -export { SpotLightShadow } from './lights/SpotLightShadow'; -export { SpotLight } from './lights/SpotLight'; -export { PointLight } from './lights/PointLight'; -export { RectAreaLight } from './lights/RectAreaLight'; -export { HemisphereLight } from './lights/HemisphereLight'; -export { DirectionalLightShadow } from './lights/DirectionalLightShadow'; -export { DirectionalLight } from './lights/DirectionalLight'; -export { AmbientLight } from './lights/AmbientLight'; -export { LightShadow } from './lights/LightShadow'; -export { Light } from './lights/Light'; -export { StereoCamera } from './cameras/StereoCamera'; -export { PerspectiveCamera } from './cameras/PerspectiveCamera'; -export { OrthographicCamera } from './cameras/OrthographicCamera'; -export { CubeCamera } from './cameras/CubeCamera'; -export { ArrayCamera } from './cameras/ArrayCamera'; -export { Camera } from './cameras/Camera'; -export { AudioListener } from './audio/AudioListener'; -export { PositionalAudio } from './audio/PositionalAudio'; -export { AudioContext } from './audio/AudioContext'; -export { AudioAnalyser } from './audio/AudioAnalyser'; -export { Audio } from './audio/Audio'; -export { VectorKeyframeTrack } from './animation/tracks/VectorKeyframeTrack'; -export { StringKeyframeTrack } from './animation/tracks/StringKeyframeTrack'; -export { - QuaternionKeyframeTrack, -} from './animation/tracks/QuaternionKeyframeTrack'; -export { NumberKeyframeTrack } from './animation/tracks/NumberKeyframeTrack'; -export { ColorKeyframeTrack } from './animation/tracks/ColorKeyframeTrack'; -export { BooleanKeyframeTrack } from './animation/tracks/BooleanKeyframeTrack'; -export { PropertyMixer } from './animation/PropertyMixer'; -export { PropertyBinding } from './animation/PropertyBinding'; -export { KeyframeTrack } from './animation/KeyframeTrack'; -export { AnimationUtils } from './animation/AnimationUtils'; -export { AnimationObjectGroup } from './animation/AnimationObjectGroup'; -export { AnimationMixer } from './animation/AnimationMixer'; -export { AnimationClip } from './animation/AnimationClip'; -export { Uniform } from './core/Uniform'; -export { InstancedBufferGeometry } from './core/InstancedBufferGeometry'; -export { BufferGeometry } from './core/BufferGeometry'; -export { Geometry } from './core/Geometry'; -export { InterleavedBufferAttribute } from './core/InterleavedBufferAttribute'; -export { InstancedInterleavedBuffer } from './core/InstancedInterleavedBuffer'; -export { InterleavedBuffer } from './core/InterleavedBuffer'; -export { InstancedBufferAttribute } from './core/InstancedBufferAttribute'; +export * from './loaders/AnimationLoader'; +export * from './loaders/CompressedTextureLoader'; +export * from './loaders/DataTextureLoader'; +export * from './loaders/CubeTextureLoader'; +export * from './loaders/TextureLoader'; +export * from './loaders/ObjectLoader'; +export * from './loaders/MaterialLoader'; +export * from './loaders/BufferGeometryLoader'; +export * from './loaders/LoadingManager'; +export * from './loaders/ImageLoader'; +export * from './loaders/ImageBitmapLoader'; +export * from './loaders/FontLoader'; +export * from './loaders/FileLoader'; +export * from './loaders/Loader'; +export * from './loaders/LoaderUtils'; +export * from './loaders/Cache'; +export * from './loaders/AudioLoader'; +export * from './lights/SpotLightShadow'; +export * from './lights/SpotLight'; +export * from './lights/PointLight'; +export * from './lights/RectAreaLight'; +export * from './lights/HemisphereLight'; +export * from './lights/DirectionalLightShadow'; +export * from './lights/DirectionalLight'; +export * from './lights/AmbientLight'; +export * from './lights/LightShadow'; +export * from './lights/Light'; +export * from './cameras/StereoCamera'; +export * from './cameras/PerspectiveCamera'; +export * from './cameras/OrthographicCamera'; +export * from './cameras/CubeCamera'; +export * from './cameras/ArrayCamera'; +export * from './cameras/Camera'; +export * from './audio/AudioListener'; +export * from './audio/PositionalAudio'; +export * from './audio/AudioContext'; +export * from './audio/AudioAnalyser'; +export * from './audio/Audio'; +export * from './animation/tracks/VectorKeyframeTrack'; +export * from './animation/tracks/StringKeyframeTrack'; +export * from './animation/tracks/QuaternionKeyframeTrack'; +export * from './animation/tracks/NumberKeyframeTrack'; +export * from './animation/tracks/ColorKeyframeTrack'; +export * from './animation/tracks/BooleanKeyframeTrack'; +export * from './animation/PropertyMixer'; +export * from './animation/PropertyBinding'; +export * from './animation/KeyframeTrack'; +export * from './animation/AnimationUtils'; +export * from './animation/AnimationObjectGroup'; +export * from './animation/AnimationMixer'; +export * from './animation/AnimationClip'; +export * from './animation/AnimationAction'; +export * from './core/Uniform'; +export * from './core/InstancedBufferGeometry'; +export * from './core/BufferGeometry'; +export * from './core/Geometry'; +export * from './core/InterleavedBufferAttribute'; +export * from './core/InstancedInterleavedBuffer'; +export * from './core/InterleavedBuffer'; +export * from './core/InstancedBufferAttribute'; export * from './core/BufferAttribute'; -export { Face3 } from './core/Face3'; -export { Object3D } from './core/Object3D'; -export { Raycaster } from './core/Raycaster'; -export { Layers } from './core/Layers'; -export { EventDispatcher } from './core/EventDispatcher'; -export { Clock } from './core/Clock'; -export { - QuaternionLinearInterpolant, -} from './math/interpolants/QuaternionLinearInterpolant'; -export { LinearInterpolant } from './math/interpolants/LinearInterpolant'; -export { DiscreteInterpolant } from './math/interpolants/DiscreteInterpolant'; -export { CubicInterpolant } from './math/interpolants/CubicInterpolant'; -export { Interpolant } from './math/Interpolant'; -export { Triangle } from './math/Triangle'; -export { _Math as Math } from './math/Math'; -export { Spherical } from './math/Spherical'; -export { Cylindrical } from './math/Cylindrical'; -export { Plane } from './math/Plane'; -export { Frustum } from './math/Frustum'; -export { Sphere } from './math/Sphere'; -export { Ray } from './math/Ray'; -export { Matrix4 } from './math/Matrix4'; -export { Matrix3 } from './math/Matrix3'; -export { Box3 } from './math/Box3'; -export { Box2 } from './math/Box2'; -export { Line3 } from './math/Line3'; -export { Euler } from './math/Euler'; -export { Vector4 } from './math/Vector4'; -export { Vector3 } from './math/Vector3'; -export { Vector2 } from './math/Vector2'; -export { Quaternion } from './math/Quaternion'; -export { Color } from './math/Color'; -export { ImmediateRenderObject } from './extras/objects/ImmediateRenderObject'; -export { VertexNormalsHelper } from './helpers/VertexNormalsHelper'; -export { SpotLightHelper } from './helpers/SpotLightHelper'; -export { SkeletonHelper } from './helpers/SkeletonHelper'; -export { PointLightHelper } from './helpers/PointLightHelper'; -export { RectAreaLightHelper } from './helpers/RectAreaLightHelper'; -export { HemisphereLightHelper } from './helpers/HemisphereLightHelper'; -export { GridHelper } from './helpers/GridHelper'; -export { PolarGridHelper } from './helpers/PolarGridHelper'; -export { PositionalAudioHelper } from './helpers/PositionalAudioHelper'; -export { FaceNormalsHelper } from './helpers/FaceNormalsHelper'; -export { DirectionalLightHelper } from './helpers/DirectionalLightHelper'; -export { CameraHelper } from './helpers/CameraHelper'; -export { BoxHelper } from './helpers/BoxHelper'; -export { Box3Helper } from './helpers/Box3Helper'; -export { PlaneHelper } from './helpers/PlaneHelper'; -export { ArrowHelper } from './helpers/ArrowHelper'; -export { AxesHelper } from './helpers/AxesHelper'; +export * from './core/Face3'; +export * from './core/Object3D'; +export * from './core/Raycaster'; +export * from './core/Layers'; +export * from './core/EventDispatcher'; +export * from './core/DirectGeometry'; +export * from './core/Clock'; +export * from './math/interpolants/QuaternionLinearInterpolant'; +export * from './math/interpolants/LinearInterpolant'; +export * from './math/interpolants/DiscreteInterpolant'; +export * from './math/interpolants/CubicInterpolant'; +export * from './math/Interpolant'; +export * from './math/Triangle'; +export * from './math/Math'; +export * from './math/Spherical'; +export * from './math/Cylindrical'; +export * from './math/Plane'; +export * from './math/Frustum'; +export * from './math/Sphere'; +export * from './math/Ray'; +export * from './math/Matrix4'; +export * from './math/Matrix3'; +export * from './math/Box3'; +export * from './math/Box2'; +export * from './math/Line3'; +export * from './math/Euler'; +export * from './math/Vector4'; +export * from './math/Vector3'; +export * from './math/Vector2'; +export * from './math/Quaternion'; +export * from './math/Color'; +export * from './extras/objects/ImmediateRenderObject'; +export * from './helpers/VertexNormalsHelper'; +export * from './helpers/SpotLightHelper'; +export * from './helpers/SkeletonHelper'; +export * from './helpers/PointLightHelper'; +export * from './helpers/RectAreaLightHelper'; +export * from './helpers/HemisphereLightHelper'; +export * from './helpers/GridHelper'; +export * from './helpers/PolarGridHelper'; +export * from './helpers/PositionalAudioHelper'; +export * from './helpers/FaceNormalsHelper'; +export * from './helpers/DirectionalLightHelper'; +export * from './helpers/CameraHelper'; +export * from './helpers/BoxHelper'; +export * from './helpers/Box3Helper'; +export * from './helpers/PlaneHelper'; +export * from './helpers/ArrowHelper'; +export * from './helpers/AxesHelper'; export * from './extras/curves/Curves'; -export { Shape } from './extras/core/Shape'; -export { Path } from './extras/core/Path'; -export { ShapePath } from './extras/core/ShapePath'; -export { Font } from './extras/core/Font'; -export { CurvePath } from './extras/core/CurvePath'; -export { Curve } from './extras/core/Curve'; -export { ImageUtils } from './extras/ImageUtils'; -export { ShapeUtils } from './extras/ShapeUtils'; -//export { WebGLUtils } from './renderers/webgl/WebGLUtils'; +export * from './extras/core/Shape'; +export * from './extras/core/Path'; +export * from './extras/core/ShapePath'; +export * from './extras/core/Font'; +export * from './extras/core/CurvePath'; +export * from './extras/core/Curve'; +export * from './extras/ImageUtils'; +export * from './extras/ShapeUtils'; +export * from './renderers/webgl/WebGLBufferRenderer'; +export * from './renderers/webgl/WebGLCapabilities'; +export * from './renderers/webgl/WebGLClipping'; +export * from './renderers/webgl/WebGLExtensions'; +export * from './renderers/webgl/WebGLGeometries'; +export * from './renderers/webgl/WebGLIndexedBufferRenderer'; +export * from './renderers/webgl/WebGLInfo'; +export * from './renderers/webgl/WebGLLights'; +export * from './renderers/webgl/WebGLObjects'; +export * from './renderers/webgl/WebGLProgram'; +export * from './renderers/webgl/WebGLPrograms'; +export * from './renderers/webgl/WebGLProperties'; +export * from './renderers/webgl/WebGLRenderLists'; +export * from './renderers/webgl/WebGLShader'; +export * from './renderers/webgl/WebGLShadowMap'; +export * from './renderers/webgl/WebGLState'; +export * from './renderers/webgl/WebGLTextures'; +export * from './renderers/webgl/WebGLUniforms'; +//export * from './renderers/webgl/WebGLUtils'; +export * from './renderers/webvr/WebVRManager'; export * from './constants'; export * from './Three.Legacy';
true
Other
mrdoob
three.js
2a2451b76717cfff000d1289a5e344a02ac4f707.json
Export all types from all type definition files
src/extras/curves/Curves.d.ts
@@ -1,10 +1,10 @@ -export { ArcCurve } from './ArcCurve'; -export { CatmullRomCurve3 } from './CatmullRomCurve3'; -export { CubicBezierCurve } from './CubicBezierCurve'; -export { CubicBezierCurve3 } from './CubicBezierCurve3'; -export { EllipseCurve } from './EllipseCurve'; -export { LineCurve } from './LineCurve'; -export { LineCurve3 } from './LineCurve3'; -export { QuadraticBezierCurve } from './QuadraticBezierCurve'; -export { QuadraticBezierCurve3 } from './QuadraticBezierCurve3'; -export { SplineCurve } from './SplineCurve'; +export * from './ArcCurve'; +export * from './CatmullRomCurve3'; +export * from './CubicBezierCurve'; +export * from './CubicBezierCurve3'; +export * from './EllipseCurve'; +export * from './LineCurve'; +export * from './LineCurve3'; +export * from './QuadraticBezierCurve'; +export * from './QuadraticBezierCurve3'; +export * from './SplineCurve';
true
Other
mrdoob
three.js
2a2451b76717cfff000d1289a5e344a02ac4f707.json
Export all types from all type definition files
src/geometries/Geometries.d.ts
@@ -1,43 +1,22 @@ -export { WireframeGeometry } from './WireframeGeometry'; -export { - ParametricGeometry, - ParametricBufferGeometry, -} from './ParametricGeometry'; -export { - TetrahedronGeometry, - TetrahedronBufferGeometry, -} from './TetrahedronGeometry'; -export { - OctahedronGeometry, - OctahedronBufferGeometry, -} from './OctahedronGeometry'; -export { - IcosahedronGeometry, - IcosahedronBufferGeometry, -} from './IcosahedronGeometry'; -export { - DodecahedronGeometry, - DodecahedronBufferGeometry, -} from './DodecahedronGeometry'; -export { - PolyhedronGeometry, - PolyhedronBufferGeometry, -} from './PolyhedronGeometry'; -export { TubeGeometry, TubeBufferGeometry } from './TubeGeometry'; -export { - TorusKnotGeometry, - TorusKnotBufferGeometry, -} from './TorusKnotGeometry'; -export { TorusGeometry, TorusBufferGeometry } from './TorusGeometry'; -export { TextGeometry, TextBufferGeometry } from './TextGeometry'; -export { SphereGeometry, SphereBufferGeometry } from './SphereGeometry'; -export { RingGeometry, RingBufferGeometry } from './RingGeometry'; -export { PlaneGeometry, PlaneBufferGeometry } from './PlaneGeometry'; -export { LatheGeometry, LatheBufferGeometry } from './LatheGeometry'; -export { ShapeGeometry, ShapeBufferGeometry } from './ShapeGeometry'; -export { ExtrudeGeometry, ExtrudeBufferGeometry } from './ExtrudeGeometry'; -export { EdgesGeometry } from './EdgesGeometry'; -export { ConeGeometry, ConeBufferGeometry } from './ConeGeometry'; -export { CylinderGeometry, CylinderBufferGeometry } from './CylinderGeometry'; -export { CircleGeometry, CircleBufferGeometry } from './CircleGeometry'; -export { BoxGeometry, BoxBufferGeometry } from './BoxGeometry'; +export * from './WireframeGeometry'; +export * from './ParametricGeometry'; +export * from './TetrahedronGeometry'; +export * from './OctahedronGeometry'; +export * from './IcosahedronGeometry'; +export * from './DodecahedronGeometry'; +export * from './PolyhedronGeometry'; +export * from './TubeGeometry'; +export * from './TorusKnotGeometry'; +export * from './TorusGeometry'; +export * from './TextGeometry'; +export * from './SphereGeometry'; +export * from './RingGeometry'; +export * from './PlaneGeometry'; +export * from './LatheGeometry'; +export * from './ShapeGeometry'; +export * from './ExtrudeGeometry'; +export * from './EdgesGeometry'; +export * from './ConeGeometry'; +export * from './CylinderGeometry'; +export * from './CircleGeometry'; +export * from './BoxGeometry';
true
Other
mrdoob
three.js
2a2451b76717cfff000d1289a5e344a02ac4f707.json
Export all types from all type definition files
src/materials/Materials.d.ts
@@ -1,18 +1,18 @@ -export { ShadowMaterial } from './ShadowMaterial'; -export { SpriteMaterial } from './SpriteMaterial'; -export { RawShaderMaterial } from './RawShaderMaterial'; -export { ShaderMaterial } from './ShaderMaterial'; -export { PointsMaterial } from './PointsMaterial'; -export { MeshPhysicalMaterial } from './MeshPhysicalMaterial'; -export { MeshStandardMaterial } from './MeshStandardMaterial'; -export { MeshPhongMaterial } from './MeshPhongMaterial'; -//export { MeshToonMaterial } from './MeshToonMaterial'; -export { MeshNormalMaterial } from './MeshNormalMaterial'; -export { MeshLambertMaterial } from './MeshLambertMaterial'; -export { MeshDepthMaterial } from './MeshDepthMaterial'; -//export { MeshDistanceMaterial } from './MeshDistanceMaterial'; -export { MeshBasicMaterial } from './MeshBasicMaterial'; -//export { MeshMatcapMaterial } from './MeshMatcapMaterial'; -export { LineDashedMaterial } from './LineDashedMaterial'; -export { LineBasicMaterial } from './LineBasicMaterial'; -export { Material } from './Material'; +export * from './ShadowMaterial'; +export * from './SpriteMaterial'; +export * from './RawShaderMaterial'; +export * from './ShaderMaterial'; +export * from './PointsMaterial'; +export * from './MeshPhysicalMaterial'; +export * from './MeshStandardMaterial'; +export * from './MeshPhongMaterial'; +//export * from './MeshToonMaterial'; +export * from './MeshNormalMaterial'; +export * from './MeshLambertMaterial'; +export * from './MeshDepthMaterial'; +//export * from './MeshDistanceMaterial'; +export * from './MeshBasicMaterial'; +//export * from './MeshMatcapMaterial'; +export * from './LineDashedMaterial'; +export * from './LineBasicMaterial'; +export * from './Material';
true
Other
mrdoob
three.js
2a2451b76717cfff000d1289a5e344a02ac4f707.json
Export all types from all type definition files
src/polyfills.d.ts
@@ -4,7 +4,7 @@ export function error(message?: any, ...optionalParams: any[]): void; export function log(message?: any, ...optionalParams: any[]): void; // typed array parameters -type TypedArray = +export type TypedArray = | Int8Array | Uint8Array | Uint8ClampedArray
true
Other
mrdoob
three.js
cfc397597b6bc3cdbf97ba632fc5e5fed5af5498.json
Replace THREE.RGBA with THREE.RGBAFormat
examples/js/postprocessing/SSAOPass.js
@@ -392,7 +392,7 @@ THREE.SSAOPass.prototype = Object.assign( Object.create( THREE.Pass.prototype ), } - this.noiseTexture = new THREE.DataTexture( data, width, height, THREE.RGBA, THREE.FloatType ); + this.noiseTexture = new THREE.DataTexture( data, width, height, THREE.RGBAFormat, THREE.FloatType ); this.noiseTexture.wrapS = THREE.RepeatWrapping; this.noiseTexture.wrapT = THREE.RepeatWrapping; this.noiseTexture.needsUpdate = true;
false
Other
mrdoob
three.js
f2a7f149e414d81ea0861f141469bd5a17485835.json
remove use of Uint8Array.indexOf
examples/js/loaders/FBXLoader.js
@@ -3701,7 +3701,8 @@ getString: function ( size ) { - var a = new Uint8Array( size ); + // note: safari 9 doesn't support Uint8Array.indexOf; create intermediate array instead + var a = []; for ( var i = 0; i < size; i ++ ) { @@ -3712,7 +3713,7 @@ var nullByte = a.indexOf( 0 ); if ( nullByte >= 0 ) a = a.slice( 0, nullByte ); - return THREE.LoaderUtils.decodeText( a ); + return THREE.LoaderUtils.decodeText( new Uint8Array( a ) ); }
false
Other
mrdoob
three.js
72611a26fd9b918c3ff8bcc2192090f417e6e416.json
Make HDRCubeTextureLoader work in strict mode. If 'use strict' is set in this scope, calling the funtion loadHDRData at line 180 in HDRCubeTextureLoader will leave "this" undefined , and line 111 inside the function loadHDRData will throw expection when accessing "this.manager".
examples/js/loaders/HDRCubeTextureLoader.js
@@ -177,7 +177,7 @@ THREE.HDRCubeTextureLoader.prototype.load = function ( type, urls, onLoad, onPro for ( var i = 0; i < urls.length; i ++ ) { - loadHDRData( i, onLoad, onProgress, onError ); + loadHDRData.call( this, i, onLoad, onProgress, onError ); }
false
Other
mrdoob
three.js
304cd6e1e3f5804ca3b1e2c7ea21dfd9fd2892df.json
Add includeCustomExtensions option.
docs/examples/exporters/GLTFExporter.html
@@ -84,6 +84,7 @@ <h3>[method:null parse]( [param:Object3D input], [param:Function onCompleted], [ <li>animations - Array<[page:AnimationClip AnimationClip]>. List of animations to be included in the export.</li> <li>forceIndices - bool. Generate indices for non-index geometry and export with them. Default is false.</li> <li>forcePowerOfTwoTextures - bool. Export with images resized to POT size. This option works only if embedImages is true. Default is false.</li> + <li>includeCustomExtensions - bool. Export custom glTF extensions defined on an object's <em>userData.gltfExtensions<em> property. Default is false.</li> </ul> </p> <p>
true
Other
mrdoob
three.js
304cd6e1e3f5804ca3b1e2c7ea21dfd9fd2892df.json
Add includeCustomExtensions option.
examples/js/exporters/GLTFExporter.js
@@ -73,7 +73,8 @@ THREE.GLTFExporter.prototype = { embedImages: true, animations: [], forceIndices: false, - forcePowerOfTwoTextures: false + forcePowerOfTwoTextures: false, + includeCustomExtensions: false }; options = Object.assign( {}, DEFAULT_OPTIONS, options ); @@ -345,7 +346,7 @@ THREE.GLTFExporter.prototype = { var json = JSON.parse( JSON.stringify( object.userData ) ); - if ( json.gltfExtensions ) { + if ( options.includeCustomExtensions && json.gltfExtensions ) { if ( gltfProperty.extensions === undefined ) { @@ -360,10 +361,10 @@ THREE.GLTFExporter.prototype = { } - delete json.gltfExtensions; - } + delete json.gltfExtensions; + if ( Object.keys( json ).length > 0 ) { gltfProperty.extras = json;
true
Other
mrdoob
three.js
0ab965eae47676943d16eb0e40cc00c65e7bc35b.json
Prevent navigation if modifiers pressed. In Windows Ctrl-Click opens a link in a new tab. In MacOS it's Cmd-Click. But the code here was not respecting the user's wishes. A new tab would open but the page itself woudl also navigate the same link which is not what a user is requesting with ctrl-click or cmd-click Interestingly the demo page did not navigate when pressing Cmd-Click on MacOS but the URL did change. Now the URL will correctly not change and the link will open in a new window.
docs/index.html
@@ -93,8 +93,12 @@ <h1><a href="http://threejs.org">three.js</a> / docs</h1> link.setAttribute( 'target', 'viewer' ); link.addEventListener( 'click', function ( event ) { - window.location.hash = pageURL; - panel.classList.add( 'collapsed' ); + if ( event.button === 0 && !event.ctrlKey && !event.altKey && !event.metaKey ) { + + window.location.hash = pageURL; + panel.classList.add( 'collapsed' ); + + } } );
true
Other
mrdoob
three.js
0ab965eae47676943d16eb0e40cc00c65e7bc35b.json
Prevent navigation if modifiers pressed. In Windows Ctrl-Click opens a link in a new tab. In MacOS it's Cmd-Click. But the code here was not respecting the user's wishes. A new tab would open but the page itself woudl also navigate the same link which is not what a user is requesting with ctrl-click or cmd-click Interestingly the demo page did not navigate when pressing Cmd-Click on MacOS but the URL did change. Now the URL will correctly not change and the link will open in a new window.
examples/index.html
@@ -296,7 +296,7 @@ <h1><a href="http://threejs.org">three.js</a> / examples</h1> link.setAttribute( 'target', 'viewer' ); link.addEventListener( 'click', function ( event ) { - if ( event.button === 0 ) { + if ( event.button === 0 && !event.ctrlKey && !event.altKey && !event.metaKey ) { selectFile( file );
true
Other
mrdoob
three.js
d52614b90cd8c0733f4eb11e916b0b0432824e40.json
remove other sentence
docs/api/materials/Material.html
@@ -162,8 +162,7 @@ <h3>[property:String name]</h3> <h3>[property:Boolean needsUpdate]</h3> <p> - Specifies that the material needs to be recompiled. - Set it to true if you want the shader to be recompiled.<br /> + Specifies that the material needs to be recompiled.<br /> This property is automatically set to *true* when instancing a new material. </p>
false
Other
mrdoob
three.js
878dca08034a13d444731014e0951f8e99ffea86.json
fix normal doubleSided
examples/js/nodes/accessors/NormalNode.js
@@ -45,7 +45,7 @@ NormalNode.prototype.generate = function ( builder, output ) { builder.requires.normal = true; - result = builder.isShader( 'vertex' ) ? 'normal' : 'vObjectNormal'; + result = 'normal'; break; @@ -59,7 +59,7 @@ NormalNode.prototype.generate = function ( builder, output ) { case NormalNode.VIEW: - result = 'normal'; + result = 'vNormal'; break;
true
Other
mrdoob
three.js
878dca08034a13d444731014e0951f8e99ffea86.json
fix normal doubleSided
examples/js/nodes/misc/BumpMapNode.js
@@ -114,7 +114,7 @@ BumpMapNode.prototype.generate = function ( builder, output ) { var derivativeHeight = builder.include( BumpMapNode.Nodes.dHdxy_fwd ), perturbNormalArb = builder.include( BumpMapNode.Nodes.perturbNormalArb ); - this.normal = this.normal || new NormalNode( NormalNode.VIEW ); + this.normal = this.normal || new NormalNode(); this.position = this.position || new PositionNode( PositionNode.VIEW ); var derivativeHeightCode = derivativeHeight + '( ' + this.value.build( builder, 'sampler2D' ) + ', ' +
true
Other
mrdoob
three.js
878dca08034a13d444731014e0951f8e99ffea86.json
fix normal doubleSided
examples/js/nodes/misc/NormalMapNode.js
@@ -68,7 +68,7 @@ NormalMapNode.prototype.generate = function ( builder, output ) { var perturbNormal2Arb = builder.include( NormalMapNode.Nodes.perturbNormal2Arb ); - this.normal = this.normal || new NormalNode( NormalNode.VIEW ); + this.normal = this.normal || new NormalNode(); this.position = this.position || new PositionNode( PositionNode.VIEW ); this.uv = this.uv || new UVNode();
true
Other
mrdoob
three.js
878dca08034a13d444731014e0951f8e99ffea86.json
fix normal doubleSided
examples/webgl_materials_nodes.html
@@ -764,7 +764,7 @@ var color = new THREE.ColorNode( 0xFFFFFF ); var viewZ = new THREE.Math2Node( - new THREE.NormalNode( THREE.NormalNode.VIEW ), + new THREE.NormalNode(), new THREE.Vector3Node( 0, 0, - intensity ), THREE.Math2Node.DOT ); @@ -1045,7 +1045,7 @@ var color = new THREE.CubeTextureNode( cubemap ); var viewZ = new THREE.Math2Node( - new THREE.NormalNode( THREE.NormalNode.VIEW ), + new THREE.NormalNode(), new THREE.Vector3Node( 0, 0, - 1 ), THREE.Math2Node.DOT ); @@ -1690,7 +1690,7 @@ var fur = new THREE.FloatNode( .5 ); var posDirection = new THREE.Math1Node( new THREE.PositionNode( THREE.PositionNode.VIEW ), THREE.Math1Node.NORMALIZE ); - var norDirection = new THREE.Math1Node( new THREE.NormalNode( THREE.NormalNode.VIEW ), THREE.Math1Node.NORMALIZE ); + var norDirection = new THREE.Math1Node( new THREE.NormalNode(), THREE.Math1Node.NORMALIZE ); var viewZ = new THREE.Math2Node( posDirection, @@ -1874,7 +1874,7 @@ // LINE var posDirection = new THREE.Math1Node( new THREE.PositionNode( THREE.PositionNode.VIEW ), THREE.Math1Node.NORMALIZE ); - var norDirection = new THREE.Math1Node( new THREE.NormalNode( THREE.NormalNode.VIEW ), THREE.Math1Node.NORMALIZE ); + var norDirection = new THREE.Math1Node( new THREE.NormalNode(), THREE.Math1Node.NORMALIZE ); var viewZ = new THREE.Math2Node( posDirection, @@ -2534,6 +2534,9 @@ } // set material + + mtl.side = THREE.DoubleSide; + mesh.material = mtl; }
true
Other
mrdoob
three.js
3a7d583be81fab42f630cb7a9a18d27bf0ee9322.json
remove webgl mention
docs/api/materials/Material.html
@@ -162,7 +162,7 @@ <h3>[property:String name]</h3> <h3>[property:Boolean needsUpdate]</h3> <p> - Specifies that the material needs to be updated at the WebGL level. + Specifies that the material needs to be recompiled. Set it to true if you want the shader to be recompiled.<br /> This property is automatically set to *true* when instancing a new material. </p>
false
Other
mrdoob
three.js
9af6c423d22f50950f340ee9fac9a36764c79635.json
fix ambigous wording
docs/api/materials/Material.html
@@ -163,7 +163,7 @@ <h3>[property:String name]</h3> <h3>[property:Boolean needsUpdate]</h3> <p> Specifies that the material needs to be updated at the WebGL level. - Set it to true if you made changes that need to be reflected in WebGL.<br /> + Set it to true if you want the shader to be recompiled.<br /> This property is automatically set to *true* when instancing a new material. </p>
false
Other
mrdoob
three.js
c8d4156f89f67f9dffa7cd4740a58f28fd8f06f1.json
fix normal view
examples/js/nodes/accessors/NormalNode.js
@@ -59,7 +59,7 @@ NormalNode.prototype.generate = function ( builder, output ) { case NormalNode.VIEW: - result = 'vNormal'; + result = 'normal'; break;
false
Other
mrdoob
three.js
4227b80ca2f29c6893091284afa7ffa2690a868e.json
fix share maps
examples/webgl_materials_nodes.html
@@ -409,7 +409,9 @@ // MATERIAL - var sataturation = new THREE.FloatNode( 1 ); + var sataturation = new THREE.FloatNode( 1 ), + useMap = true, + useNormals = true; function updateMaterial( useNodeMaterial ) { @@ -421,9 +423,9 @@ // default syntax ( backward-compatible ) - mtl.map = oldMaterial ? oldMaterial.map : getTexture( "brick" ); + mtl.map = useMap ? getTexture( "brick" ) : undefined; - mtl.normalMap = oldMaterial ? oldMaterial.normalMap : getTexture( "decalNormal" ); + mtl.normalMap = useNormals ? getTexture( "decalNormal" ) : undefined; mtl.normalScale = new THREE.Vector2( .5, .5 ); mtl.envMap = cubemap; @@ -491,17 +493,21 @@ }, false, 0, 2 ); - addGui( 'colors', true, function ( val ) { + addGui( 'colors', useMap, function ( val ) { + + useMap = val; - mtl.map = val ? getTexture( "brick" ) : undefined; + mtl.map = useMap ? getTexture( "brick" ) : undefined; mtl.needsUpdate = true; }, false ); - addGui( 'normals', true, function ( val ) { + addGui( 'normals', useNormals, function ( val ) { + + useNormals = val; - mtl.normalMap = val ? getTexture( "decalNormal" ) : undefined; + mtl.normalMap = useNormals ? getTexture( "decalNormal" ) : undefined; mtl.needsUpdate = true;
false
Other
mrdoob
three.js
aa7cde8ede049b0bac11f44c86e7e9fc74321fd2.json
fix typo in GLTFLoader example comments typo said `progresses` but should have been `progress`. Reworded line instead to meet minimum pull request size and provide clarity.
docs/examples/loaders/GLTFLoader.html
@@ -60,7 +60,7 @@ <h2>Example</h2> gltf.asset; // Object }, - // called when loading is in progresses + // called while loading is progressing function ( xhr ) { console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );
false
Other
mrdoob
three.js
5d38e61ad476430108d79d05264586078faea151.json
Add Triangle.closestPointToPoint benchmark
test/benchmark/benchmarks.html
@@ -1,50 +1,51 @@ <!DOCTYPE html> <html> -<head> - <meta charset="utf-8"> - <title>ThreeJS Benchmark Tests - Using Files in /src</title> - <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:700" rel="stylesheet" type="text/css"> - <link href="normalize.css" rel="stylesheet" type="text/css"> - <link href="style.css" rel="stylesheet" type="text/css"> - <script src="../../build/three.min.js"></script> - <script src="vendor/lodash.min.js"></script> - <script src="vendor/benchmark-2.1.0.min.js"></script> - <script src="benchmark.js"></script> + <head> + <meta charset="utf-8"> + <title>ThreeJS Benchmark Tests - Using Files in /src</title> + <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:700" rel="stylesheet" type="text/css"> + <link href="normalize.css" rel="stylesheet" type="text/css"> + <link href="style.css" rel="stylesheet" type="text/css"> + <script src="../../build/three.min.js"></script> + <script src="vendor/lodash.min.js"></script> + <script src="vendor/benchmark-2.1.0.min.js"></script> + <script src="benchmark.js"></script> - <script src="core/Vector3Components.js"></script> - <script src="core/Vector3Storage.js"></script> - <script src="core/Vector3Length.js"></script> - <script src="core/Float32Array.js"></script> - <script src="core/UpdateMatrixWorld.js"></script> -</head> -<body> - <header> - <h1>Three JS Benchmarks Suite</h1> - </header> - <section> - </section> + <script src="core/Vector3Components.js"></script> + <script src="core/Vector3Storage.js"></script> + <script src="core/Vector3Length.js"></script> + <script src="core/Float32Array.js"></script> + <script src="core/UpdateMatrixWorld.js"></script> + <script src="core/TriangleClosestPoint.js"></script> + </head> + <body> + <header> + <h1>Three JS Benchmarks Suite</h1> + </header> + <section> + </section> - <template id="suite"> - <article> - <header> - <h2></h2> - <h3>Start</h3> - </header> - <div class="results"> - <div class"head"> - <p class="name">Name</p> - <p class="ops">Ops / Sec</p> - <p class="desv">±</p> + <template id="suite"> + <article> + <header> + <h2></h2> + <h3>Start</h3> + </header> + <div class="results"> + <div class"head"> + <p class="name">Name</p> + <p class="ops">Ops / Sec</p> + <p class="desv">±</p> + </div> </div> - </div> - </article> - </template> + </article> + </template> - <template id="suite-test"> - <div> - <p class="name"></p> - <p class="ops"></p> - <p class="desv"></p> + <template id="suite-test"> + <div> + <p class="name"></p> + <p class="ops"></p> + <p class="desv"></p> </div> </template>
true
Other
mrdoob
three.js
5d38e61ad476430108d79d05264586078faea151.json
Add Triangle.closestPointToPoint benchmark
test/benchmark/core/TriangleClosestPoint.js
@@ -0,0 +1,61 @@ +(function() { + + THREE = Bench.THREE; + + // these vertices and triangles are those of a unit icosahedron centered at the origin + var phi = 1.618; + var verts = [ + [phi, 1, 0], [-phi, 1, 0], [phi, -1, 0], [-phi, -1, 0], + [1, 0, phi], [1, 0, -phi], [-1, 0, phi], [-1, 0, -phi], + [0, phi, 1], [0, -phi, 1], [0, phi, -1], [0, -phi, -1], + ]; + var createVertex = function(c) { + return new THREE.Vector3(c[0], c[1], c[2]); + }; + var createTriangle = function(i0, i1, i2) { + return new THREE.Triangle(createVertex(verts[i0]), createVertex(verts[i1]), createVertex(verts[i2])); + }; + var triangles = [ + createTriangle(0, 8, 4), + createTriangle(0, 5, 10), + createTriangle(2, 4, 9), + createTriangle(2, 11, 5), + createTriangle(1, 6, 8), + createTriangle(1, 10, 7), + createTriangle(3, 9, 6), + createTriangle(3, 7, 11), + createTriangle(0, 10, 8), + createTriangle(1, 8, 10), + createTriangle(2, 9, 11), + createTriangle(3, 9, 11), + createTriangle(4, 2, 0), + createTriangle(5, 0, 2), + createTriangle(6, 1, 3), + createTriangle(7, 3, 1), + createTriangle(8, 6, 4), + createTriangle(9, 4, 6), + createTriangle(10, 5, 7), + createTriangle(11, 7, 5), + ]; + // test a variety of points all in and around the icosahedron + var testPoints = []; + for (var x = -2; x <= 2; x += 0.5) { + for (var y = -2; y <= 2; y += 0.5) { + for (var z = -2; z <= 2; z += 0.5) { + testPoints.push(new THREE.Vector3(x, y, z)); + } + } + } + + var s = Bench.newSuite("Clamping point into triangles"); + + s.add('9^3 points, 20 triangles', function() { + var target = new THREE.Vector3(); + for (var tidx = 0; tidx < triangles.length; tidx++) { + triangle = triangles[tidx]; + for (var pidx = 0; pidx < testPoints.length; pidx++) { + triangle.closestPointToPoint(testPoints[pidx], target); + } + } + }); +})();
true
Other
mrdoob
three.js
98f84c1b26a1d0506859b3aff3bf937ceb69478a.json
Normalize scroll wheel
examples/js/controls/EditorControls.js
@@ -14,7 +14,7 @@ THREE.EditorControls = function ( object, domElement ) { this.enabled = true; this.center = new THREE.Vector3(); this.panSpeed = 0.001; - this.zoomSpeed = 0.001; + this.zoomSpeed = 0.1; this.rotationSpeed = 0.005; // internals @@ -187,9 +187,8 @@ THREE.EditorControls = function ( object, domElement ) { event.preventDefault(); - // if ( scope.enabled === false ) return; - - scope.zoom( new THREE.Vector3( 0, 0, event.deltaY ) ); + // Normalize deltaY due to https://bugzilla.mozilla.org/show_bug.cgi?id=1392460 + scope.zoom( new THREE.Vector3( 0, 0, event.deltaY > 0 ? 1 : - 1 ) ); }
false
Other
mrdoob
three.js
5067e5df79656cc8f101c3842552a29a2df50efd.json
Normalize scroll wheel
examples/js/controls/EditorControls.js
@@ -14,7 +14,7 @@ THREE.EditorControls = function ( object, domElement ) { this.enabled = true; this.center = new THREE.Vector3(); this.panSpeed = 0.001; - this.zoomSpeed = 0.001; + this.zoomSpeed = 0.1; this.rotationSpeed = 0.005; // internals @@ -189,7 +189,7 @@ THREE.EditorControls = function ( object, domElement ) { // if ( scope.enabled === false ) return; - scope.zoom( new THREE.Vector3( 0, 0, event.deltaY ) ); + scope.zoom( new THREE.Vector3( 0, 0, event.deltaY > 0 ? 1 : - 1 ) ); }
false
Other
mrdoob
three.js
4c6fcc8585ffa21ea7153942deafa4ea4c867161.json
fix Quaternion.slerp for small angles Previous implementation relied on average quaternions (t=0.5) for small angles. Now uses the same approach as Quaternion.slerpFlat (threshold and lerp)
src/math/Quaternion.js
@@ -533,19 +533,21 @@ Object.assign( Quaternion.prototype, { } - var sinHalfTheta = Math.sqrt( 1.0 - cosHalfTheta * cosHalfTheta ); + var sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta; - if ( Math.abs( sinHalfTheta ) < 0.001 ) { + if ( sqrSinHalfTheta <= Number.EPSILON ) { - this._w = 0.5 * ( w + this._w ); - this._x = 0.5 * ( x + this._x ); - this._y = 0.5 * ( y + this._y ); - this._z = 0.5 * ( z + this._z ); + var s = 1 - t; + this._w = s * w + t * this._w; + this._x = s * x + t * this._x; + this._y = s * y + t * this._y; + this._z = s * z + t * this._z; return this; } + var sinHalfTheta = Math.sqrt( sqrSinHalfTheta ); var halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta ); var ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta, ratioB = Math.sin( t * halfTheta ) / sinHalfTheta;
false
Other
mrdoob
three.js
7d7658d83ac09fedef93bff0d64dc78240ed8595.json
Fix broken link to BufferGeometry page.
docs/api/objects/Line.html
@@ -46,7 +46,7 @@ <h2>Constructor</h2> <h3>[name]( [param:Geometry geometry], [param:Material material] )</h3> <p> - [page:Geometry geometry] — vertices representing the line segment(s). Default is a new [page:new BufferGeometry].<br /> + [page:Geometry geometry] — vertices representing the line segment(s). Default is a new [page:BufferGeometry].<br /> [page:Material material] — material for the line. Default is a new [page:LineBasicMaterial] with random color.<br /> </p>
false
Other
mrdoob
three.js
ae49679f4e947ab6592cbc509b3ce9250d332298.json
Remove interleavedGeometryAttribute test
test/unit/src/core/BufferGeometry.tests.js
@@ -10,8 +10,6 @@ import { Uint16BufferAttribute, Uint32BufferAttribute } from '../../../../src/core/BufferAttribute'; -import { InterleavedBufferAttribute } from '../../../../src/core/InterleavedBufferAttribute'; -import { InterleavedBuffer } from '../../../../src/core/InterleavedBuffer'; import { Color } from '../../../../src/math/Color'; import { Vector2 } from '../../../../src/math/Vector2'; import { Vector3 } from '../../../../src/math/Vector3'; @@ -862,10 +860,9 @@ export default QUnit.module( 'Core', () => { QUnit.test( "clone", ( assert ) => { - // ensure cloning works with both BufferAttributes and InterleavedBufferAttributes var a = new BufferGeometry(); a.addAttribute( "attribute1", new BufferAttribute( new Float32Array( [ 1, 2, 3, 4, 5, 6 ] ), 3 ) ); - a.addAttribute( "attribute2", new InterleavedBufferAttribute( new InterleavedBuffer( new Float32Array( [ 0, 1, 3, 5, 6 ] ), 1 ), 1, 0 ) ); + a.addAttribute( "attribute2", new BufferAttribute( new Float32Array( [ 0, 1, 3, 5, 6 ] ), 1 ) ); a.addGroup( 0, 1, 2 ); a.computeBoundingBox(); a.computeBoundingSphere();
false
Other
mrdoob
three.js
7f521d49556b9fc37b335a3f2875bd17d55348bd.json
Move `mergeVertices` to `BufferGeometryUtils`
examples/js/utils/BufferGeometryUtils.js
@@ -469,6 +469,177 @@ THREE.BufferGeometryUtils = { mem += indices ? indices.count * indices.itemSize * indices.array.BYTES_PER_ELEMENT : 0; return mem; + }, + + /** + * @param {THREE.BufferGeometry} geometry + * @param {number} tolerance + * @return {THREE.BufferGeometry>} + */ + mergeVertices: function ( geometry, tolerance = 1e-4 ) { + + tolerance = Math.max( tolerance, Number.EPSILON ); + + // Generate an index buffer if the geometry doesn't have one, or optimize it + // if it's already available. + var hashToIndex = {}; + var indices = geometry.getIndex(); + var positions = geometry.getAttribute( 'position' ); + var vertexCount = indices ? indices.count : positions.count; + + // next value for triangle indices + var nextIndex = 0; + + // attributes and new attribute arrays + var attributeNames = Object.keys( geometry.attributes ); + var attrArrays = {}; + var morphAttrsArrays = {}; + var newIndices = []; + var getters = [ 'getX', 'getY', 'getZ', 'getW' ]; + + // initialize the arrays + for ( var name of attributeNames ) { + + attrArrays[ name ] = []; + + var morphAttr = geometry.morphAttributes[ name ]; + if ( morphAttr ) { + + morphAttrsArrays[ name ] = new Array( morphAttr.length ).fill().map( () => [] ); + + } + + } + + // convert the error tolerance to an amount of decimal places to truncate to + var decimalShift = Math.log10( 1 / tolerance ); + var shiftMultiplier = Math.pow( 10, decimalShift ); + for ( var i = 0; i < vertexCount; i ++ ) { + + var index = indices ? indices.getX( i ) : i; + + // Generate a hash for the vertex attributes at the current index 'i' + var hash = ''; + for ( var j = 0, l = attributeNames.length; j < l; j ++ ) { + + var name = attributeNames[ j ]; + var attribute = geometry.getAttribute( name ); + var itemSize = attribute.itemSize; + + for ( var k = 0; k < itemSize; k ++ ) { + + // double tilde truncates the decimal value + hash += `${ ~ ~ ( attribute[ getters[ k ] ]( index ) * shiftMultiplier ) },`; + + } + + } + + // Add another reference to the vertex if it's already + // used by another index + if ( hash in hashToIndex ) { + + newIndices.push( hashToIndex[ hash ] ); + + } else { + + // copy data to the new index in the attribute arrays + for ( var j = 0, l = attributeNames.length; j < l; j ++ ) { + + var name = attributeNames[ j ]; + var attribute = geometry.getAttribute( name ); + var morphAttr = geometry.morphAttributes[ name ]; + var itemSize = attribute.itemSize; + var newarray = attrArrays[ name ]; + var newMorphArrays = morphAttrsArrays[ name ]; + + for ( var k = 0; k < itemSize; k ++ ) { + + var getterFunc = getters[ k ]; + newarray.push( attribute[ getterFunc ]( index ) ); + + if ( morphAttr ) { + + for ( var m = 0, ml = morphAttr.length; m < ml; m ++ ) { + + newMorphArrays[ m ].push( morphAttr[ m ][ getterFunc ]( index ) ); + + } + + } + + } + + } + + hashToIndex[ hash ] = nextIndex; + newIndices.push( nextIndex ); + nextIndex ++; + + } + + } + + // Generate typed arrays from new attribute arrays and update + // the attributeBuffers + const result = geometry.clone(); + for ( var i = 0, l = attributeNames.length; i < l; i ++ ) { + + var name = attributeNames[ i ]; + var oldAttribute = geometry.getAttribute( name ); + var attribute; + + var buffer = new oldAttribute.array.constructor( attrArrays[ name ] ); + if ( oldAttribute.isInterleavedBufferAttribute ) { + + attribute = new THREE.BufferAttribute( buffer, oldAttribute.itemSize, oldAttribute.itemSize ); + + } else { + + attribute = geometry.getAttribute( name ).clone(); + attribute.setArray( buffer ); + + } + + result.addAttribute( name, attribute ); + + // Update the attribute arrays + if ( name in morphAttrsArrays ) { + + for ( var j = 0; j < morphAttrsArrays[ name ].length; j ++ ) { + + var morphAttribute = geometry.morphAttributes[ name ][ j ].clone(); + morphAttribute.setArray( new morphAttribute.array.constructor( morphAttrsArrays[ name ][ j ] ) ); + result.morphAttributes[ name ][ j ] = morphAttribute; + + } + + } + + } + + // Generate an index buffer typed array + var cons = Uint8Array; + if ( newIndices.length >= Math.pow( 2, 8 ) ) cons = Uint16Array; + if ( newIndices.length >= Math.pow( 2, 16 ) ) cons = Uint32Array; + + var newIndexBuffer = new cons( newIndices ); + var newIndices = null; + if ( indices === null ) { + + newIndices = new THREE.BufferAttribute( newIndexBuffer, 1 ); + + } else { + + newIndices = geometry.getIndex().clone(); + newIndices.setArray( newIndexBuffer ); + + } + + result.setIndex( newIndices ); + + return result; + } };
true
Other
mrdoob
three.js
7f521d49556b9fc37b335a3f2875bd17d55348bd.json
Move `mergeVertices` to `BufferGeometryUtils`
src/core/BufferGeometry.js
@@ -900,171 +900,6 @@ BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototy }, - mergeVertices: function ( tolerance = 1e-4 ) { - - tolerance = Math.max( tolerance, Number.EPSILON ); - - // Generate an index buffer if the geometry doesn't have one, or optimize it - // if it's already available. - var hashToIndex = {}; - var indices = this.getIndex(); - var positions = this.getAttribute( 'position' ); - var vertexCount = indices ? indices.count : positions.count; - - // next value for triangle indices - var nextIndex = 0; - - // attributes and new attribute arrays - var attributeNames = Object.keys( this.attributes ); - var attrArrays = {}; - var morphAttrsArrays = {}; - var newIndices = []; - var getters = [ 'getX', 'getY', 'getZ', 'getW' ]; - - // initialize the arrays - for ( var name of attributeNames ) { - - attrArrays[ name ] = []; - - var morphAttr = this.morphAttributes[ name ]; - if ( morphAttr ) { - - morphAttrsArrays[ name ] = new Array( morphAttr.length ).fill().map( () => [] ); - - } - - } - - // convert the error tolerance to an amount of decimal places to truncate to - var decimalShift = Math.log10( 1 / tolerance ); - var shiftMultiplier = Math.pow( 10, decimalShift ); - for ( var i = 0; i < vertexCount; i ++ ) { - - var index = indices ? indices.getX( i ) : i; - - // Generate a hash for the vertex attributes at the current index 'i' - var hash = ''; - for ( var j = 0, l = attributeNames.length; j < l; j ++ ) { - - var name = attributeNames[ j ]; - var attribute = this.getAttribute( name ); - var itemSize = attribute.itemSize; - - for ( var k = 0; k < itemSize; k ++ ) { - - // double tilde truncates the decimal value - hash += `${ ~ ~ ( attribute[ getters[ k ] ]( index ) * shiftMultiplier ) },`; - - } - - } - - // Add another reference to the vertex if it's already - // used by another index - if ( hash in hashToIndex ) { - - newIndices.push( hashToIndex[ hash ] ); - - } else { - - // copy data to the new index in the attribute arrays - for ( var j = 0, l = attributeNames.length; j < l; j ++ ) { - - var name = attributeNames[ j ]; - var attribute = this.getAttribute( name ); - var morphAttr = this.morphAttributes[ name ]; - var itemSize = attribute.itemSize; - var newarray = attrArrays[ name ]; - var newMorphArrays = morphAttrsArrays[ name ]; - - for ( var k = 0; k < itemSize; k ++ ) { - - var getterFunc = getters[ k ]; - newarray.push( attribute[ getterFunc ]( index ) ); - - if ( morphAttr ) { - - for ( var m = 0, ml = morphAttr.length; m < ml; m ++ ) { - - newMorphArrays[ m ].push( morphAttr[ m ][ getterFunc ]( index ) ); - - } - - } - - } - - } - - hashToIndex[ hash ] = nextIndex; - newIndices.push( nextIndex ); - nextIndex ++; - - } - - } - - // Generate typed arrays from new attribute arrays and update - // the attributeBuffers - for ( var i = 0, l = attributeNames.length; i < l; i ++ ) { - - var name = attributeNames[ i ]; - var oldAttribute = this.getAttribute( name ); - var attribute; - - var buffer = new oldAttribute.array.constructor( attrArrays[ name ] ); - if ( oldAttribute.isInterleavedBufferAttribute ) { - - attribute = new THREE.BufferAttribute( buffer, oldAttribute.itemSize, oldAttribute.itemSize ); - - } else { - - attribute = this.getAttribute( name ).clone(); - attribute.setArray( buffer ); - - } - - this.addAttribute( name, attribute ); - - // Update the attribute arrays - if ( name in morphAttrsArrays ) { - - for ( var j = 0; j < morphAttrsArrays[ name ].length; j ++ ) { - - var morphAttribute = this.morphAttributes[ name ][ j ].clone(); - morphAttribute.setArray( new morphAttribute.array.constructor( morphAttrsArrays[ name ][ j ] ) ); - this.morphAttributes[ name ][ j ] = morphAttribute; - - } - - } - - } - - // Generate an index buffer typed array - var cons = Uint8Array; - if ( newIndices.length >= Math.pow( 2, 8 ) ) cons = Uint16Array; - if ( newIndices.length >= Math.pow( 2, 16 ) ) cons = Uint32Array; - - var newIndexBuffer = new cons( newIndices ); - var newIndices = null; - if ( indices === null ) { - - newIndices = new THREE.BufferAttribute( newIndexBuffer, 1 ); - - } else { - - newIndices = this.getIndex().clone(); - newIndices.setArray( newIndexBuffer ); - - } - - this.setIndex( newIndices ); - - return this; - - }, - toJSON: function () { var data = {
true
Other
mrdoob
three.js
4510e9311f7477547e82cbed7894772635e88a84.json
Improve implementation accordingly to PR reviews Signed-off-by: Riccardo Padovani <rpadovani@nextbit.it>
examples/js/loaders/GLTFLoader.js
@@ -1541,7 +1541,7 @@ THREE.GLTFLoader = ( function () { } else { - geometryKey = primitiveDef.indices + ':' + createAttributesKey( primitiveDef.attributes ) + primitiveDef.mode; + geometryKey = primitiveDef.indices + ':' + createAttributesKey( primitiveDef.attributes ) + ':' + primitiveDef.mode; } @@ -1557,21 +1557,35 @@ THREE.GLTFLoader = ( function () { for ( var i = 0, il = keys.length; i < il; i ++ ) { - attributesKey += keys[ i ] + attributes[ keys[ i ] ]; + attributesKey += keys[ i ] + ':' + attributes[ keys[ i ] ] + ';'; } return attributesKey; } - function createArrayKey( a ) { + function createArrayKeyBufferGeometry( a ) { var arrayKey = ''; for ( var i = 0, il = a.length; i < il; i ++ ) { - arrayKey += i + createAttributesKey( a[ i ] ); + arrayKey += i + a[ i ].uuid; + + } + + return arrayKey; + + } + + function createArrayKeyGLTFPrimitive( a ) { + + var arrayKey = ''; + + for ( var i = 0, il = a.length; i < il; i ++ ) { + + arrayKey += i + createGeometryKey( a[ i ] ); } @@ -1581,7 +1595,7 @@ THREE.GLTFLoader = ( function () { function createMultiPassGeometryKey( geometry, primitives ) { - return createGeometryKey( geometry ) + createArrayKey( primitives ); + return createGeometryKey( geometry ) + createArrayKeyGLTFPrimitive( primitives ); } @@ -2610,7 +2624,7 @@ THREE.GLTFLoader = ( function () { // See if we've already created this combined geometry var cache = parser.multiplePrimitivesCache; - var cacheKey = createArrayKey( geometries ); + var cacheKey = createArrayKeyBufferGeometry( geometries ); var cached = cache[ cacheKey ]; if ( cached ) {
false
Other
mrdoob
three.js
082cbcb36ef113bca0e7b66e412e6fd342d811bc.json
fix Object3D method return types etc.
docs/api/en/core/Object3D.html
@@ -107,14 +107,14 @@ <h3>[property:Matrix3 normalMatrix]</h3> On the other hand the translation part of the modelViewMatrix is not relevant for the calculation of normals. Thus a Matrix3 is sufficient. </p> - <h3>[property:function onAfterRender]</h3> + <h3>[property:Function onAfterRender]</h3> <p> An optional callback that is executed immediately after the Object3D is rendered. This function is called with the following parameters: renderer, scene, camera, geometry, material, group. </p> - <h3>[property:function onBeforeRender]</h3> + <h3>[property:Function onBeforeRender]</h3> <p> An optional callback that is executed immediately before the Object3D is rendered. This function is called with the following parameters: renderer, scene, camera, geometry, @@ -158,7 +158,7 @@ <h3>[property:Vector3 up]</h3> Default is [page:Object3D.DefaultUp] - that is, ( 0, 1, 0 ). </p> - <h3>[property:object userData]</h3> + <h3>[property:Object userData]</h3> <p> An object that can be used to store custom data about the Object3D. It should not hold references to functions as these will not be cloned. @@ -203,7 +203,7 @@ <h2>Methods</h2> <h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3> - <h3>[method:null add]( [param:Object3D object], ... )</h3> + <h3>[method:this add]( [param:Object3D object], ... )</h3> <p> Adds *object* as child of this object. An arbitrary number of objects may be added. Any current parent on an object passed in here will be removed, since an object can have at most one parent.<br /><br /> @@ -214,7 +214,7 @@ <h3>[method:null add]( [param:Object3D object], ... )</h3> <h3>[method:null applyMatrix]( [param:Matrix4 matrix] )</h3> <p>Applies the matrix transform to the object and updates the object's position, rotation and scale.</p> - <h3>[method:Object3D applyQuaternion]( [param:Quaternion quaternion] )</h3> + <h3>[method:this applyQuaternion]( [param:Quaternion quaternion] )</h3> <p>Applies the rotation represented by the quaternion to the object.</p> <h3>[method:Object3D clone]( [param:Boolean recursive] )</h3> @@ -310,7 +310,7 @@ <h3>[method:Array raycast]( [param:Raycaster raycaster], [param:Array intersects to use raycasting. </p> - <h3>[method:null remove]( [param:Object3D object], ... )</h3> + <h3>[method:this remove]( [param:Object3D object], ... )</h3> <p> Removes *object* as child of this object. An arbitrary number of objects may be removed. </p>
false
Other
mrdoob
three.js
1c51265f4af957b3cf3a4c69468c18de8d4ee04b.json
correct more return types
docs/api/en/loaders/CompressedTextureLoader.html
@@ -48,7 +48,7 @@ <h3>[property:String path]</h3> <h2>Methods</h2> - <h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3> + <h3>[method:CompressedTexture load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3> <p> [page:String url] — the path or URL to the file. This can also be a [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
true
Other
mrdoob
three.js
1c51265f4af957b3cf3a4c69468c18de8d4ee04b.json
correct more return types
docs/api/en/loaders/CubeTextureLoader.html
@@ -70,7 +70,7 @@ <h3>[property:String path]</h3> <h2>Methods</h2> - <h3>[method:null load]( [param:String urls], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3> + <h3>[method:CubeTexture load]( [param:String urls], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3> <p> [page:String urls] — array of 6 urls to images, one for each side of the CubeTexture. The urls should be specified in the following order: pos-x, neg-x, pos-y, neg-y, pos-z, neg-z. @@ -83,7 +83,7 @@ <h3>[method:null load]( [param:String urls], [param:Function onLoad], [param:Fun [page:Function onError] — Will be called when load errors.<br /> </p> <p> - Begin loading from url and pass the loaded [page:Texture texture] to onLoad. + Begin loading from url and pass the loaded [page:CubeTexture texture] to onLoad. </p> <h3>[method:null setCrossOrigin]( [param:String value] )</h3>
true
Other
mrdoob
three.js
1c51265f4af957b3cf3a4c69468c18de8d4ee04b.json
correct more return types
docs/api/en/loaders/DataTextureLoader.html
@@ -44,7 +44,7 @@ <h3>[property:LoadingManager manager]</h3> <h2>Methods</h2> - <h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3> + <h3>[method:DataTexture load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3> <p> [page:String url] — the path or URL to the file. This can also be a [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
true
Other
mrdoob
three.js
1c51265f4af957b3cf3a4c69468c18de8d4ee04b.json
correct more return types
docs/api/en/loaders/FontLoader.html
@@ -73,7 +73,7 @@ <h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Func <p> [page:String url] — the path or URL to the file. This can also be a [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br /> - [page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<br /> + [page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Font font].<br /> [page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br /> [page:Function onError] — Will be called when load errors.<br /><br />
true
Other
mrdoob
three.js
1c51265f4af957b3cf3a4c69468c18de8d4ee04b.json
correct more return types
docs/api/en/loaders/ImageLoader.html
@@ -82,7 +82,7 @@ <h3>[property:String path]</h3> <h2>Methods</h2> - <h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3> + <h3>[method:HTMLImageElement load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3> <p> [page:String url] — the path or URL to the file. This can also be a [link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI].<br />
true
Other
mrdoob
three.js
1c51265f4af957b3cf3a4c69468c18de8d4ee04b.json
correct more return types
docs/api/en/loaders/MaterialLoader.html
@@ -74,7 +74,7 @@ <h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Func [page:Function onProgress] — Will be called while load progresses. The argument will be the progress event.<br /> [page:Function onError] — Will be called when load errors.<br /><br /> - Begin loading from url and return the [page:Material] object that will contain the data. + Begin loading from url. </p> <h3>[method:Material parse]( [param:Object json] )</h3>
true
Other
mrdoob
three.js
f6d816de8ef6b2a1806fce22ef8df238c0996f0e.json
fix some incorrect type cases
docs/api/en/loaders/FileLoader.html
@@ -76,7 +76,7 @@ <h3>[property:String mimeType]</h3> <h3>[property:String path]</h3> <p>The base path from which files will be loaded. See [page:.setPath]. Default is *undefined*.</p> - <h3>[property:object requestHeader]</h3> + <h3>[property:Object requestHeader]</h3> <p>The [link:https://developer.mozilla.org/en-US/docs/Glossary/Request_header request header] used in HTTP request. See [page:.setRequestHeader]. Default is *undefined*.</p> <h3>[property:String responseType]</h3> @@ -115,7 +115,7 @@ <h3>[method:FileLoader setPath]( [param:String path] )</h3> you are loading many models from the same directory. </p> - <h3>[method:FileLoader setRequestHeader]( [param:object requestHeader] )</h3> + <h3>[method:FileLoader setRequestHeader]( [param:Object requestHeader] )</h3> <p> [page:object requestHeader] - key: The name of the header whose value is to be set. value: The value to set as the body of the header.<br /><br /> @@ -125,7 +125,7 @@ <h3>[method:FileLoader setRequestHeader]( [param:object requestHeader] )</h3> <h3>[method:FileLoader setResponseType]( [param:String responseType] )</h3> <p> Change the response type. Valid values are:<br /> - [page:String text] or empty string (default) - returns the data as [page:String string].<br /> + [page:String text] or empty string (default) - returns the data as [page:String String].<br /> [page:String arraybuffer] - loads the data into a [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer ArrayBuffer] and returns that.<br /> [page:String blob] - returns the data as a [link:https://developer.mozilla.org/en/docs/Web/API/Blob Blob].<br /> [page:String document] - parses the file using the [link:https://developer.mozilla.org/en-US/docs/Web/API/DOMParser DOMParser].<br />
false
Other
mrdoob
three.js
c0eeaedaa4225314c28f28ffe760600a0f9aeb67.json
fix spaces to tabs
examples/js/exporters/ColladaExporter.js
@@ -359,14 +359,14 @@ THREE.ColladaExporter.prototype = { type = 'constant'; - if ( m.map !== null ) { + if ( m.map !== null ) { - // The Collada spec does not support diffuse texture maps with the - // constant shader type. - // mrdoob/three.js#15469 - console.warn( 'ColladaExporter: Texture maps not supported with MeshBasicMaterial.' ); + // The Collada spec does not support diffuse texture maps with the + // constant shader type. + // mrdoob/three.js#15469 + console.warn( 'ColladaExporter: Texture maps not supported with MeshBasicMaterial.' ); - } + } }
false
Other
mrdoob
three.js
f3ed73d26ab9ff99e966d40707028222754dd6b5.json
use var for consistency
rollup-examples.config.js
@@ -1,12 +1,12 @@ -const path = require( 'path' ); -const fs = require( 'fs' ); +var path = require( 'path' ); +var fs = require( 'fs' ); // Creates an rollup config object for the given file to // be output to umd format function createOutput( file ) { - const inputPath = path.resolve( file ); - const outputPath = inputPath.replace( /[\\\/]examples[\\\/]jsm[\\\/]/, '/examples/js/' ); + var inputPath = path.resolve( file ); + var outputPath = inputPath.replace( /[\\\/]examples[\\\/]jsm[\\\/]/, '/examples/js/' ); // Every import is marked as external so the output is 1-to-1. We // assume that that global object should be the THREE object so we @@ -42,11 +42,11 @@ function createOutput( file ) { // the callback for every file. function walk( dir, cb ) { - const files = fs.readdirSync( dir ); + var files = fs.readdirSync( dir ); files.forEach( f => { - const p = path.join( dir, f ); - const stats = fs.statSync( p ); + var p = path.join( dir, f ); + var stats = fs.statSync( p ); if ( stats.isDirectory() ) { walk( p, cb ); @@ -62,7 +62,7 @@ function walk( dir, cb ) { } // Gather up all the files -const files = []; +var files = []; walk( 'examples/jsm/', p => files.push( p ) ); // Create a rollup config for each module.js file
false
Other
mrdoob
three.js
55bc03533328172b5f0b533e871f012a3af63cc7.json
Remove unused imports.
src/animation/AnimationUtils.js
@@ -1,6 +1,3 @@ -import { PropertyBinding } from './PropertyBinding.js'; -import { InterpolateLinear } from '../constants.js'; - /** * @author tschw * @author Ben Houston / http://clara.io/
false
Other
mrdoob
three.js
3e9bd587a127fe91e3f8b53797986a3e5bca8adb.json
Add missing isScene
src/scenes/Scene.js
@@ -22,6 +22,8 @@ Scene.prototype = Object.assign( Object.create( Object3D.prototype ), { constructor: Scene, + isScene: true, + copy: function ( source, recursive ) { Object3D.prototype.copy.call( this, source, recursive );
false
Other
mrdoob
three.js
d682f4c2c0f5a22052fd050b916fe14a672f94e7.json
fix LinearToLogLuv convert
src/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js
@@ -61,7 +61,7 @@ vec4 LinearToRGBD( in vec4 value, in float maxRange ) { // M matrix, for encoding const mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 ); vec4 LinearToLogLuv( in vec4 value ) { - vec3 Xp_Y_XYZp = value.rgb * cLogLuvM; + vec3 Xp_Y_XYZp = cLogLuvM * value.rgb; Xp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) ); vec4 vResult; vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;
false
Other
mrdoob
three.js
43918cc66cbce4dcb97a3904ef804518846ff7ea.json
fix LogLuvToLinear convert error
src/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js
@@ -79,7 +79,7 @@ vec4 LogLuvToLinear( in vec4 value ) { Xp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 ); Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y; Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z; - vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM; + vec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb; return vec4( max( vRGB, 0.0 ), 1.0 ); } `;
false
Other
mrdoob
three.js
b0403abc33cf3cd24572545c0e0d9991eb751c0b.json
update webgl state
src/materials/Material.js
@@ -46,7 +46,7 @@ function Material() { this.stencilFail = KeepStencilOp; this.stencilZFail = KeepStencilOp; this.stencilZPass = KeepStencilOp; - this.stencilWrite = true; + this.stencilWrite = false; this.clippingPlanes = null; this.clipIntersection = false;
true
Other
mrdoob
three.js
b0403abc33cf3cd24572545c0e0d9991eb751c0b.json
update webgl state
src/renderers/webgl/WebGLState.js
@@ -677,13 +677,12 @@ function WebGLState( gl, extensions, utils, capabilities ) { depthBuffer.setMask( material.depthWrite ); colorBuffer.setMask( material.colorWrite ); - var stencil = material.stencil; - var useStencil = stencil !== null; - stencilBuffer.setTest( useStencil ); - if ( useStencil ) { + var stencilWrite = material.stencilWrite; + stencilBuffer.setTest( stencilWrite ); + if ( stencilWrite ) { - stencilBuffer.setFunc( stencil.func, stencil.ref, stencil.mask ); - stencilBuffer.setOp( stencil.fail, stencil.zfail, stencil.zpass ); + stencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilMask ); + stencilBuffer.setOp( material.stencilFail, material.stencilZFail, material.stencilZPass ); }
true
Other
mrdoob
three.js
b3bd93573a91ea304f07ee81798930b3d69012d3.json
Update badge to have custom label
README.md
@@ -6,7 +6,7 @@ three.js [![Dependencies][dependencies-badge]][dependencies-badge-url] [![Dev Dependencies][devDependencies-badge]][devDependencies-badge-url] [![Build Status](https://travis-ci.org/mrdoob/three.js.svg?branch=dev)](https://travis-ci.org/mrdoob/three.js) -[![Language Grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/mrdoob/three.js.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/mrdoob/three.js/) +[![Language Grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/mrdoob/three.js.svg?logo=lgtm&logoWidth=18&label=LGTM%20code%20quality)](https://lgtm.com/projects/g/mrdoob/three.js/) #### JavaScript 3D library ####
false
Other
mrdoob
three.js
49b37a42ba690079f949e3df918df10dbe948138.json
add listener for 'abort' event #14652
src/loaders/FileLoader.js
@@ -239,6 +239,24 @@ Object.assign( FileLoader.prototype, { }, false ); + request.addEventListener( 'abort', function ( event ) { + + var callbacks = loading[ url ]; + + delete loading[ url ]; + + for ( var i = 0, il = callbacks.length; i < il; i ++ ) { + + var callback = callbacks[ i ]; + if ( callback.onError ) callback.onError( event ); + + } + + scope.manager.itemEnd( url ); + scope.manager.itemError( url ); + + }, false ); + if ( this.responseType !== undefined ) request.responseType = this.responseType; if ( this.withCredentials !== undefined ) request.withCredentials = this.withCredentials;
false
Other
mrdoob
three.js
73d6148d915a67903c1f0e898f894bebfd5093c0.json
fix initial index in dropdown
examples/webgl_materials_nodes.html
@@ -285,6 +285,8 @@ } else if ( typeof value == 'object' ) { + param.blend = value[ Object.keys( value )[ 0 ] ]; + node = gui.add( param, name, value ).onChange( function () { callback( param[ name ] );
true
Other
mrdoob
three.js
73d6148d915a67903c1f0e898f894bebfd5093c0.json
fix initial index in dropdown
examples/webgl_postprocessing_nodes.html
@@ -154,6 +154,8 @@ } else if ( typeof value == 'object' ) { + param.blend = value[ Object.keys( value )[ 0 ] ]; + node = gui.add( param, name, value ).onChange( function () { callback( param[ name ] );
true
Other
mrdoob
three.js
de353d0b39d9e710238f3694b7d048c74dd7b11d.json
add more description
docs/api/core/Object3D.html
@@ -387,13 +387,13 @@ <h3>[method:this translateOnAxis]( [param:Vector3 axis], [param:Float distance] </p> <h3>[method:this translateX]( [param:Float distance] )</h3> - <p>Translates object along x axis by *distance* units.</p> + <p>Translates object along x axis in object space by *distance* units.</p> <h3>[method:this translateY]( [param:Float distance] )</h3> - <p>Translates object along y axis by *distance* units.</p> + <p>Translates object along y axis in object space by *distance* units.</p> <h3>[method:this translateZ]( [param:Float distance] )</h3> - <p>Translates object along z axis by *distance* units.</p> + <p>Translates object along z axis in object space by *distance* units.</p> <h3>[method:null traverse]( [param:Function callback] )</h3> <p>
false
Other
mrdoob
three.js
3d8f71715d0937d831b39ea8793fe90e59d58c79.json
Simplify blending mode
examples/js/loaders/EquiangularToCubeGenerator.js
@@ -95,13 +95,7 @@ THREE.EquiangularToCubeGenerator.prototype = { gl_FragColor = vec4( color, 1.0 );\n\ }", - blending: THREE.CustomBlending, - premultipliedAlpha: false, - blendSrc: THREE.OneFactor, - blendDst: THREE.ZeroFactor, - blendSrcAlpha: THREE.OneFactor, - blendDstAlpha: THREE.ZeroFactor, - blendEquation: THREE.AddEquation + blending: THREE.NoBlending } );
true
Other
mrdoob
three.js
3d8f71715d0937d831b39ea8793fe90e59d58c79.json
Simplify blending mode
examples/js/pmrem/PMREMCubeUVPacker.js
@@ -178,13 +178,7 @@ THREE.PMREMCubeUVPacker.prototype = { gl_FragColor = linearToOutputTexel( color );\ }", - blending: THREE.CustomBlending, - premultipliedAlpha: false, - blendSrc: THREE.OneFactor, - blendDst: THREE.ZeroFactor, - blendSrcAlpha: THREE.OneFactor, - blendDstAlpha: THREE.ZeroFactor, - blendEquation: THREE.AddEquation + blending: THREE.NoBlending } );
true
Other
mrdoob
three.js
3d8f71715d0937d831b39ea8793fe90e59d58c79.json
Simplify blending mode
examples/js/pmrem/PMREMGenerator.js
@@ -259,13 +259,7 @@ THREE.PMREMGenerator.prototype = { gl_FragColor = linearToOutputTexel( vec4( rgbColor, 1.0 ) );\n\ }", - blending: THREE.CustomBlending, - premultipliedAlpha: false, - blendSrc: THREE.OneFactor, - blendDst: THREE.ZeroFactor, - blendSrcAlpha: THREE.OneFactor, - blendDstAlpha: THREE.ZeroFactor, - blendEquation: THREE.AddEquation + blending: THREE.NoBlending } );
true
Other
mrdoob
three.js
d2da61644ec9605bf106d9eb12e6c73378e0555a.json
Add WebVR example
examples/webvr_lorenz_attractor.html
@@ -0,0 +1,172 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <title>three.js webvr - Lorenz attractor</title> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> + <!-- Origin Trial Token, feature = WebVR (For Chrome M62+), origin = https://threejs.org, expires = 2018-06-19 --> + <meta http-equiv="origin-trial" data-feature="WebVR (For Chrome M62+)" data-expires="2018-06-19" content="Alxt96tYGgIr9l6EXU0eeI360zcmzOY6Kuo3kcTfBGIRDOQbgFIZKRQ1joExQ74WZr1einsE+cUMHgSclNHCQQ4AAABQeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJWUjEuMU02MiIsImV4cGlyeSI6MTUyOTM5NzgyOH0="> + <!-- Origin Trial Token, feature = WebXR Device API, origin = https://threejs.org, expires = 2018-06-15 --> + <meta http-equiv="origin-trial" data-feature="WebXR Device API" data-expires="2018-06-15" content="AtJH9g6nn0B87bnjJt+9m1joZXEYDmLSlRvtMr5qJD52hMcm3S86S7jg5I7y2I5cgQglE0rzsXzti5DECQLb8QkAAABQeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkRldmljZSIsImV4cGlyeSI6MTUyOTA4NDY2OH0="> + <!-- Origin Trial Token, feature = WebXR Gamepad Support, origin = https://threejs.org, expires = 2018-06-15 --> + <meta http-equiv="origin-trial" data-feature="WebXR Gamepad Support" data-expires="2018-06-15" content="Aihhr0yXkVlCKF0DIpTbH8WX7ZmEexUhI/95+t8aoLfvBkePMiZ/iOoDPU3xefyfuczkDahH1L6eiPvRsuzITAAAAABYeyJvcmlnaW4iOiJodHRwczovL3RocmVlanMub3JnOjQ0MyIsImZlYXR1cmUiOiJXZWJYUkdhbWVwYWRTdXBwb3J0IiwiZXhwaXJ5IjoxNTI5MDg0NjY4fQ=="> + <style> + body { + margin: 0px; + overflow: hidden; + } + </style> + </head> + <body> + + <script src="../build/three.js"></script> + + <script src="js/vr/WebVR.js"></script> + + <script> + + var camera, scene, renderer, x, y, z, c, geometry; + + var scale = 30; + var multiplier = 5; // integer, increase for faster visualization + + var steps = 100000; + var current = 1; + var shown = 10000; + + var beta = 8/3; + var rho = 28; + var sigma = 10; + + var dt = .005; + + init(); + animate(); + + function move() { + + geometry.attributes.position.array.copyWithin( 3 ); + geometry.attributes.color.array.copyWithin( 3 ); + + if ( current < steps ) { + + var dx = sigma * ( y - x ) * dt; + var dy = ( x * ( rho - z ) - y ) * dt; + var dz = ( x * y - beta * z ) * dt; + + x += dx; + y += dy; + z += dz; + + geometry.attributes.position.set( [ x, y, z ], 0 ); + + c.setHSL( current / steps, 1, .5 ); + geometry.attributes.color.set( [ c.r, c.g, c.b ], 0 ); + + } + + if ( current < steps + shown ) { + + current ++; + + } else { + + current = 0; + + } + + } + + function init() { + + scene = new THREE.Scene(); + scene.position.set( 0, 0, - 1.5 * scale ); + + camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 0.1, 1000 ); + camera.lookAt( 0, 0, - 1.5 * scale ); + + // + + x = scale / 2 * Math.random(); + y = scale / 2 * Math.random(); + z = scale / 2 * Math.random(); + + c = new THREE.Color(); + + geometry = new THREE.BufferGeometry(); + + var positions = new Float32Array( 3 * shown ); + for ( var i = 0; i < positions.length; i += 3 ) { + + positions.set( [ x, y, z ], i ); + + } + geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) ); + + var colors = new Float32Array( 3 * shown ); + for ( var i = 0; i < positions.length; i += 3 ) { + + colors.set( [ 1, 0, 0 ], i ); + + } + geometry.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ) ); + + var material = new THREE.LineBasicMaterial( { vertexColors: THREE.VertexColors } ); + + var line = new THREE.Line( geometry, material ); + line.frustumCulled = false; // critical to avoid blackouts! + scene.add( line ); + + // + + renderer = new THREE.WebGLRenderer( { antialias: true } ); + renderer.autoClear = false; + renderer.setPixelRatio( window.devicePixelRatio ); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.shadowMap.enabled = true; + renderer.vr.enabled = true; + document.body.appendChild( renderer.domElement ); + + document.body.appendChild( WEBVR.createButton( renderer ) ); + + // + + window.addEventListener( 'resize', onWindowResize, false ); + + } + + function onWindowResize() { + + camera.aspect = window.innerWidth / window.innerHeight; + camera.updateProjectionMatrix(); + + renderer.setSize( window.innerWidth, window.innerHeight ); + + } + + function animate() { + + renderer.animate( render ); + + } + + function render() { + + scene.rotation.z += .001; + + for ( var i = 0; i < multiplier; i ++ ) { + + move(); + + } + + geometry.attributes.position.needsUpdate = true; + geometry.attributes.color.needsUpdate = true; + + renderer.render( scene, camera ); + + } + + </script> + </body> +</html>
false
Other
mrdoob
three.js
71919368f27580a386f2322d8856432bbbf12fe6.json
Add PLYExporter to the pages list
docs/list.js
@@ -373,7 +373,8 @@ var list = { }, "Exporters": { - "GLTFExporter": "examples/exporters/GLTFExporter" + "GLTFExporter": "examples/exporters/GLTFExporter", + "PLYExporter": "examples/exporters/PLYExporter" }, "Plugins": {
false
Other
mrdoob
three.js
40d832de585fe6d12b70ab67e449abd8b43043e8.json
Add screenSpacePanning property
docs/examples/controls/OrbitControls.html
@@ -202,14 +202,6 @@ <h3>[property:Camera object]</h3> The camera being controlled. </div> - <h3>[property:Integer panningMode]</h3> - <div> - Panning mode. Defines how the camera's position is translated when panning. - The options are THREE.ScreenSpacePanning, in which the camera pans in screen space, - and THREE.HorizontalPanning, in which the camera pans in the plane orthogonal to the camera's up direction. - Default is THREE.ScreenSpacePanning. - </div> - <h3>[property:Float panSpeed]</h3> <div> Speed of panning. Default is 1. @@ -225,6 +217,12 @@ <h3>[property:Float rotateSpeed]</h3> Speed of rotation. Default is 1. </div> + <h3>[property:Boolean screenSpacePanning]</h3> + <div> + Defines how the camera's position is translated when panning. If true, the camera pans in screen space. + Otherwise, the camera pans in the plane orthogonal to the camera's up direction. Default is false. + </div> + <h3>[property:Vector3 target0]</h3> <div> Used internally by the [method:saveState] and [method:reset] methods.
false
Other
mrdoob
three.js
949623b530c590223ab35bb83263c35ae4d7c0bf.json
Add webgl2 option to WebGLRenderer
src/renderers/WebGLRenderer.js
@@ -65,7 +65,8 @@ function WebGLRenderer( parameters ) { _antialias = parameters.antialias !== undefined ? parameters.antialias : false, _premultipliedAlpha = parameters.premultipliedAlpha !== undefined ? parameters.premultipliedAlpha : true, _preserveDrawingBuffer = parameters.preserveDrawingBuffer !== undefined ? parameters.preserveDrawingBuffer : false, - _powerPreference = parameters.powerPreference !== undefined ? parameters.powerPreference : 'default'; + _powerPreference = parameters.powerPreference !== undefined ? parameters.powerPreference : 'default', + _webgl2 = parameters.webgl2 !== undefined ? parameters.webgl2 : false; var currentRenderList = null; var currentRenderState = null; @@ -190,11 +191,15 @@ function WebGLRenderer( parameters ) { _canvas.addEventListener( 'webglcontextlost', onContextLost, false ); _canvas.addEventListener( 'webglcontextrestored', onContextRestore, false ); - _gl = _context || _canvas.getContext( 'webgl', contextAttributes ) || _canvas.getContext( 'experimental-webgl', contextAttributes ); + var webglVersion = _webgl2 && typeof WebGL2RenderingContext !== 'undefined' ? 'webgl2' : 'webgl'; + + _gl = _context || _canvas.getContext( webglVersion, contextAttributes ); + + if ( _gl === null && webglVersion === 'webgl' ) _gl = _canvas.getContext( 'experimental-webgl', contextAttributes ); if ( _gl === null ) { - if ( _canvas.getContext( 'webgl' ) !== null ) { + if ( _canvas.getContext( webglVersion ) !== null ) { throw new Error( 'Error creating WebGL context with your selected attributes.' );
false
Other
mrdoob
three.js
c1ff8fcbd2f1d9550239bfa0acc38da8d679fb61.json
Update internalFormat for WebGL2.0
src/renderers/webgl/WebGLTextures.js
@@ -302,7 +302,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, var image = cubeImage[ 0 ], isPowerOfTwoImage = isPowerOfTwo( image ), glFormat = utils.convert( texture.format ), - glType = utils.convert( texture.type ); + glType = utils.convert( texture.type ), + glInternalFormat = getInternalFormat( glFormat, glType ); setTextureParameters( _gl.TEXTURE_CUBE_MAP, texture, isPowerOfTwoImage ); @@ -312,11 +313,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, if ( isDataTexture ) { - state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data ); + state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data ); } else { - state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, glFormat, glType, cubeImage[ i ] ); + state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, glFormat, glType, cubeImage[ i ] ); } @@ -332,7 +333,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, if ( state.getCompressedTextureFormats().indexOf( glFormat ) > - 1 ) { - state.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, mipmap.data ); + state.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data ); } else { @@ -342,7 +343,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } else { - state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); + state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); } @@ -474,9 +475,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, var isPowerOfTwoImage = isPowerOfTwo( image ), glFormat = utils.convert( texture.format ), - glType = utils.convert( texture.type ); - - var internalFormat = getInternalFormat( glFormat, glType ); + glType = utils.convert( texture.type ), + glInternalFormat = getInternalFormat( glFormat, glType ); setTextureParameters( _gl.TEXTURE_2D, texture, isPowerOfTwoImage ); @@ -486,21 +486,21 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, // populate depth texture with dummy data - internalFormat = _gl.DEPTH_COMPONENT; + glInternalFormat = _gl.DEPTH_COMPONENT; if ( texture.type === FloatType ) { if ( ! _isWebGL2 ) throw new Error( 'Float Depth Texture only supported in WebGL2.0' ); - internalFormat = _gl.DEPTH_COMPONENT32F; + glInternalFormat = _gl.DEPTH_COMPONENT32F; } else if ( _isWebGL2 ) { // WebGL 2.0 requires signed internalformat for glTexImage2D - internalFormat = _gl.DEPTH_COMPONENT16; + glInternalFormat = _gl.DEPTH_COMPONENT16; } - if ( texture.format === DepthFormat && internalFormat === _gl.DEPTH_COMPONENT ) { + if ( texture.format === DepthFormat && glInternalFormat === _gl.DEPTH_COMPONENT ) { // The error INVALID_OPERATION is generated by texImage2D if format and internalformat are // DEPTH_COMPONENT and type is not UNSIGNED_SHORT or UNSIGNED_INT @@ -520,7 +520,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, // (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/) if ( texture.format === DepthStencilFormat ) { - internalFormat = _gl.DEPTH_STENCIL; + glInternalFormat = _gl.DEPTH_STENCIL; // The error INVALID_OPERATION is generated by texImage2D if format and internalformat are // DEPTH_STENCIL and type is not UNSIGNED_INT_24_8_WEBGL. @@ -536,7 +536,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } - state.texImage2D( _gl.TEXTURE_2D, 0, internalFormat, image.width, image.height, 0, glFormat, glType, null ); + state.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null ); } else if ( texture.isDataTexture ) { @@ -549,7 +549,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { mipmap = mipmaps[ i ]; - state.texImage2D( _gl.TEXTURE_2D, i, internalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); + state.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); } @@ -558,7 +558,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } else { - state.texImage2D( _gl.TEXTURE_2D, 0, internalFormat, image.width, image.height, 0, glFormat, glType, image.data ); + state.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, image.data ); textureProperties.__maxMipLevel = 0; } @@ -573,7 +573,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, if ( state.getCompressedTextureFormats().indexOf( glFormat ) > - 1 ) { - state.compressedTexImage2D( _gl.TEXTURE_2D, i, internalFormat, mipmap.width, mipmap.height, 0, mipmap.data ); + state.compressedTexImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data ); } else { @@ -583,7 +583,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } else { - state.texImage2D( _gl.TEXTURE_2D, i, internalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); + state.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data ); } @@ -604,7 +604,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, for ( var i = 0, il = mipmaps.length; i < il; i ++ ) { mipmap = mipmaps[ i ]; - state.texImage2D( _gl.TEXTURE_2D, i, internalFormat, glFormat, glType, mipmap ); + state.texImage2D( _gl.TEXTURE_2D, i, glInternalFormat, glFormat, glType, mipmap ); } @@ -613,7 +613,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } else { - state.texImage2D( _gl.TEXTURE_2D, 0, internalFormat, glFormat, glType, image ); + state.texImage2D( _gl.TEXTURE_2D, 0, glInternalFormat, glFormat, glType, image ); textureProperties.__maxMipLevel = 0; }
false
Other
mrdoob
three.js
f02117fe857f8bb5517830a14969ade397494e4a.json
Update WebGLUtils for WebGL 2.0 UNSIGNED_INT_24_8
src/renderers/webgl/WebGLUtils.js
@@ -142,7 +142,7 @@ function WebGLUtils( gl, extensions ) { extension = extensions.get( 'WEBGL_depth_texture' ); - if ( extension !== null ) return extension.UNSIGNED_INT_24_8_WEBGL; + if ( extension !== null ) return isWebGL2 ? extension.UNSIGNED_INT_24_8 : extension.UNSIGNED_INT_24_8_WEBGL; }
false
Other
mrdoob
three.js
6065f4f7db0a744a05ac0dbd45d2511a6b73c6c2.json
Update EXT_blend_minmax handling for WebGL 2.0
src/renderers/webgl/WebGLExtensions.js
@@ -62,7 +62,8 @@ function WebGLExtensions( gl ) { 'OES_element_index_uint', 'OES_standard_derivatives', 'EXT_frag_depth', - 'EXT_shader_texture_lod' ].indexOf( name ) >= 0 ) { + 'EXT_shader_texture_lod', + 'EXT_blend_minmax' ].indexOf( name ) >= 0 ) { extension = gl;
true
Other
mrdoob
three.js
6065f4f7db0a744a05ac0dbd45d2511a6b73c6c2.json
Update EXT_blend_minmax handling for WebGL 2.0
src/renderers/webgl/WebGLUtils.js
@@ -131,8 +131,8 @@ function WebGLUtils( gl, extensions ) { if ( extension !== null ) { - if ( p === MinEquation ) return extension.MIN_EXT; - if ( p === MaxEquation ) return extension.MAX_EXT; + if ( p === MinEquation ) return isWebGL2 ? extension.MIN : extension.MIN_EXT; + if ( p === MaxEquation ) return isWebGL2 ? extension.MAX : extension.MAX_EXT; }
true
Other
mrdoob
three.js
a04bea68f72fc762014ab1c37811c35c6b006e76.json
Ignore EXT_shader_texture_lod for WebGL 2.0
src/renderers/webgl/WebGLExtensions.js
@@ -61,7 +61,8 @@ function WebGLExtensions( gl ) { 'OES_texture_half_float_linear', 'OES_element_index_uint', 'OES_standard_derivatives', - 'EXT_frag_depth' ].indexOf( name ) >= 0 ) { + 'EXT_frag_depth', + 'EXT_shader_texture_lod' ].indexOf( name ) >= 0 ) { extension = gl;
false
Other
mrdoob
three.js
b1f0db4ea9a23fe12375d9058e7ff515df827a14.json
Ignore EXT_frag_depth for WebGL 2.0
src/renderers/webgl/WebGLExtensions.js
@@ -60,7 +60,8 @@ function WebGLExtensions( gl ) { 'OES_texture_half_float', 'OES_texture_half_float_linear', 'OES_element_index_uint', - 'OES_standard_derivatives' ].indexOf( name ) >= 0 ) { + 'OES_standard_derivatives', + 'EXT_frag_depth' ].indexOf( name ) >= 0 ) { extension = gl;
true
Other
mrdoob
three.js
b1f0db4ea9a23fe12375d9058e7ff515df827a14.json
Ignore EXT_frag_depth for WebGL 2.0
src/renderers/webgl/WebGLProgram.js
@@ -85,7 +85,7 @@ function generateExtensions( extensions, parameters, rendererExtensions, isWebGL var chunks = [ ( ! isWebGL2 && ( extensions.derivatives || parameters.envMapCubeUV || parameters.bumpMap || parameters.normalMap || parameters.flatShading ) ) ? '#extension GL_OES_standard_derivatives : enable' : '', - ( extensions.fragDepth || parameters.logarithmicDepthBuffer ) && rendererExtensions.get( 'EXT_frag_depth' ) ? '#extension GL_EXT_frag_depth : enable' : '', + ( ! isWebGL2 && ( extensions.fragDepth || parameters.logarithmicDepthBuffer ) && rendererExtensions.get( 'EXT_frag_depth' ) ) ? '#extension GL_EXT_frag_depth : enable' : '', ( extensions.drawBuffers ) && rendererExtensions.get( 'WEBGL_draw_buffers' ) ? '#extension GL_EXT_draw_buffers : require' : '', ( ! isWebGL2 && ( extensions.shaderTextureLOD || parameters.envMap ) && rendererExtensions.get( 'EXT_shader_texture_lod' ) ) ? '#extension GL_EXT_shader_texture_lod : enable' : '' ]; @@ -532,6 +532,7 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters '#define varying in', 'out highp vec4 pc_fragColor;', '#define gl_FragColor pc_fragColor', + '#define gl_FragDepthEXT gl_FragDepth', '#define texture2D texture', '#define textureCube texture', '#define texture2DProj textureProj',
true
Other
mrdoob
three.js
65931b028c8e3f78d59d0ac71ac79b3b4ae1b9c3.json
add explicit encoding
examples/webgl_materials_equiangular_ibl.html
@@ -107,6 +107,7 @@ texture.minFilter = THREE.NearestFilter; texture.magFilter = THREE.NearestFilter; + texture.encoding = THREE.LinearEncoding; var cubemapGenerator = new THREE.EquiangularToCubeGenerator( texture, 512 ); var cubeMapTexture = cubemapGenerator.generate( renderer ); @@ -123,6 +124,8 @@ new THREE.TextureLoader().load( "textures/equiangular.png", function ( texture ) { + texture.encoding = THREE.sRGBEncoding; + var cubemapGenerator = new THREE.EquiangularToCubeGenerator( texture, 512 ); var cubeMapTexture = cubemapGenerator.generate( renderer );
false
Other
mrdoob
three.js
a67904c008e8f9621bbab41d0e0ad6b02efaf11f.json
remove old code
examples/js/loaders/FBXLoader.js
@@ -1099,13 +1099,6 @@ var normalAttribute = new THREE.Float32BufferAttribute( normalBuffer, 3 ); - // var normalsPreTransform = preTransform.clone().setPosition( new THREE.Vector3() ); - - // // required when preTransform has a non-uniform scale component - // normalsPreTransform.getInverse( normalsPreTransform ).transpose(); - - // normalsPreTransform.applyToBufferAttribute( normalAttribute ); - var normalMatrix = new THREE.Matrix3().getNormalMatrix( preTransform ); normalMatrix.applyToBufferAttribute( normalAttribute );
false
Other
mrdoob
three.js
b6828d60a5e193fe6f791497355dd0861d5ca3a1.json
Fix broken source link.
docs/api/geometries/TextBufferGeometry.html
@@ -155,6 +155,6 @@ <h2>Available Fonts</h2> <h2>Source</h2> - [link:https://github.com/mrdoob/three.js/blob/master/src/TextGeometry.js src/TextGeometry.js] + [link:https://github.com/mrdoob/three.js/blob/master/src/geometries/TextGeometry.js src/geometries/TextGeometry.js] </body> </html>
false
Other
mrdoob
three.js
ede01f5ae754db323ebf65b3f652dbb98678f4dd.json
Fix broken source link.
docs/api/geometries/ExtrudeBufferGeometry.html
@@ -140,6 +140,6 @@ <h3>[method:null addShape]([page:Shape shape], [page:Object options])</h3> <h2>Source</h2> - [link:https://github.com/mrdoob/three.js/blob/master/src/ExtrudeGeometry.js src/ExtrudeGeometry.js] + [link:https://github.com/mrdoob/three.js/blob/master/src/geometries/ExtrudeGeometry.js src/geometries/ExtrudeGeometry.js] </body> </html>
false
Other
mrdoob
three.js
b83aaa8dfba0131901dafa76d0fff367896a5795.json
Fix inconsistent menu order.
docs/list.js
@@ -148,8 +148,8 @@ var list = { "DodecahedronBufferGeometry": "api/geometries/DodecahedronBufferGeometry", "DodecahedronGeometry": "api/geometries/DodecahedronGeometry", "EdgesGeometry": "api/geometries/EdgesGeometry", - "ExtrudeGeometry": "api/geometries/ExtrudeGeometry", "ExtrudeBufferGeometry": "api/geometries/ExtrudeBufferGeometry", + "ExtrudeGeometry": "api/geometries/ExtrudeGeometry", "IcosahedronBufferGeometry": "api/geometries/IcosahedronBufferGeometry", "IcosahedronGeometry": "api/geometries/IcosahedronGeometry", "LatheBufferGeometry": "api/geometries/LatheBufferGeometry",
false
Other
mrdoob
three.js
f3eb51381f115d699344f6cab882805776d31333.json
Replace string literal with string concatenation
editor/js/Menubar.File.js
@@ -295,15 +295,13 @@ Menubar.File = function ( editor ) { if ( config.getKey( 'project/editable' ) ) { - editButton = ` - var button = document.createElement( 'a' ); - button.href = 'https://threejs.org/editor/#file=' + location.href.split( '/' ).slice( 0, - 1 ).join( '/' ) + '/app.json'; - button.style.cssText = 'position: absolute; bottom: 20px; right: 20px; padding: 12px 14px; color: #fff; border: 1px solid #fff; border-radius: 4px; text-decoration: none;'; - button.target = '_blank'; - button.textContent = 'EDIT'; - document.body.appendChild( button ); - `; - + editButton = + "var button = document.createElement( 'a' );" + + "button.href = 'https://threejs.org/editor/#file=' + location.href.split( '/' ).slice( 0, - 1 ).join( '/' ) + '/app.json';" + + "button.style.cssText = 'position: absolute; bottom: 20px; right: 20px; padding: 12px 14px; color: #fff; border: 1px solid #fff; border-radius: 4px; text-decoration: none;';" + + "button.target = '_blank';" + + "button.textContent = 'EDIT';" + + "document.body.appendChild( button );"; } content = content.replace( '/* edit button */', editButton );
false
Other
mrdoob
three.js
0fe617aa4fd0cc8403c14f0aa7d0c52e05ccf5c0.json
Fix protoplanet example https://github.com/mrdoob/three.js/issues/13293
examples/webgl_gpgpu_protoplanet.html
@@ -277,7 +277,7 @@ if ( hash ) hash = parseInt( hash, 0 ); // Texture width for simulation (each texel is a debris particle) - var WIDTH = hash || ( isIE || isEdge ) ? 4 : 64; + var WIDTH = hash || ( ( isIE || isEdge ) ? 4 : 64 ); var container, stats; var camera, scene, renderer, geometry, controls;
false
Other
mrdoob
three.js
599d597a17cba49ce2b99e44a7fbaea90ca0fa4b.json
apply pre transform to normals
examples/js/loaders/FBXLoader.js
@@ -1097,7 +1097,16 @@ if ( normalBuffer.length > 0 ) { - geo.addAttribute( 'normal', new THREE.Float32BufferAttribute( normalBuffer, 3 ) ); + var normalAttribute = new THREE.Float32BufferAttribute( normalBuffer, 3 ); + + var normalsPreTransform = preTransform.clone().setPosition( new THREE.Vector3() ); + + // required when preTransform has a non-uniform scale component + normalsPreTransform.getInverse( normalsPreTransform ).transpose(); + + normalsPreTransform.applyToBufferAttribute( normalAttribute ); + + geo.addAttribute( 'normal', normalAttribute ); }
false
Other
mrdoob
three.js
33bd1a3d29997791a9d4d51870e082135bcbf32b.json
remove unecessary maps_lights_pars in examples
examples/js/ShaderSkin.js
@@ -85,7 +85,6 @@ THREE.ShaderSkin = { THREE.ShaderChunk[ "bsdfs" ], THREE.ShaderChunk[ "packing" ], THREE.ShaderChunk[ "begin_lights_pars" ], - THREE.ShaderChunk[ 'maps_lights_pars' ], THREE.ShaderChunk[ "shadowmap_pars_fragment" ], THREE.ShaderChunk[ "fog_pars_fragment" ], THREE.ShaderChunk[ "bumpmap_pars_fragment" ], @@ -266,7 +265,6 @@ THREE.ShaderSkin = { THREE.ShaderChunk[ "common" ], THREE.ShaderChunk[ "begin_lights_pars" ], - THREE.ShaderChunk[ 'maps_lights_pars' ], THREE.ShaderChunk[ "shadowmap_pars_vertex" ], THREE.ShaderChunk[ "fog_pars_vertex" ], @@ -371,7 +369,6 @@ THREE.ShaderSkin = { THREE.ShaderChunk[ "common" ], THREE.ShaderChunk[ "begin_lights_pars" ], - THREE.ShaderChunk[ 'maps_lights_pars' ], THREE.ShaderChunk[ "fog_pars_fragment" ], "float fresnelReflectance( vec3 H, vec3 V, float F0 ) {",
true
Other
mrdoob
three.js
33bd1a3d29997791a9d4d51870e082135bcbf32b.json
remove unecessary maps_lights_pars in examples
examples/js/ShaderTerrain.js
@@ -88,7 +88,6 @@ THREE.ShaderTerrain = { THREE.ShaderChunk[ "common" ], THREE.ShaderChunk[ "bsdfs" ], THREE.ShaderChunk[ "begin_lights_pars" ], - THREE.ShaderChunk[ 'maps_lights_pars' ], THREE.ShaderChunk[ "shadowmap_pars_fragment" ], THREE.ShaderChunk[ "fog_pars_fragment" ],
true
Other
mrdoob
three.js
33bd1a3d29997791a9d4d51870e082135bcbf32b.json
remove unecessary maps_lights_pars in examples
examples/js/objects/Water.js
@@ -145,7 +145,6 @@ THREE.Water = function ( geometry, options ) { THREE.ShaderChunk[ 'bsdfs' ], THREE.ShaderChunk[ 'fog_pars_fragment' ], THREE.ShaderChunk[ 'begin_lights_pars' ], - THREE.ShaderChunk[ 'maps_lights_pars' ], THREE.ShaderChunk[ 'shadowmap_pars_fragment' ], THREE.ShaderChunk[ 'shadowmask_pars_fragment' ],
true
Other
mrdoob
three.js
a37a63c1aee20228ce34d5d4c318cbeecb592918.json
remove unecessary maps_lights_pars
src/renderers/shaders/ShaderLib/shadow_frag.glsl
@@ -6,7 +6,6 @@ uniform float opacity; #include <fog_pars_fragment> #include <bsdfs> #include <begin_lights_pars> -#include <maps_lights_pars> #include <shadowmap_pars_fragment> #include <shadowmask_pars_fragment>
false
Other
mrdoob
three.js
353697752001a96e14d36c4d0f36d0b99decd03e.json
Fix the wrong link.
docs/manual/en/introduction/Loading-3D-models.html
@@ -97,7 +97,7 @@ <h2>Loading</h2> <p> Currently three.js examples are not available as ES modules (import &hellip; from '&hellip;'). Several workarounds are discussed in - <a href="https://github.com/KhronosGroup/glTF/issues/9562" target="_blank" rel="noopener">#9562</a>. + <a href="https://github.com/mrdoob/three.js/issues/9562" target="_blank" rel="noopener">#9562</a>. </p> <p>
true
Other
mrdoob
three.js
353697752001a96e14d36c4d0f36d0b99decd03e.json
Fix the wrong link.
docs/manual/zh/introduction/Loading-3D-models.html
@@ -86,7 +86,7 @@ <h2>加载</h2> <p> 目前three.js示例不能作为ES modules (import &hellip; from '&hellip;')来使用。 这里讨论了一些解决方法: - <a href="https://github.com/KhronosGroup/glTF/issues/9562" target="_blank" rel="noopener">#9562</a>. + <a href="https://github.com/mrdoob/three.js/issues/9562" target="_blank" rel="noopener">#9562</a>. </p> <p>
true