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
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/js/utils/UVsDebug.js
@@ -115,5 +115,5 @@ THREE.UVsDebug = function( geometry, size ) { return canvas; -} +};
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/js/wip/ProxyGeometry.js
@@ -106,7 +106,7 @@ THREE.ProxyGeometry.prototype.createVertexProxies = function(values) { return this.vertices; -} +}; THREE.ProxyGeometry.prototype.createFaceProxies = function(values) { @@ -214,7 +214,7 @@ THREE.ProxyGeometry.prototype.createFaceProxies = function(values) { return this.faces; -} +}; THREE.ProxyGeometry.prototype.createFaceVertexNormalProxies = function(values) { @@ -263,7 +263,7 @@ THREE.ProxyGeometry.prototype.createFaceVertexNormalProxies = function(values) { } -} +}; THREE.ProxyGeometry.prototype.createFaceVertexColorProxies = function(values) { @@ -321,7 +321,7 @@ THREE.ProxyGeometry.prototype.createFaceVertexColorProxies = function(values) { } -} +}; THREE.ProxyGeometry.prototype.createFaceVertexTangentProxies = function(values) { @@ -365,7 +365,7 @@ THREE.ProxyGeometry.prototype.createFaceVertexTangentProxies = function(values) } -} +}; THREE.ProxyGeometry.prototype.createUvProxies = function(values) { @@ -425,7 +425,7 @@ THREE.ProxyGeometry.prototype.createUvProxies = function(values) { return this.faceVertexUvs; -} +}; THREE.ProxyGeometry.prototype.createSkinIndexProxies = function(values) { @@ -457,7 +457,7 @@ THREE.ProxyGeometry.prototype.createSkinIndexProxies = function(values) { return this.skinIndices; -} +}; THREE.ProxyGeometry.prototype.createSkinWeightProxies = function(values) { @@ -489,7 +489,7 @@ THREE.ProxyGeometry.prototype.createSkinWeightProxies = function(values) { return this.skinWeights; -} +}; THREE.ProxyGeometry.prototype.createColorProxies = function(values) { @@ -521,7 +521,7 @@ THREE.ProxyGeometry.prototype.createColorProxies = function(values) { return this.colors; -} +}; THREE.ProxyGeometry.prototype.populateProxyFromBuffer = function(attr, buffername, proxytype, itemsize, offset, count) { @@ -541,7 +541,7 @@ THREE.ProxyGeometry.prototype.populateProxyFromBuffer = function(attr, buffernam } -} +}; /* * Checks for duplicate vertices with hashmap. @@ -630,7 +630,7 @@ THREE.ProxyGeometry.prototype.mergeVertices = function () { this.vertices = unique; return diff; -} +}; THREE.ProxyGeometry.prototype.onGeometryAllocate = function (ev) { @@ -693,23 +693,23 @@ THREE.ProxyGeometry.prototype.onGeometryAllocate = function (ev) { this.createSkinWeightProxies(this.skinWeights); } -} +}; THREE.ProxyGeometry.prototype.computeFaceNormals = function() { this.dispatchEvent( { type: 'allocate' } ); return THREE.BufferGeometry.prototype.computeFaceNormals.call(this); -} +}; THREE.ProxyGeometry.prototype.computeVertexNormals = function() { this.dispatchEvent( { type: 'allocate' } ); return THREE.BufferGeometry.prototype.computeVertexNormals.call(this); -} +}; THREE.ProxyGeometry.prototype.computeTangents = function() { @@ -722,23 +722,23 @@ THREE.ProxyGeometry.prototype.computeTangents = function() { return ret; -} +}; THREE.ProxyGeometry.prototype.computeBoundingSphere = function() { this.dispatchEvent( { type: 'allocate' } ); return THREE.BufferGeometry.prototype.computeBoundingSphere.call(this); -} +}; THREE.ProxyGeometry.prototype.computeBoundingBox = function () { this.dispatchEvent( { type: 'allocate' } ); return THREE.BufferGeometry.prototype.computeBoundingBox.call(this); -} +}; THREE.ProxyGeometry.prototype.clone = function () { var buff = THREE.BufferGeometry.prototype.clone.call(this); @@ -748,7 +748,7 @@ THREE.ProxyGeometry.prototype.clone = function () { return geo; -} +}; THREE.EventDispatcher.prototype.apply( THREE.ProxyGeometry.prototype );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/js/wip/benchmark/Geometry4.js
@@ -33,7 +33,7 @@ THREE.VectorArrayProxy = function(attribute) { } -} +}; THREE.VectorArrayProxy.prototype.getValue = function(i) { @@ -51,21 +51,21 @@ THREE.VectorArrayProxy.prototype.getValue = function(i) { } -} +}; THREE.VectorArrayProxy.prototype.setValue = function(i, v) { var vec = this[i]; vec.copy(v); -} +}; // Vector Proxy Objects THREE.Vector2Proxy = function(subarray) { this.subarray = subarray; -} +}; THREE.Vector2Proxy.prototype = Object.create( THREE.Vector2.prototype ); THREE.Vector2Proxy.prototype.constructor = THREE.Vector2Proxy; Object.defineProperty(THREE.Vector2Proxy.prototype, 'x', { get: function() { return this.subarray[0]; }, set: function(v) { this.subarray[0] = v; } }); @@ -76,7 +76,7 @@ THREE.Vector3Proxy = function(subarray) { this.subarray = subarray; -} +}; THREE.Vector3Proxy.prototype = Object.create( THREE.Vector3.prototype ); THREE.Vector3Proxy.prototype.constructor = THREE.Vector3Proxy;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/js/wip/benchmark/TypedGeometry.js
@@ -138,7 +138,7 @@ THREE.TypedFace.prototype = { } -} +}; THREE.TypedGeometry = function ( size ) {
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/js/wip/proxies/MultiColor.js
@@ -5,7 +5,7 @@ THREE.MultiColor = function(links) { this.links = links; -} +}; THREE.MultiColor.prototype = Object.create( THREE.Color.prototype ); THREE.MultiColor.prototype.constructor = THREE.MultiColor; @@ -18,7 +18,7 @@ THREE.MultiColor.prototype.setAll = function(axis, value) { } -} +}; // Getters return value from the first linked color // Setters set the same value for all linked colors
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/js/wip/proxies/MultiVector3.js
@@ -5,7 +5,7 @@ THREE.MultiVector3 = function(links) { this.links = links; -} +}; THREE.MultiVector3.prototype = Object.create( THREE.Vector3.prototype ); THREE.MultiVector3.prototype.constructor = THREE.MultiVector3; @@ -18,7 +18,7 @@ THREE.MultiVector3.prototype.setAll = function(axis, value) { } -} +}; // Getters return value from the first linked vector // Setters set the same value for all linked vectors
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/js/wip/proxies/ProxyColor.js
@@ -8,7 +8,7 @@ THREE.ProxyColor = function ( array, offset ) { this.array = array; this.offset = offset; -} +}; THREE.ProxyColor.prototype = Object.create( THREE.Color.prototype ); THREE.ProxyColor.prototype.constructor = THREE.ProxyColor;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/js/wip/proxies/ProxyFace3.js
@@ -15,7 +15,7 @@ THREE.ProxyFace3 = function ( array, offset, vertexNormals, vertexColors, vertex //THREE.Face3.call( this, array[offset], array[offset+1], array[offset+2] /*, normal, color, materialIndex */); -} +}; THREE.ProxyFace3.prototype = Object.create( THREE.Face3.prototype ); THREE.ProxyFace3.prototype.constructor = THREE.ProxyFace3;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/misc_animation_keys.html
@@ -82,7 +82,7 @@ renderer.setSize( window.innerWidth, window.innerHeight ); - } + }; var createScene = function(){
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/misc_controls_deviceorientation.html
@@ -41,7 +41,7 @@ <script> (function() { - "use strict" + "use strict"; window.addEventListener('load', function() {
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/misc_controls_pointerlock.html
@@ -113,13 +113,13 @@ } - } + }; var pointerlockerror = function ( event ) { instructions.style.display = ''; - } + }; // Hook pointer lock state change events document.addEventListener( 'pointerlockchange', pointerlockchange, false ); @@ -149,7 +149,7 @@ element.requestPointerLock(); } - } + }; document.addEventListener( 'fullscreenchange', fullscreenchange, false ); document.addEventListener( 'mozfullscreenchange', fullscreenchange, false );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/misc_fps.html
@@ -70,7 +70,7 @@ keysPressed[watchedKeyCodes[index]] = down; e.preventDefault(); } }; - } + }; window.addEventListener( "keydown", handler( true ), false ); window.addEventListener( "keyup", handler( false ), false ); })([
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/misc_sound.html
@@ -122,7 +122,7 @@ var helper = new THREE.GridHelper( 500, 10 ); helper.color1.setHex( 0x444444 ); helper.color2.setHex( 0x444444 ); - helper.position.y = 0.1 + helper.position.y = 0.1; scene.add( helper ); //
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/raytracing_sandbox.html
@@ -209,14 +209,14 @@ plane = new THREE.Mesh( planeGeometry, phongMaterialBoxLeft ); plane.rotation.z = 1.57; - plane.position.set( -300, 0, -300 ) + plane.position.set( -300, 0, -300 ); scene.add( plane ); // right plane = new THREE.Mesh( planeGeometry, phongMaterialBoxRight ); plane.rotation.z = 1.57; - plane.position.set( 300, 0, -300 ) + plane.position.set( 300, 0, -300 ); scene.add( plane ); // light
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_buffergeometry_drawcalls.html
@@ -64,7 +64,7 @@ limitConnections: false, maxConnections: 20, particleCount: 500 - } + }; init(); animate();
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_effects_parallaxbarrier.html
@@ -277,7 +277,7 @@ "Darkgray shiny": new THREE.MeshPhongMaterial( { color: 0x000000, specular: 0x050505 } ), "Gray shiny": new THREE.MeshPhongMaterial( { color: 0x050505, shininess: 20 } ) - } + }; // Gallardo materials @@ -303,7 +303,7 @@ ] - } + }; m = CARS[ "gallardo" ].materials; mi = CARS[ "gallardo" ].init_material; @@ -318,7 +318,7 @@ 5: mlib[ "Yellow glass" ], // front lights 6: mlib[ "Dark chrome" ] // windshield rim - } + }; // Veyron materials @@ -338,7 +338,7 @@ ], - } + }; m = CARS[ "veyron" ].materials; mi = CARS[ "veyron" ].init_material; @@ -354,7 +354,7 @@ 6: mlib[ "Red glass 50" ], // backlights 7: mlib[ "Orange glass 50" ] // backsignals - } + }; // F50 materials @@ -379,7 +379,7 @@ ], - } + }; m = CARS[ "f50" ].materials; mi = CARS[ "f50" ].init_material; @@ -412,7 +412,7 @@ 23: m.body[ mi ][ 1 ], // back torso 24: m.body[ mi ][ 1 ] // back torso center - } + }; // Camero materials @@ -439,7 +439,7 @@ ], - } + }; m = CARS[ "camaro" ].materials; mi = CARS[ "camaro" ].init_material; @@ -456,7 +456,7 @@ 7: mlib[ "Fullblack rough" ], // tireling 8: mlib[ "Fullblack rough" ] // behind grille - } + }; loader.load( CARS[ "veyron" ].url, function( geometry ) { createScene( geometry, "veyron" ) } );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_geometry_dynamic.html
@@ -80,7 +80,7 @@ controls = new THREE.FirstPersonControls( camera ); controls.movementSpeed = 500; - controls.lookSpeed = 0.1 + controls.lookSpeed = 0.1; scene = new THREE.Scene(); scene.fog = new THREE.FogExp2( 0xaaccff, 0.0007 );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_geometry_normals.html
@@ -36,7 +36,7 @@ return klass.apply( this, args ); - } + }; F.prototype = klass.prototype;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_gpgpu_birds.html
@@ -453,7 +453,7 @@ this.applyMatrix( new THREE.Matrix4().makeScale( 0.2, 0.2, 0.2 ) ); - } + }; THREE.BirdGeometry.prototype = Object.create( THREE.BufferGeometry.prototype ); @@ -662,7 +662,7 @@ function render() { - var now = performance.now() + var now = performance.now(); var delta = (now - last) / 1000; if (delta > 1) delta = 1; // safety cap on large deltas
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_interactive_particles.html
@@ -158,7 +158,7 @@ // raycaster = new THREE.Raycaster(); - mouse = new THREE.Vector2() + mouse = new THREE.Vector2(); //
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_lensflares.html
@@ -78,7 +78,7 @@ controls.domElement = container; controls.rollSpeed = Math.PI / 6; controls.autoForward = false; - controls.dragToLook = false + controls.dragToLook = false; // scene
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_lights_hemisphere.html
@@ -184,7 +184,7 @@ bottomColor: { type: "c", value: new THREE.Color( 0xffffff ) }, offset: { type: "f", value: 33 }, exponent: { type: "f", value: 0.6 } - } + }; uniforms.topColor.value.copy( hemiLight.color ); scene.fog.color.copy( uniforms.bottomColor.value );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_loader_awd.html
@@ -139,7 +139,7 @@ var timer = Date.now() * 0.0005; pointLight.position.x = Math.sin( timer * 4 ) * 3000; - pointLight.position.y = 600 + pointLight.position.y = 600; pointLight.position.z = Math.cos( timer * 4 ) * 3000; renderer.render( scene, camera );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_loader_collada_kinematics.html
@@ -151,17 +151,17 @@ var duration = getRandomInt(1000, 5000); - var target = {} + var target = {}; for ( var i = 0; i < kinematics.joints.length; i++ ) { var joint = kinematics.joints[ i ]; var old = tweenParameters[ i ]; - var position = old ? old : joint.zeroPosition + var position = old ? old : joint.zeroPosition; - tweenParameters[ i ] = position + tweenParameters[ i ] = position; target[ i ] = getRandomInt(joint.limits.min, joint.limits.max) @@ -177,7 +177,7 @@ } - } ) + } ); kinematicsTween.start();
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_loader_ply.html
@@ -146,7 +146,7 @@ function addShadowedLight( x, y, z, color, intensity ) { var directionalLight = new THREE.DirectionalLight( color, intensity ); - directionalLight.position.set( x, y, z ) + directionalLight.position.set( x, y, z ); scene.add( directionalLight ); directionalLight.castShadow = true;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_loader_scene.html
@@ -187,7 +187,7 @@ $( "bar" ).style.width = bar + "px"; - } + }; var callbackFinished = function ( result ) { @@ -233,7 +233,7 @@ scene = loaded.scene; - } + }; $( "progress" ).style.display = "block";
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_loader_stl.html
@@ -201,7 +201,7 @@ function addShadowedLight( x, y, z, color, intensity ) { var directionalLight = new THREE.DirectionalLight( color, intensity ); - directionalLight.position.set( x, y, z ) + directionalLight.position.set( x, y, z ); scene.add( directionalLight ); directionalLight.castShadow = true;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_materials_bumpmap.html
@@ -165,7 +165,7 @@ mapHeight.anisotropy = 4; mapHeight.repeat.set( 0.998, 0.998 ); - mapHeight.offset.set( 0.001, 0.001 ) + mapHeight.offset.set( 0.001, 0.001 ); mapHeight.wrapS = mapHeight.wrapT = THREE.RepeatWrapping; mapHeight.format = THREE.RGBFormat;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_materials_bumpmap_skin.html
@@ -236,23 +236,23 @@ mapHeight.anisotropy = 4; mapHeight.repeat.set( 0.998, 0.998 ); - mapHeight.offset.set( 0.001, 0.001 ) + mapHeight.offset.set( 0.001, 0.001 ); mapHeight.wrapS = mapHeight.wrapT = THREE.RepeatWrapping; mapHeight.format = THREE.RGBFormat; var mapSpecular = THREE.ImageUtils.loadTexture( "obj/leeperrysmith/Map-SPEC.jpg" ); mapSpecular.anisotropy = 4; mapSpecular.repeat.set( 0.998, 0.998 ); - mapSpecular.offset.set( 0.001, 0.001 ) + mapSpecular.offset.set( 0.001, 0.001 ); mapSpecular.wrapS = mapSpecular.wrapT = THREE.RepeatWrapping; mapSpecular.format = THREE.RGBFormat; var mapColor = THREE.ImageUtils.loadTexture( "obj/leeperrysmith/Map-COL.jpg" ); mapColor.anisotropy = 4; mapColor.repeat.set( 0.998, 0.998 ); - mapColor.offset.set( 0.001, 0.001 ) + mapColor.offset.set( 0.001, 0.001 ); mapColor.wrapS = mapColor.wrapT = THREE.RepeatWrapping; mapColor.format = THREE.RGBFormat;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_materials_cars.html
@@ -282,7 +282,7 @@ "Darkgray shiny": new THREE.MeshPhongMaterial( { color: 0x000000, specular: 0x050505 } ), "Gray shiny": new THREE.MeshPhongMaterial( { color: 0x050505, shininess: 20 } ) - } + }; // Gallardo materials @@ -308,7 +308,7 @@ ] - } + }; m = CARS[ "gallardo" ].materials; mi = CARS[ "gallardo" ].init_material; @@ -323,7 +323,7 @@ 5: mlib[ "Yellow glass" ], // front lights 6: mlib[ "Dark chrome" ] // windshield rim - } + }; // Veyron materials @@ -343,7 +343,7 @@ ], - } + }; m = CARS[ "veyron" ].materials; mi = CARS[ "veyron" ].init_material; @@ -359,7 +359,7 @@ 6: mlib[ "Red glass 50" ], // backlights 7: mlib[ "Orange glass 50" ] // backsignals - } + }; // F50 materials @@ -384,7 +384,7 @@ ], - } + }; m = CARS[ "f50" ].materials; mi = CARS[ "f50" ].init_material; @@ -417,7 +417,7 @@ 23: m.body[ mi ][ 1 ], // back torso 24: m.body[ mi ][ 1 ] // back torso center - } + }; // Camero materials @@ -444,7 +444,7 @@ ], - } + }; m = CARS[ "camaro" ].materials; mi = CARS[ "camaro" ].init_material; @@ -461,7 +461,7 @@ 7: mlib[ "Fullblack rough" ], // tireling 8: mlib[ "Fullblack rough" ] // behind grille - } + }; loader.load( CARS[ "veyron" ].url, function( geometry ) { createScene( geometry, "veyron" ) } );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_materials_cubemap.html
@@ -114,7 +114,7 @@ //var cubeMaterial3 = new THREE.MeshPhongMaterial( { color: 0x000000, specular:0xaa0000, envMap: reflectionCube, combine: THREE.MixOperation, reflectivity: 0.25 } ); var cubeMaterial3 = new THREE.MeshLambertMaterial( { color: 0xff6600, envMap: reflectionCube, combine: THREE.MixOperation, reflectivity: 0.3 } ); var cubeMaterial2 = new THREE.MeshLambertMaterial( { color: 0xffee00, envMap: refractionCube, refractionRatio: 0.95 } ); - var cubeMaterial1 = new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: reflectionCube } ) + var cubeMaterial1 = new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: reflectionCube } ); // Skybox
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_materials_cubemap_dynamic.html
@@ -228,7 +228,7 @@ "Black metal": new THREE.MeshLambertMaterial( { color: 0x222222, envMap: cubeTarget, combine: THREE.MultiplyOperation } ), "Orange metal": new THREE.MeshLambertMaterial( { color: 0xff6600, envMap: cubeTarget, combine: THREE.MultiplyOperation } ) - } + }; mlib.body.push( [ "Orange", new THREE.MeshLambertMaterial( { color: 0x883300, envMap: cubeTarget, combine: THREE.MixOperation, reflectivity: 0.1 } ) ] ); mlib.body.push( [ "Blue", new THREE.MeshLambertMaterial( { color: 0x113355, envMap: cubeTarget, combine: THREE.MixOperation, reflectivity: 0.1 } ) ] );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_materials_cubemap_escher.html
@@ -90,7 +90,7 @@ var loader = new THREE.DDSLoader(); var textureCube = loader.load( urls ); - var material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } ) + var material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } ); var geometry = new THREE.SphereGeometry( 100, 96, 64 ); var mesh = new THREE.Mesh( geometry, material );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_materials_cubemap_refraction.html
@@ -107,7 +107,7 @@ var cubeMaterial3 = new THREE.MeshBasicMaterial( { color: 0xccddff, envMap: textureCube, refractionRatio: 0.98, reflectivity:0.9 } ); var cubeMaterial2 = new THREE.MeshBasicMaterial( { color: 0xccfffd, envMap: textureCube, refractionRatio: 0.985 } ); - var cubeMaterial1 = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube, refractionRatio: 0.98 } ) + var cubeMaterial1 = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube, refractionRatio: 0.98 } ); // Skybox
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_materials_lightmap.html
@@ -114,7 +114,7 @@ bottomColor: { type: "c", value: new THREE.Color( 0xffffff ) }, offset: { type: "f", value: 400 }, exponent: { type: "f", value: 0.6 } - } + }; uniforms.topColor.value.copy( hemiLight.color ); scene.fog.color.copy( uniforms.bottomColor.value );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_materials_texture_compressed.html
@@ -93,7 +93,7 @@ map6.anisotropy = 4; var cubemap1 = loader.load( 'textures/compressed/Mountains.dds', function ( texture ) { - texture.magFilter = THREE.LinearFilter + texture.magFilter = THREE.LinearFilter; texture.minFilter = THREE.LinearFilter; texture.mapping = THREE.CubeReflectionMapping; material1.needsUpdate = true;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_materials_texture_pvrtc.html
@@ -155,7 +155,7 @@ scene.add( mesh ); meshes.push( mesh ); - var torus = new THREE.TorusGeometry( 100, 50, 32, 24 ) + var torus = new THREE.TorusGeometry( 100, 50, 32, 24 ); mesh = new THREE.Mesh( torus, material6 ); mesh.position.x = 166;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_modifier_subdivision.html
@@ -38,7 +38,7 @@ return klass.apply( this, args ); - } + }; F.prototype = klass.prototype; @@ -242,7 +242,7 @@ scene.add( group ); var material = new THREE.MeshBasicMaterial( { color: 0xfefefe, wireframe: true, opacity: 0.5 } ); - var mesh = new THREE.Mesh( geometry, material ) + var mesh = new THREE.Mesh( geometry, material ); group.add( mesh ); var meshmaterials = [
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_morphtargets_human.html
@@ -114,7 +114,7 @@ setupMorphsGUI(); gui.width = 300; gui.open(); - } + }; var loader = new THREE.XHRLoader(); loader.load("models/skinned/UCS_config.json", function ( text ) { @@ -146,7 +146,7 @@ return function () { character.setSkin( index ); }; - } + }; for ( var i = 0; i < character.numSkins; i++ ) { var name = character.skins[ i ].name; @@ -172,7 +172,7 @@ return function () { character.updateMorphs( morphConfig ); } - } + }; for ( var i = 0; i < character.numMorphs; i ++ ) { var morphName = character.morphs[ i ];
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_morphtargets_md2.html
@@ -210,7 +210,7 @@ setupWeaponsGUI( character ); setupGUIAnimations( character ); - } + }; character.loadParts( config ); @@ -259,7 +259,7 @@ return function () { character.setWeapon( index ); }; - } + }; var guiItems = []; @@ -284,7 +284,7 @@ return function () { character.setSkin( index ); }; - } + }; var guiItems = []; @@ -309,7 +309,7 @@ return function () { character.setAnimation( animationName ); }; - } + }; var i = 0, guiItems = []; var animations = character.meshBody.geometry.animations;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_nearestneighbour.html
@@ -76,7 +76,7 @@ var objects = []; var amountOfParticles = 500000, maxDistance = Math.pow(120, 2); - var positions, alphas, particles, _particleGeom + var positions, alphas, particles, _particleGeom; var clock = new THREE.Clock(); @@ -188,7 +188,7 @@ // displayNearest(camera.position); - controls.update( clock.getDelta() ) + controls.update( clock.getDelta() ); renderer.render( scene, camera );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_objects_update.html
@@ -64,17 +64,17 @@ object = createObject( createMeshFaceMaterial(), 4 ); object.position.set( -400, 0, 200 ); scene.add( object ); - objectNewGeometry = object + objectNewGeometry = object; object = createObject( createMeshFaceMaterial(), 4 ); object.position.set( -200, 0, 200 ); scene.add( object ); - objectToggleAddRemove = object + objectToggleAddRemove = object; object = createObject( createMeshFaceMaterial(), 4 ); object.position.set( 0, 0, 200 ); scene.add( object ); - objectRandomizeFaces = object + objectRandomizeFaces = object; /* These are not yet used but they are ready to be shown object = createObject( createMeshFaceMaterial(), 4 ); @@ -130,20 +130,20 @@ } function createGeometry(segments){ var matrix = new THREE.Matrix4(); - var euler = new THREE.Euler() + var euler = new THREE.Euler(); var geometry = new THREE.BoxGeometry( 100, 100, 100, segments, segments, segments ); - geometry.applyMatrix(matrix.makeRotationFromEuler(euler.set(parseInt(Math.random()*2,10)*Math.PI,parseInt(Math.random()*2,10)*Math.PI,parseInt(Math.random()*2,10)*Math.PI))) + geometry.applyMatrix(matrix.makeRotationFromEuler(euler.set(parseInt(Math.random()*2,10)*Math.PI,parseInt(Math.random()*2,10)*Math.PI,parseInt(Math.random()*2,10)*Math.PI))); return geometry; } function createMeshFaceMaterial(){ var materials = []; - materials.push(new THREE.MeshBasicMaterial({color: 0xff0000})) - materials.push(new THREE.MeshBasicMaterial({color: 0xffff00})) - materials.push(new THREE.MeshBasicMaterial({color: 0x00ff00})) - materials.push(new THREE.MeshBasicMaterial({color: 0x00ffff})) - materials.push(new THREE.MeshBasicMaterial({color: 0x0000ff})) - materials.push(new THREE.MeshBasicMaterial({color: 0xff00ff})) + materials.push(new THREE.MeshBasicMaterial({color: 0xff0000})); + materials.push(new THREE.MeshBasicMaterial({color: 0xffff00})); + materials.push(new THREE.MeshBasicMaterial({color: 0x00ff00})); + materials.push(new THREE.MeshBasicMaterial({color: 0x00ffff})); + materials.push(new THREE.MeshBasicMaterial({color: 0x0000ff})); + materials.push(new THREE.MeshBasicMaterial({color: 0xff00ff})); var material = new THREE.MeshFaceMaterial(materials); return material; }
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_octree_raycasting.html
@@ -196,7 +196,7 @@ checkbox.id = "octreeToggle"; checkbox.checked = true; - var label = document.createElement('label') + var label = document.createElement('label'); label.htmlFor = "octreeToggle"; label.appendChild(document.createTextNode('Use Octree') );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_particles_shapes.html
@@ -229,7 +229,7 @@ } - console.log( "pool ran out!" ) + console.log( "pool ran out!" ); return null; },
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_postprocessing_dof2.html
@@ -342,7 +342,7 @@ gui.add( effectController, "bias", 0,3, 0.001 ).onChange( matChanger ); gui.add( effectController, "fringe", 0, 5, 0.001 ).onChange( matChanger ); - gui.add( effectController, "focalLength", 16, 80, 0.001 ).onChange( matChanger ) + gui.add( effectController, "focalLength", 16, 80, 0.001 ).onChange( matChanger ); gui.add( effectController, "noise" ).onChange( matChanger );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_sandbox.html
@@ -79,7 +79,7 @@ var texture1 = new THREE.Texture( generateTexture( 0, 0.5, 1 ), THREE.UVMapping ); var texture2 = new THREE.Texture( generateTexture( 0, 1, 0 ), THREE.SphericalReflectionMapping ); - var texture3 = THREE.ImageUtils.loadTexture( 'textures/land_ocean_ice_cloud_2048.jpg' ) + var texture3 = THREE.ImageUtils.loadTexture( 'textures/land_ocean_ice_cloud_2048.jpg' ); texture1.needsUpdate = true; texture2.needsUpdate = true;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_shaders_ocean.html
@@ -61,7 +61,7 @@ depth: 1500, param: 4, filterparam: 1 - } + }; var waterNormals;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_shaders_sky.html
@@ -92,7 +92,7 @@ inclination: 0.49, // elevation / inclination azimuth: 0.25, // Facing front, sun: !true - } + }; var distance = 400000;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgl_test_memory.html
@@ -77,7 +77,7 @@ var texture = new THREE.Texture( createImage() ); texture.needsUpdate = true; - var material = new THREE.MeshBasicMaterial( { map: texture, wireframe: true } ) + var material = new THREE.MeshBasicMaterial( { map: texture, wireframe: true } ); var mesh = new THREE.Mesh( geometry, material );
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
examples/webgldeferred_pointlights.html
@@ -226,7 +226,7 @@ var mapColor = THREE.ImageUtils.loadTexture( "obj/leeperrysmith/Map-COL.jpg" ); var mapHeight = THREE.ImageUtils.loadTexture( "obj/leeperrysmith/Infinite-Level_02_Disp_NoSmoothUV-4096.jpg" ); mapHeight.repeat.set( 0.998, 0.998 ); - mapHeight.offset.set( 0.001, 0.001 ) + mapHeight.offset.set( 0.001, 0.001 ); mapHeight.wrapS = mapHeight.wrapT = THREE.RepeatWrapping; mapHeight.anisotropy = 4; mapHeight.format = THREE.RGBFormat;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/Three.js
@@ -28,9 +28,9 @@ if ( Math.sign === undefined ) { // set the default log handlers -THREE.log = function() { console.log.apply( console, arguments ); } -THREE.warn = function() { console.warn.apply( console, arguments ); } -THREE.error = function() { console.error.apply( console, arguments ); } +THREE.log = function() { console.log.apply( console, arguments ); }; +THREE.warn = function() { console.warn.apply( console, arguments ); }; +THREE.error = function() { console.error.apply( console, arguments ); }; // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/cameras/PerspectiveCamera.js
@@ -38,7 +38,7 @@ THREE.PerspectiveCamera.prototype.setLens = function ( focalLength, frameHeight this.fov = 2 * THREE.Math.radToDeg( Math.atan( frameHeight / ( focalLength * 2 ) ) ); this.updateProjectionMatrix(); -} +}; /**
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/core/BufferGeometry.js
@@ -252,7 +252,7 @@ THREE.BufferGeometry.prototype = { } - this.computeBoundingSphere() + this.computeBoundingSphere(); return this; @@ -884,7 +884,7 @@ THREE.BufferGeometry.prototype = { version: 4.4, type: 'BufferGeometry', generator: 'BufferGeometry.toJSON' - } + }; // standard BufferGeometry serialization
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/core/EventDispatcher.js
@@ -2,7 +2,7 @@ * https://github.com/mrdoob/eventdispatcher.js/ */ -THREE.EventDispatcher = function () {} +THREE.EventDispatcher = function () {}; THREE.EventDispatcher.prototype = {
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/core/Face4.js
@@ -4,7 +4,7 @@ THREE.Face4 = function ( a, b, c, d, normal, color, materialIndex ) { - THREE.warn( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.' ) + THREE.warn( 'THREE.Face4 has been removed. A THREE.Face3 will be created instead.' ); return new THREE.Face3( a, b, c, normal, color, materialIndex ); };
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/core/Object3D.js
@@ -584,7 +584,7 @@ THREE.Object3D.prototype = { meta = { geometries: {}, materials: {} - } + }; // add metadata metadata = {
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/extras/FontUtils.js
@@ -430,8 +430,8 @@ THREE.FontUtils.generateShapes = function ( text, parameters ) { for ( p = 0; p < n; p ++ ) { - px = contour[ verts[ p ] ].x - py = contour[ verts[ p ] ].y + px = contour[ verts[ p ] ].x; + py = contour[ verts[ p ] ].y; if ( ( ( px === ax ) && ( py === ay ) ) || ( ( px === bx ) && ( py === by ) ) ||
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/extras/ImageUtils.js
@@ -67,7 +67,7 @@ THREE.ImageUtils = { }, undefined, onError ); - } + }; for ( var i = 0, il = array.length; i < il; ++ i ) { @@ -99,20 +99,20 @@ THREE.ImageUtils = { return [ a[ 1 ] * b[ 2 ] - a[ 2 ] * b[ 1 ], a[ 2 ] * b[ 0 ] - a[ 0 ] * b[ 2 ], a[ 0 ] * b[ 1 ] - a[ 1 ] * b[ 0 ] ]; - } + }; var subtract = function ( a, b ) { return [ a[ 0 ] - b[ 0 ], a[ 1 ] - b[ 1 ], a[ 2 ] - b[ 2 ] ]; - } + }; var normalize = function ( a ) { var l = Math.sqrt( a[ 0 ] * a[ 0 ] + a[ 1 ] * a[ 1 ] + a[ 2 ] * a[ 2 ] ); return [ a[ 0 ] / l, a[ 1 ] / l, a[ 2 ] / l ]; - } + }; depth = depth | 1;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/extras/curves/SplineCurve.js
@@ -19,10 +19,10 @@ THREE.SplineCurve.prototype.getPoint = function ( t ) { var intPoint = Math.floor( point ); var weight = point - intPoint; - var point0 = points[ intPoint == 0 ? intPoint : intPoint - 1 ] - var point1 = points[ intPoint ] - var point2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ] - var point3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ] + var point0 = points[ intPoint == 0 ? intPoint : intPoint - 1 ]; + var point1 = points[ intPoint ]; + var point2 = points[ intPoint > points.length - 2 ? points.length - 1 : intPoint + 1 ]; + var point3 = points[ intPoint > points.length - 3 ? points.length - 1 : intPoint + 2 ]; var vector = new THREE.Vector2();
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/extras/geometries/ExtrudeGeometry.js
@@ -234,7 +234,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function ( shape, options ) { // Don't normalize!, otherwise sharp corners become ugly // but prevent crazy spikes - var v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y ) + var v_trans_lensq = ( v_trans_x * v_trans_x + v_trans_y * v_trans_y ); if ( v_trans_lensq <= 2 ) { return new THREE.Vector2( v_trans_x, v_trans_y ); } else {
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/extras/helpers/GridHelper.js
@@ -37,4 +37,4 @@ THREE.GridHelper.prototype.setColors = function( colorCenterLine, colorGrid ) { this.geometry.colorsNeedUpdate = true; -} +};
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/loaders/ImageLoader.js
@@ -73,4 +73,4 @@ THREE.ImageLoader.prototype = { } -} +};
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/loaders/JSONLoader.js
@@ -240,7 +240,7 @@ THREE.JSONLoader.prototype.parse = function ( json, texturePath ) { uvLayer = json.uvs[ i ]; geometry.faceVertexUvs[ i ][ fi ] = []; - geometry.faceVertexUvs[ i ][ fi + 1 ] = [] + geometry.faceVertexUvs[ i ][ fi + 1 ] = []; for ( j = 0; j < 4; j ++ ) {
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/loaders/Loader.js
@@ -181,7 +181,7 @@ THREE.Loader.prototype = { var wrapMap = { 'repeat': THREE.RepeatWrapping, 'mirror': THREE.MirroredRepeatWrapping - } + }; if ( wrapMap[ wrap[ 0 ] ] !== undefined ) texture.wrapS = wrapMap[ wrap[ 0 ] ]; if ( wrapMap[ wrap[ 1 ] ] !== undefined ) texture.wrapT = wrapMap[ wrap[ 1 ] ];
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/materials/Material.js
@@ -117,7 +117,7 @@ THREE.Material.prototype = { version: 4.4, type: 'Material', generator: 'Material.toJSON' - } + }; // standard Material serialization data.type = this.type;
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/math/Quaternion.js
@@ -519,4 +519,4 @@ THREE.Quaternion.slerp = function ( qa, qb, qm, t ) { return qm.copy( qa ).slerp( qb, t ); -} +};
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/renderers/webgl/WebGLBuffers.js
@@ -432,7 +432,7 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) { } - } + }; this.setLineBuffers = function ( geometry, hint ) { @@ -604,7 +604,7 @@ THREE.WebGLBuffers = function ( gl, info, extensions, getBufferMaterial ) { } - } + }; function materialNeedsFaceNormals ( material ) {
true
Other
mrdoob
three.js
eb68622a6e8431450c40361cccd0061514d2f711.json
Add missing semicolons
src/renderers/webgl/plugins/LensFlarePlugin.js
@@ -250,7 +250,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) { attributes = { vertex: gl.getAttribLocation ( program, "position" ), uv: gl.getAttribLocation ( program, "uv" ) - } + }; uniforms = { renderType: gl.getUniformLocation( program, "renderType" ), @@ -329,7 +329,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) { // setup arrays for gl programs - screenPosition.copy( tempPosition ) + screenPosition.copy( tempPosition ); screenPositionPixels.x = screenPosition.x * halfViewportWidth + halfViewportWidth; screenPositionPixels.y = screenPosition.y * halfViewportHeight + halfViewportHeight; @@ -380,7 +380,7 @@ THREE.LensFlarePlugin = function ( renderer, flares ) { // update object positions - flare.positionScreen.copy( screenPosition ) + flare.positionScreen.copy( screenPosition ); if ( flare.customUpdateCallback ) {
true
Other
mrdoob
three.js
6a9b1ec65745d1bc10f9b89b5b4612fae92561b2.json
Allow multiple sensors, exclude phantom Carboard
examples/js/controls/VRControls.js
@@ -9,18 +9,46 @@ THREE.VRControls = function ( object, onError ) { var vrInputs = []; + function filterInvalidDevices( devices ) { + + var + OculusDeviceId = 'HMDInfo-dev-0x421e7eb800', + CardboardDeviceId = 'HMDInfo-dev-0x421e7ecc00'; + + + // Exclude Cardboard position sensor if Oculus exists. + var oculusDevices = devices.filter( function ( device ) { + + return device.deviceId === OculusDeviceId; + + } ); + + if ( oculusDevices.length >= 1 ) { + + return devices.filter( function ( device ) { + + return device.deviceId !== CardboardDeviceId; + + } ); + + } else { + + return devices; + + } + + } + function gotVRDevices( devices ) { - for ( var i = 0; i < devices.length; i ++ ) { + devices = filterInvalidDevices( devices ); - var device = devices[ i ]; + for ( var i = 0; i < devices.length; i ++ ) { - if ( device instanceof PositionSensorVRDevice ) { + if ( devices[ i ] instanceof PositionSensorVRDevice ) { vrInputs.push( devices[ i ] ); - break; // We keep the first we encounter - } }
false
Other
mrdoob
three.js
f507558bf30d38cf179ceca1eee92505ca0cf5e7.json
Add depth function to materials Fixes #6266
src/Three.js
@@ -115,6 +115,17 @@ THREE.DstColorFactor = 208; THREE.OneMinusDstColorFactor = 209; THREE.SrcAlphaSaturateFactor = 210; +// depth modes + +THREE.NeverDepth = 0; +THREE.AlwaysDepth = 1; +THREE.LessDepth = 2; +THREE.LessEqualDepth = 3; +THREE.EqualDepth = 4; +THREE.GreaterEqualDepth = 5; +THREE.GreaterDepth = 6; +THREE.NotEqualDepth = 7; + // TEXTURE CONSTANTS
true
Other
mrdoob
three.js
f507558bf30d38cf179ceca1eee92505ca0cf5e7.json
Add depth function to materials Fixes #6266
src/materials/Material.js
@@ -26,6 +26,7 @@ THREE.Material = function () { this.blendDstAlpha = null; this.blendEquationAlpha = null; + this.depthFunc = THREE.LessEqualDepth; this.depthTest = true; this.depthWrite = true; @@ -152,6 +153,7 @@ THREE.Material.prototype = { material.blendDstAlpha = this.blendDstAlpha; material.blendEquationAlpha = this.blendEquationAlpha; + material.depthFunc = this.depthFunc; material.depthTest = this.depthTest; material.depthWrite = this.depthWrite;
true
Other
mrdoob
three.js
f507558bf30d38cf179ceca1eee92505ca0cf5e7.json
Add depth function to materials Fixes #6266
src/renderers/WebGLRenderer.js
@@ -2464,6 +2464,7 @@ THREE.WebGLRenderer = function ( parameters ) { } + state.setDepthFunc( material.depthFunc ); state.setDepthTest( material.depthTest ); state.setDepthWrite( material.depthWrite ); state.setColorWrite( material.colorWrite );
true
Other
mrdoob
three.js
f507558bf30d38cf179ceca1eee92505ca0cf5e7.json
Add depth function to materials Fixes #6266
src/renderers/webgl/WebGLState.js
@@ -15,6 +15,7 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) { var currentBlendSrcAlpha = null; var currentBlendDstAlpha = null; + var currentDepthFunc = null; var currentDepthTest = null; var currentDepthWrite = null; @@ -150,6 +151,71 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) { }; + this.setDepthFunc = function ( depthFunc ) { + + if ( currentDepthFunc !== depthFunc ) { + + if ( depthFunc ) { + + switch ( depthFunc ) { + + case THREE.NeverDepth: + + gl.depthFunc( gl.NEVER ); + break; + + case THREE.AlwaysDepth: + + gl.depthFunc( gl.ALWAYS ); + break; + + case THREE.LessDepth: + + gl.depthFunc( gl.LESS ); + break; + + case THREE.LessEqualDepth: + + gl.depthFunc( gl.LEQUAL ); + break; + + case THREE.EqualDepth: + + gl.depthFunc( gl.EQUAL ); + break; + + case THREE.GreaterEqualDepth: + + gl.depthFunc( gl.GEQUAL ); + break; + + case THREE.GreaterDepth: + + gl.depthFunc( gl.GREATER ); + break; + + case THREE.NotEqualDepth: + + gl.depthFunc( gl.NOTEQUAL ); + break; + + default: + + gl.depthFunc( gl.LEQUAL ); + } + + } else { + + gl.depthFunc( gl.LEQUAL ); + + } + + currentDepthFunc = depthFunc; + + } + + }; + this.setDepthTest = function ( depthTest ) { if ( currentDepthTest !== depthTest ) {
true
Other
mrdoob
three.js
a9e0b9de16960b04389bec9ee64c105d80d0e9c2.json
Reuse program when not changed Resuse program if code is the same and material updated
src/renderers/WebGLRenderer.js
@@ -2244,30 +2244,8 @@ THREE.WebGLRenderer = function ( parameters ) { function initMaterial( material, lights, fog, object ) { - material.addEventListener( 'dispose', onMaterialDispose ); - var shaderID = shaderIDs[ material.type ]; - if ( shaderID ) { - - var shader = THREE.ShaderLib[ shaderID ]; - - material.__webglShader = { - uniforms: THREE.UniformsUtils.clone( shader.uniforms ), - vertexShader: shader.vertexShader, - fragmentShader: shader.fragmentShader - } - - } else { - - material.__webglShader = { - uniforms: material.uniforms, - vertexShader: material.vertexShader, - fragmentShader: material.fragmentShader - } - - } - // heuristics to create shader parameters according to lights in the scene // (not to blow over maxLights budget) @@ -2366,6 +2344,43 @@ THREE.WebGLRenderer = function ( parameters ) { var code = chunks.join(); + if ( !material.program ) { + + // new material + material.addEventListener( 'dispose', onMaterialDispose ); + + } else if ( material.program.code !== code ) { + + // changed glsl or parameters + deallocateMaterial( material ); + + } else { + + // same glsl and parameters + return; + + } + + if ( shaderID ) { + + var shader = THREE.ShaderLib[ shaderID ]; + + material.__webglShader = { + uniforms: THREE.UniformsUtils.clone( shader.uniforms ), + vertexShader: shader.vertexShader, + fragmentShader: shader.fragmentShader + } + + } else { + + material.__webglShader = { + uniforms: material.uniforms, + vertexShader: material.vertexShader, + fragmentShader: material.fragmentShader + } + + } + var program; // Check if code has been already compiled @@ -2477,8 +2492,6 @@ THREE.WebGLRenderer = function ( parameters ) { if ( material.needsUpdate ) { - if ( material.program ) deallocateMaterial( material ); - initMaterial( material, lights, fog, object ); material.needsUpdate = false;
false
Other
mrdoob
three.js
c12770459e4d7405d28f580cce903c270e4f36bf.json
change *copy; to ©
LICENSE
@@ -1,6 +1,6 @@ The MIT License -Copyright &copy; 2010-2015 three.js authors +Copyright © 2010-2015 three.js authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
false
Other
mrdoob
three.js
b70a1b989a58840f5ba357834271faddf5aab9eb.json
Improve description of default shader parameters
docs/api/renderers/webgl/WebGLProgram.html
@@ -11,43 +11,88 @@ <h1>[name]</h1> <div class="desc">Constructor for the GLSL program sent to vertex and fragment shaders, including default uniforms and attributes.</div> + <h2>Built-in uniforms and attributes</h2> + + <h3>Vertex shader (unconditional):</h3> + <div> + <code> + // = object.matrixWorld + uniform mat4 modelMatrix; + + // = camera.matrixWorldInverse * object.matrixWorld + uniform mat4 modelViewMatrix; + + // = camera.projectionMatrix + uniform mat4 projectionMatrix; + + // = camera.matrixWorldInverse + uniform mat4 viewMatrix; + + // = inverse transpose of modelViewMatrix + uniform mat3 normalMatrix; + + // = camera.position + uniform vec3 cameraPosition; + </code> + <code> + attribute vec3 position; + attribute vec3 normal; + attribute vec2 uv; + attribute vec2 uv2; + </code></div> + + <h3>Vertex shader (conditional):</h3> + <code> + #ifdef USE_COLOR + attribute vec3 color; + #endif + </code> + <code> + #ifdef USE_MORPHTARGETS + + attribute vec3 morphTarget0; + attribute vec3 morphTarget1; + attribute vec3 morphTarget2; + attribute vec3 morphTarget3; + + #ifdef USE_MORPHNORMALS + + attribute vec3 morphNormal0; + attribute vec3 morphNormal1; + attribute vec3 morphNormal2; + attribute vec3 morphNormal3; + + #else + + attribute vec3 morphTarget4; + attribute vec3 morphTarget5; + attribute vec3 morphTarget6; + attribute vec3 morphTarget7; + + #endif + #endif + </code> + <code> + #ifdef USE_SKINNING + attribute vec4 skinIndex; + attribute vec4 skinWeight; + #endif + </code> + </div> + + <h3>Fragment shader:</h3> + <div> + <code> + uniform mat4 viewMatrix; + uniform vec3 cameraPosition; + </code> + </div> + + <h2>Constructor</h2> <h3>[name]( [page:WebGLRenderer renderer], [page:Object code], [page:Material material], [page:Object parameters] )</h3> <div>For parameters see [page:WebGLRenderer WebGLRenderer]</div> - <div>Standard defaults for vertex shader:<br/><br/> - uniform mat4 modelMatrix;<br/> - uniform mat4 modelViewMatrix;<br/> - uniform mat4 projectionMatrix;<br/> - uniform mat4 viewMatrix;<br/> - uniform mat3 normalMatrix;<br/> - uniform vec3 cameraPosition;<br/><br/> - attribute vec3 position;<br/> - attribute vec3 normal;<br/> - attribute vec2 uv;<br/> - attribute vec2 uv2;</div> - - <div>Conditional defaults for vertex shader:<br/><br/> - attribute vec3 color;<br/><br/> - attribute vec3 morphTarget0;<br/> - attribute vec3 morphTarget1;<br/> - attribute vec3 morphTarget2;<br/> - attribute vec3 morphTarget3;<br/><br/> - attribute vec3 morphNormal0;<br/> - attribute vec3 morphNormal1;<br/> - attribute vec3 morphNormal2;<br/> - attribute vec3 morphNormal3;<br/><br/> - attribute vec3 morphTarget4;<br/> - attribute vec3 morphTarget5;<br/> - attribute vec3 morphTarget6;<br/> - attribute vec3 morphTarget7;<br/><br/> - attribute vec4 skinIndex;<br/> - attribute vec4 skinWeight;</div> - - <div>Standard defaults for fragment shader:<br/><br/> - uniform mat4 viewMatrix;<br/> - uniform vec3 cameraPosition;</div> - <h2>Properties</h2> @@ -57,10 +102,10 @@ <h3>.[page:Object uniforms]</h3> <h3>.[page:Object attributes]</h3> <div></div> - <h3>.[page:Integer id]</h3> + <h3>.[page:String id]</h3> <div></div> - <h3>.[page:Object code]</h3> + <h3>.[page:String code]</h3> <div></div> <h3>.[page:Integer usedTimes]</h3> @@ -69,10 +114,10 @@ <h3>.[page:Integer usedTimes]</h3> <h3>.[page:Object program]</h3> <div></div> - <h3>.[page:Object vertexShader]</h3> + <h3>.[page:WebGLShader vertexShader]</h3> <div></div> - <h3>.[page:Object fragmentShader]</h3> + <h3>.[page:WebGLShader fragmentShader]</h3> <div></div>
false
Other
mrdoob
three.js
b0dbff42d281c9b1850825674aa22d08981133b4.json
Add methods .merge and .makegroups
docs/api/core/Geometry.html
@@ -225,12 +225,18 @@ <h3>.computeBoundingSphere()</h3> <div>Neither bounding boxes or bounding spheres are computed by default. They need to be explicitly computed, otherwise they are *null*.</div> + <h3>.merge( [page:Geometry geometry], [page:Matrix4 matrix], [page:Integer materialIndexOffset] )</h3> + <div>Merge two geometries or geometry and geometry from object (using object's transform)</div> + <h3>.mergeVertices()</h3> <div> Checks for duplicate vertices using hashmap.<br /> Duplicated vertices are removed and faces' vertices are updated. </div> + <h3>.makeGroups()</h3> + <div>Geometry splitting</div> + <h3>.clone()</h3> <div> Creates a new clone of the Geometry.
false
Other
mrdoob
three.js
2bbd16e3be2be4a6870e333cdcbe743db83bf028.json
add the tga texture loader example
examples/webgl_materials_texture_tga.html
@@ -0,0 +1,145 @@ +<!DOCTYPE html> +<!-- +@author Daosheng Mu / https://github.com/DaoshengMu/ +--> +<html> + <head> + <title>three.js webgl - materials - tga texture</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> + <style> + body { + color: #000; + font-family:Monospace; + font-size:13px; + text-align:center; + + background-color: #fff; + margin: 0px; + padding: 0px; + overflow: hidden; + } + + #stats { position: absolute; top:0; left: 0 } + #stats #fps { background: transparent !important } + #stats #fps #fpsText { color: #777 !important } + #stats #fps #fpsGraph { display: none } + </style> + </head> + <body> + <div id="info"> + <a href="http://threejs.org" target="_blank">three.js</a> - tga texture example + </div> + <script src="../build/three.min.js"></script> + <script src="js/Detector.js"></script> + <script src="js/libs/stats.min.js"></script> + + <script> + + if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); + + var SCREEN_WIDTH = window.innerWidth; + var SCREEN_HEIGHT = window.innerHeight; + + var container,stats; + + var camera, scene, renderer; + + var mouseX = 0, mouseY = 0; + + var windowHalfX = window.innerWidth / 2; + var windowHalfY = window.innerHeight / 2; + + init(); + animate(); + + function init() { + + container = document.createElement( 'div' ); + document.body.appendChild( container ); + + renderer = new THREE.WebGLRenderer( { antialias: true } ); + + camera = new THREE.PerspectiveCamera( 35, SCREEN_WIDTH / SCREEN_HEIGHT, 1, 25000 ); + camera.position.z = 200; + + scene = new THREE.Scene(); + + var light = new THREE.DirectionalLight( 0xffffff, 2 ); + light.position.set( 1, 1, 1 ); + scene.add( light ); + + // add box 1 - grey8 texture + var texture1 = THREE.ImageUtils.loadTGATexture( "textures/crate_grey8.tga" ); + var material1 = new THREE.MeshPhongMaterial( { color: 0xffffff, map: texture1 } ); + + var geometry = new THREE.BoxGeometry( 50, 50, 50 ); + var mesh1 = new THREE.Mesh( geometry, material1 ); + mesh1.rotation.x = -Math.PI / 2; + mesh1.position.x = - 50; + + scene.add( mesh1 ); + + // add box 2 - tga texture + var texture2 = THREE.ImageUtils.loadTGATexture( "textures/crate_color8.tga" ); + var material2 = new THREE.MeshPhongMaterial( { color: 0xffffff, map: texture2 } ); + + var mesh2 = new THREE.Mesh( geometry, material2 ); + mesh2.rotation.x = -Math.PI / 2; + mesh2.position.x = 50; + + scene.add( mesh2 ); + + // RENDERER + renderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT ); + renderer.setClearColor( 0xf2f7ff, 1 ); + renderer.autoClear = false; + + renderer.domElement.style.position = "relative"; + container.appendChild( renderer.domElement ); + + // STATS1 + stats = new Stats(); + container.appendChild( stats.domElement ); + + document.addEventListener( 'mousemove', onDocumentMouseMove, false ); + + } + + function onDocumentMouseMove(event) { + + mouseX = ( event.clientX - windowHalfX ); + mouseY = ( event.clientY - windowHalfY ); + + } + + + function animate() { + + requestAnimationFrame( animate ); + + render(); + stats.update(); + + } + + function render() { + + camera.position.x += ( mouseX - camera.position.x ) * .05; + camera.position.y = THREE.Math.clamp( camera.position.y + ( - ( mouseY - 200 ) - camera.position.y ) * .05, 50, 1000 ); + + camera.lookAt( scene.position ); + + renderer.enableScissorTest( false ); + renderer.clear(); + renderer.enableScissorTest( true ); + + renderer.setScissor( 0, 0, SCREEN_WIDTH - 2, SCREEN_HEIGHT ); + renderer.render( scene, camera ); + + + } + + </script> + </body> +</html>
false
Other
mrdoob
three.js
d24518dca32645d2bea0e8460181b00332d6c6bd.json
hide lens flare if not visible
src/extras/renderers/plugins/LensFlarePlugin.js
@@ -158,6 +158,9 @@ THREE.LensFlarePlugin = function () { flare = flares[ i ]; + if (!flare.visible) + continue; + tempPosition.set( flare.matrixWorld.elements[12], flare.matrixWorld.elements[13], flare.matrixWorld.elements[14] ); tempPosition.applyMatrix4( camera.matrixWorldInverse );
false
Other
mrdoob
three.js
26df5b70aa1fbc1fd6d1ef3ef93b997a4a51a8d7.json
update setLength documentation to reflect code
docs/api/extras/helpers/ArrowHelper.html
@@ -70,9 +70,11 @@ <h3>.setColor([page:Number hex])</h3> Sets the color of the arrowHelper. </div> - <h3>.setLength([page:Number length])</h3> + <h3>.setLength([page:Number length], [page:Number headLength], [page:Number headWidth])</h3> <div> - length -- The desired length + length -- The desired length<br /> + headLength -- The length of the head of the arrow<br /> + headWidth -- The length of the width of the arrow </div> <div> Sets the length of the arrowhelper.
false
Other
mrdoob
three.js
1fbe53e84dac9ea47ba9c6487e84e4e47904f04f.json
Remove unused variable in example
examples/webgl_lines_cubes.html
@@ -67,7 +67,7 @@ function init() { - var i, material, container; + var i, container; container = document.createElement( 'div' ); document.body.appendChild( container );
false
Other
mrdoob
three.js
7f7629ab0d1f461f06efc1674084841ac3ada74a.json
glsl clean up
src/renderers/shaders/ShaderChunk/default_vertex.glsl
@@ -1,21 +1,15 @@ -vec4 mvPosition; - #ifdef USE_SKINNING - mvPosition = modelViewMatrix * skinned; - -#endif + vec4 mvPosition = modelViewMatrix * skinned; -#if !defined( USE_SKINNING ) && defined( USE_MORPHTARGETS ) +#elif defined( USE_MORPHTARGETS ) - mvPosition = modelViewMatrix * vec4( morphed, 1.0 ); - -#endif + vec4 mvPosition = modelViewMatrix * vec4( morphed, 1.0 ); -#if !defined( USE_SKINNING ) && ! defined( USE_MORPHTARGETS ) +#else - mvPosition = modelViewMatrix * vec4( position, 1.0 ); + vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 ); #endif -gl_Position = projectionMatrix * mvPosition; \ No newline at end of file +gl_Position = projectionMatrix * mvPosition;
true
Other
mrdoob
three.js
7f7629ab0d1f461f06efc1674084841ac3ada74a.json
glsl clean up
src/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl
@@ -1,20 +1,14 @@ -vec3 objectNormal; - #ifdef USE_SKINNING - objectNormal = skinnedNormal.xyz; - -#endif + vec3 objectNormal = skinnedNormal.xyz; -#if !defined( USE_SKINNING ) && defined( USE_MORPHNORMALS ) +#elif defined( USE_MORPHNORMALS ) - objectNormal = morphedNormal; - -#endif + vec3 objectNormal = morphedNormal; -#if !defined( USE_SKINNING ) && ! defined( USE_MORPHNORMALS ) +#else - objectNormal = normal; + vec3 objectNormal = normal; #endif @@ -24,4 +18,4 @@ vec3 objectNormal; #endif -vec3 transformedNormal = normalMatrix * objectNormal; \ No newline at end of file +vec3 transformedNormal = normalMatrix * objectNormal;
true
Other
mrdoob
three.js
7f7629ab0d1f461f06efc1674084841ac3ada74a.json
glsl clean up
src/renderers/shaders/ShaderChunk/envmap_fragment.glsl
@@ -1,7 +1,5 @@ #ifdef USE_ENVMAP - vec3 reflectVec; - #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition ); @@ -13,17 +11,17 @@ #ifdef ENVMAP_MODE_REFLECTION - reflectVec = reflect( cameraToVertex, worldNormal ); + vec3 reflectVec = reflect( cameraToVertex, worldNormal ); - #elif defined( ENVMAP_MODE_REFRACTION ) + #else - reflectVec = refract( cameraToVertex, worldNormal, refractionRatio ); + vec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio ); #endif #else - reflectVec = vReflect; + vec3 reflectVec = vReflect; #endif
true
Other
mrdoob
three.js
7f7629ab0d1f461f06efc1674084841ac3ada74a.json
glsl clean up
src/renderers/shaders/ShaderChunk/envmap_vertex.glsl
@@ -9,7 +9,7 @@ vReflect = reflect( cameraToVertex, worldNormal ); - #elif defined( ENVMAP_MODE_REFRACTION ) + #else vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
true
Other
mrdoob
three.js
7f7629ab0d1f461f06efc1674084841ac3ada74a.json
glsl clean up
src/renderers/shaders/ShaderChunk/worldpos_vertex.glsl
@@ -4,18 +4,14 @@ vec4 worldPosition = modelMatrix * skinned; - #endif - - #if defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING ) + #elif defined( USE_MORPHTARGETS ) vec4 worldPosition = modelMatrix * vec4( morphed, 1.0 ); - #endif - - #if ! defined( USE_MORPHTARGETS ) && ! defined( USE_SKINNING ) + #else vec4 worldPosition = modelMatrix * vec4( position, 1.0 ); #endif -#endif \ No newline at end of file +#endif
true
Other
mrdoob
three.js
7f7629ab0d1f461f06efc1674084841ac3ada74a.json
glsl clean up
src/renderers/shaders/ShaderLib.js
@@ -1026,16 +1026,15 @@ THREE.ShaderLib = { " if ( enableReflection ) {", - " vec3 vReflect;", " vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );", " #ifdef ENVMAP_MODE_REFLECTION", - " vReflect = reflect( cameraToVertex, normal );", + " vec3 vReflect = reflect( cameraToVertex, normal );", - " #elif defined( ENVMAP_MODE_REFRACTION )", + " #else", - " vReflect = refract( cameraToVertex, normal, refractionRatio );", + " vec3 vReflect = refract( cameraToVertex, normal, refractionRatio );", " #endif",
true
Other
mrdoob
three.js
7f7629ab0d1f461f06efc1674084841ac3ada74a.json
glsl clean up
src/renderers/webgl/WebGLProgram.js
@@ -345,6 +345,8 @@ THREE.WebGLProgram = ( function () { if ( _gl.getProgramInfoLog( program ) !== '' ) { console.warn( 'THREE.WebGLProgram: gl.getProgramInfoLog()', _gl.getProgramInfoLog( program ) ); + // console.warn( _gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glVertexShader ) ); + // console.warn( _gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glFragmentShader ) ); }
true
Other
mrdoob
three.js
078c31024f930020645e46c50ee414c23bb21ca4.json
WebGLRenderTarget missed todos
docs/api/renderers/WebGLRenderTarget.html
@@ -74,22 +74,22 @@ <h3>[property:number type]</h3> <h3>[property:boolean depthBuffer]</h3> <div> - todo + Renders to the depth buffer. Default is true. </div> <h3>[property:boolean stencilBuffer]</h3> <div> - todo + Renders to the stencil buffer. Default is true. </div> <h3>[property:boolean generateMipmaps]</h3> <div> Whether to generate mipmaps (if possible) for a texture. True by default. </div> - <h3>[property:todo shareDepthFrom]</h3> + <h3>[property:WebGLRenderTarget shareDepthFrom]</h3> <div> - todo + Shares the depth from another WebGLRenderTarget. Default is null. </div>
false
Other
mrdoob
three.js
9af3f082e8f710eb2e4704f4aee3941a74ed2cfd.json
Fix handling of some cameras in Mirror.js Mirror.js assumes that the mirror camera has .matrixAutoUpdate = true. If the mirror camera is cloned from an original camera that has .matrixAutoUpdate = false, this must be corrected.
examples/js/Mirror.js
@@ -110,6 +110,7 @@ THREE.Mirror = function ( renderer, camera, options ) { this.textureMatrix = new THREE.Matrix4(); this.mirrorCamera = this.camera.clone(); + this.mirrorCamera.matrixAutoUpdate = true; this.texture = new THREE.WebGLRenderTarget( width, height ); this.tempTexture = new THREE.WebGLRenderTarget( width, height ); @@ -142,7 +143,7 @@ THREE.Mirror = function ( renderer, camera, options ) { }; THREE.Mirror.prototype = Object.create( THREE.Object3D.prototype ); -THREE.Mirror.prototype.constructor = THREE.Mirror; +THREE.Mirror.prototype.constructor = THREE.Mirror; THREE.Mirror.prototype.renderWithMirror = function ( otherMirror ) {
false
Other
mrdoob
three.js
3ba1dcbc3d5b3214fa640d29f90c14c0abf7f20a.json
Fix typo in mirror example
examples/webgl_mirror.html
@@ -50,7 +50,7 @@ var NEAR = 1; var FAR = 500; - var camera, scane, renderer; + var camera, scene, renderer; var cameraControls;
false
Other
mrdoob
three.js
4e1beb0b4861c54968c22cee0e40aac8b2247a81.json
fix crossOrigin propagation in OBJMTL loader
examples/js/loaders/MTLLoader.js
@@ -87,6 +87,7 @@ THREE.MTLLoader.prototype = { } var materialCreator = new THREE.MTLLoader.MaterialCreator( this.baseUrl, this.options ); + materialCreator.crossOrigin = this.crossOrigin materialCreator.setMaterials( materialsInfo ); return materialCreator;
true
Other
mrdoob
three.js
4e1beb0b4861c54968c22cee0e40aac8b2247a81.json
fix crossOrigin propagation in OBJMTL loader
examples/js/loaders/OBJMTLLoader.js
@@ -20,6 +20,7 @@ THREE.OBJMTLLoader.prototype = { var scope = this; var mtlLoader = new THREE.MTLLoader( url.substr( 0, url.lastIndexOf( "/" ) + 1 ) ); + mtlLoader.crossOrigin = scope.crossOrigin; mtlLoader.load( mtlurl, function ( materials ) { var materialsCreator = materials;
true
Other
mrdoob
three.js
ad988c7fb329e834c54c892916e6e95e616c15a7.json
Adjust code alignment and add todo list.
examples/js/renderers/SoftwareRenderer.js
@@ -96,6 +96,7 @@ THREE.SoftwareRenderer = function ( parameters ) { }; + // TODO: Check why autoClear can't be false. this.render = function ( scene, camera ) { if ( this.autoClear === true ) this.clear(); @@ -1124,54 +1125,54 @@ THREE.SoftwareRenderer = function ( parameters ) { crossVector.cross( lookVector ); crossVector.normalize(); - while (length > 0) { - - // Get this pixel. - pixelX = (x2 + length * unitX); - pixelY = (y2 + length * unitY); - pixelZ = (z2 + length * unitZ); - - pixelX = (pixelX + subpixelBias) >> subpixelBits; - pixelY = (pixelY + subpixelBias) >> subpixelBits; - pZ = (pixelZ + subpixelBias) >> subpixelBits; + while (length > 0) { + + // Get this pixel. + pixelX = (x2 + length * unitX); + pixelY = (y2 + length * unitY); + pixelZ = (z2 + length * unitZ); + + pixelX = (pixelX + subpixelBias) >> subpixelBits; + pixelY = (pixelY + subpixelBias) >> subpixelBits; + pZ = (pixelZ + subpixelBias) >> subpixelBits; + + // Draw line with line width + for ( var i = -halfLineWidth; i <= halfLineWidth; ++i ) { + + // Compute the line pixels. + // Get the pixels on the vector that crosses to the line vector + pX = Math.floor((pixelX + crossVector.x * i)); + pY = Math.floor((pixelY + crossVector.y * i)); + + // if pixel is over the rect. Continue + if ( rectx1 >= pX || rectx2 <= pX || recty1 >= pY + || recty2 <= pY ) + continue; + + // Find this pixel at which block + var blockX = pX >> blockShift; + var blockY = pY >> blockShift; + var blockId = blockX + blockY * canvasWBlocks; + + // Compare the pixel depth width z block. + if ( blockMaxZ[ blockId ] < minz ) continue; + + blockMaxZ[ blockId ] = Math.min( blockMaxZ[ blockId ], maxz ); + + var bflags = blockFlags[ blockId ]; + if ( bflags & BLOCK_NEEDCLEAR ) clearBlock( blockX, blockY ); + blockFlags[ blockId ] = bflags & ~( BLOCK_ISCLEAR | BLOCK_NEEDCLEAR ); - // Draw line with line width - for ( var i = -halfLineWidth; i <= halfLineWidth; ++i ) { - - // Compute the line pixels. - // Get the pixels on the vector that crosses to the line vector - pX = Math.floor((pixelX + crossVector.x * i)); - pY = Math.floor((pixelY + crossVector.y * i)); - - // if pixel is over the rect. Continue - if ( rectx1 >= pX || rectx2 <= pX || recty1 >= pY - || recty2 <= pY ) - continue; - - // Find this pixel at which block - var blockX = pX; - var blockY = pY; - var blockId = blockX + blockY * canvasWBlocks; - - // Compare the pixel depth width z block. - if ( blockMaxZ[ blockId ] < minz ) continue; - - blockMaxZ[ blockId ] = Math.min( blockMaxZ[ blockId ], maxz ); - - var bflags = blockFlags[ blockId ]; - if ( bflags & BLOCK_NEEDCLEAR ) clearBlock( blockX, blockY ); - blockFlags[ blockId ] = bflags & ~( BLOCK_ISCLEAR | BLOCK_NEEDCLEAR ); - - // draw pixel - var offset = pX + pY * canvasWidth; - - if ( pZ < zbuffer[ offset ] ) { - shader( data, zbuffer, offset, pZ, color1, color2, material ); - } + // draw pixel + var offset = pX + pY * canvasWidth; + + if ( pZ < zbuffer[ offset ] ) { + shader( data, zbuffer, offset, pZ, color1, color2, material ); } + } - --length; - } + --length; + } }
true
Other
mrdoob
three.js
ad988c7fb329e834c54c892916e6e95e616c15a7.json
Adjust code alignment and add todo list.
examples/software_lines_colors.html
@@ -78,8 +78,7 @@ renderer = new THREE.SoftwareRenderer( { antialias: false } ); renderer.setSize( window.innerWidth, window.innerHeight ); - renderer.autoClear = true; - + container.appendChild( renderer.domElement ); var geometry = new THREE.Geometry(),
true
Other
mrdoob
three.js
66b101db3fe14ac3ca3efdc46723a8aadd0c56b5.json
Fix indentation in Blender exporter script
utils/exporters/blender/2.65/scripts/addons/io_mesh_threejs/export_threejs.py
@@ -2170,8 +2170,8 @@ def generate_cameras(data): "position" : generate_vec3([cameraobj.location[0], -cameraobj.location[1], cameraobj.location[2]], data["flipyz"]), "target" : generate_vec3([0, 0, 0]) } - - elif camera.id_data.type == "ORTHO": + + elif camera.id_data.type == "ORTHO": camera_string = TEMPLATE_CAMERA_ORTHO % { "camera_id" : generate_string(camera.name),
false
Other
mrdoob
three.js
8fcb3c06165d4616ba960fbfbb9e208fead9d64c.json
add glsl changes
src/renderers/shaders/ShaderChunk/alphatest_fragment.glsl
@@ -0,0 +1,5 @@ +#ifdef ALPHATEST + + if ( gl_FragColor.a < ALPHATEST ) discard; + +#endif
true
Other
mrdoob
three.js
8fcb3c06165d4616ba960fbfbb9e208fead9d64c.json
add glsl changes
src/renderers/shaders/ShaderChunk/bumpmap_pars_fragment.glsl
@@ -0,0 +1,40 @@ +#ifdef USE_BUMPMAP + + uniform sampler2D bumpMap; + uniform float bumpScale; + + // Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen + // http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html + + // Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2) + + vec2 dHdxy_fwd() { + + vec2 dSTdx = dFdx( vUv ); + vec2 dSTdy = dFdy( vUv ); + + float Hll = bumpScale * texture2D( bumpMap, vUv ).x; + float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; + float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; + + return vec2( dBx, dBy ); + + } + + vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) { + + vec3 vSigmaX = dFdx( surf_pos ); + vec3 vSigmaY = dFdy( surf_pos ); + vec3 vN = surf_norm; // normalized + + vec3 R1 = cross( vSigmaY, vN ); + vec3 R2 = cross( vN, vSigmaX ); + + float fDet = dot( vSigmaX, R1 ); + + vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); + return normalize( abs( fDet ) * surf_norm - vGrad ); + + } + +#endif \ No newline at end of file
true
Other
mrdoob
three.js
8fcb3c06165d4616ba960fbfbb9e208fead9d64c.json
add glsl changes
src/renderers/shaders/ShaderChunk/color_fragment.glsl
@@ -0,0 +1,5 @@ +#ifdef USE_COLOR + + gl_FragColor = gl_FragColor * vec4( vColor, 1.0 ); + +#endif \ No newline at end of file
true
Other
mrdoob
three.js
8fcb3c06165d4616ba960fbfbb9e208fead9d64c.json
add glsl changes
src/renderers/shaders/ShaderChunk/color_pars_fragment.glsl
@@ -0,0 +1,5 @@ +#ifdef USE_COLOR + + varying vec3 vColor; + +#endif
true