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
8ed3615868c79154cb9f21474321b65750b3f7b2.json
add support for cineon tone mapping.
src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl
@@ -3,23 +3,37 @@ uniform float toneMappingExposure; uniform float toneMappingWhitePoint; +// exposure only vec3 LinearToneMapping( vec3 color ) { return toneMappingExposure * color; } + +// source: https://www.cs.utah.edu/~reinhard/cdrom/ vec3 ReinhardToneMapping( vec3 color ) { color *= toneMappingExposure; return saturate( color / ( vec3( 1.0 ) + color ) ); } +// source: http://filmicgames.com/archives/75 #define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) ) - vec3 Uncharted2ToneMapping( vec3 color ) { + // John Hable's filmic operator from Uncharted 2 video game color *= toneMappingExposure; return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) ); } + +// source: http://filmicgames.com/archives/75 +vec3 OptimizedCineonToneMapping( vec3 color ) { + + // optimized filmic operator by Jim Hejl and Richard Burgess-Dawson + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); + +}
true
Other
mrdoob
three.js
8ed3615868c79154cb9f21474321b65750b3f7b2.json
add support for cineon tone mapping.
src/renderers/webgl/WebGLProgram.js
@@ -59,6 +59,9 @@ THREE.WebGLProgram = ( function () { case THREE.Uncharted2ToneMapping: toneMappingName = "Uncharted2"; break; + case THREE.CineonToneMapping: + toneMappingName = "OptimizedCineon"; + break; default: throw new Error( 'unsupported toneMapping: ' + toneMapping );
true
Other
mrdoob
three.js
b39d8c896a0e33ef4cbb5cf527680f03fd170f7e.json
add premultiplied alpha example.
examples/files.js
@@ -135,6 +135,7 @@ var files = { "webgl_materials_texture_manualmipmap", "webgl_materials_texture_pvrtc", "webgl_materials_texture_tga", + "webgl_materials_transparency", "webgl_materials_variations_basic", "webgl_materials_variations_lambert", "webgl_materials_variations_phong",
true
Other
mrdoob
three.js
b39d8c896a0e33ef4cbb5cf527680f03fd170f7e.json
add premultiplied alpha example.
examples/webgl_materials_transparency.html
@@ -0,0 +1,252 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <title>threejs webgl - materials</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: #fff; + font-family:Monospace; + font-size:13px; + text-align:center; + + background-color: #000; + + margin: 0px; + overflow: hidden; + } + + #info { + position: absolute; + top: 0px; width: 100%; + padding: 5px; + } + </style> + </head> + <body> + + <div id="container"></div> + <div id="info"><a href="http://threejs.org" target="_blank">threejs</a> - Transparency with Non-Premultipled Alpha (left) versus Premultiplied Alpha (right) with RGBA8 Buffers by <a href="http://clara.io/" target="_blank">Ben Houston</a>.</div> + + <script src="../build/three.min.js"></script> + <script src="../examples/js/controls/OrbitControls.js"></script> + <script src="../src/loaders/BinaryTextureLoader.js"></script> + + <script src="../examples/js/Detector.js"></script> + <script src="../examples/js/libs/stats.min.js"></script> + + <script src="../examples/js/libs/dat.gui.min.js"></script> + + <script src="../examples/js/postprocessing/EffectComposer.js"></script> + <script src="../examples/js/postprocessing/RenderPass.js"></script> + <script src="../examples/js/postprocessing/MaskPass.js"></script> + <script src="../examples/js/postprocessing/ShaderPass.js"></script> + <script src="../examples/js/shaders/CopyShader.js"></script> + <script src="../examples/js/shaders/FXAAShader.js"></script> + <script src="../examples/js/postprocessing/BloomPass.js"></script> + <script src="../examples/js/shaders/ConvolutionShader.js"></script> + + <script> + + if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); + + var container, stats; + var params = { + opacity: 0.5, + roughness: 1.0, + bumpScale: 0.3 + }; + var camera, scene, renderer, controls, objects = []; + var composer; + var standardMaterial, standardMaterialPremultiplied; + + init(); + animate(); + + function init() { + + container = document.createElement( 'div' ); + document.body.appendChild( container ); + + camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 2000 ); + camera.position.set( 0.0, 40, 40 * 3.5 ); + + scene = new THREE.Scene(); + + renderer = new THREE.WebGLRenderer( { antialias: false } ); + + var roughnessTexture = THREE.ImageUtils.loadTexture( "../examples/textures/roughness_map.jpg" ); + roughnessTexture.wrapS = THREE.RepeatWrapping; + roughnessTexture.wrapT = THREE.RepeatWrapping; + roughnessTexture.repeat.set( 9, 2 ); + + standardMaterial = new THREE.MeshStandardMaterial( { + map: null, + roughnessMap: roughnessTexture, + bumpScale: - 0.05, + bumpMap: roughnessTexture, + color: 0xffffff, + metalness: 0.9, + roughness: 1.0, + shading: THREE.SmoothShading, + transparent: true + } ); + var geometry = new THREE.SphereGeometry( 18, 30, 30 ); + var torusMesh1 = new THREE.Mesh( geometry, standardMaterial ); + torusMesh1.position.x = -20.0; + torusMesh1.castShadow = true; + scene.add( torusMesh1 ); + objects.push( torusMesh1 ); + + standardMaterialPremultiplied = new THREE.MeshStandardMaterial( { + map: null, + roughnessMap: roughnessTexture, + bumpScale: - 0.05, + bumpMap: roughnessTexture, + color: 0xffffff, + metalness: 0.9, + roughness: 1.0, + shading: THREE.SmoothShading, + premultipliedAlpha: true, + blending: THREE.CustomBlending, + blendSrc: THREE.OneFactor, // output of shader must be premultiplied + blendDst: THREE.OneMinusSrcAlphaFactor, + blendEquation: THREE.AddEquation, + transparent: true + } ); + + console.log( 'standardMaterialPremultiplied', standardMaterialPremultiplied ); + + var torusMesh2 = new THREE.Mesh( geometry, standardMaterialPremultiplied ); + torusMesh2.position.x = 20.0; + torusMesh2.castShadow = true; + scene.add( torusMesh2 ); + objects.push( torusMesh2 ); + + var floorMaterial = new THREE.MeshStandardMaterial( { + map: null, + roughnessMap: null, + color: 0xffffff, + metalness: 0.0, + roughness: 0.0, + shading: THREE.SmoothShading + } ); + + var planeGeometry = new THREE.PlaneBufferGeometry( 200, 200 ); + var planeMesh1 = new THREE.Mesh( planeGeometry, floorMaterial ); + planeMesh1.position.y = - 50; + planeMesh1.rotation.x = - Math.PI * 0.5; + planeMesh1.receiveShadow = true; + scene.add( planeMesh1 ); + + + // Lights + + scene.add( new THREE.AmbientLight( 0x222222 ) ); + + var spotLight = new THREE.SpotLight( 0xffffff ); + spotLight.position.set( 50, 100, 50 ); + spotLight.angle = Math.PI / 7; + spotLight.penumbra = 0.8 + spotLight.castShadow = true; + scene.add( spotLight ); + + renderer.setPixelRatio( window.devicePixelRatio ); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.shadowMap.enabled = true; + container.appendChild( renderer.domElement ); + + renderer.gammaInput = true; + renderer.gammaOutput = true; + + composer = new THREE.EffectComposer( renderer ); + composer.setSize( window.innerWidth, window.innerHeight ); + + var renderScene = new THREE.RenderPass( scene, camera ); + composer.addPass( renderScene ); + + var copyPass = new THREE.ShaderPass( THREE.CopyShader ); + copyPass.renderToScreen = true; + composer.addPass( copyPass ); + + stats = new Stats(); + stats.domElement.style.position = 'absolute'; + stats.domElement.style.top = '0px'; + + container.appendChild( stats.domElement ); + + controls = new THREE.OrbitControls( camera, renderer.domElement ); + controls.target.set( 0, 0, 0 ); + controls.update(); + + window.addEventListener( 'resize', onWindowResize, false ); + + var gui = new dat.GUI(); + + gui.add( params, 'roughness', 0, 1 ); + gui.add( params, 'bumpScale', - 1, 1 ); + gui.add( params, 'opacity', 0, 1 ); + gui.open(); + + } + + function onWindowResize() { + + var width = window.innerWidth; + var height = window.innerHeight; + + camera.aspect = width / height; + camera.updateProjectionMatrix(); + + renderer.setSize( width, height ); + composer.setSize( width, height ); + + } + + // + + function animate() { + + requestAnimationFrame( animate ); + + render(); + stats.update(); + + } + + function render() { + + if ( standardMaterial !== undefined ) { + + + standardMaterial.roughness = params.roughness; + standardMaterialPremultiplied.roughness = params.roughness; + + standardMaterial.bumpScale = - 0.05 * params.bumpScale; + standardMaterialPremultiplied.bumpScale = - 0.05 * params.bumpScale; + + standardMaterial.opacity = params.opacity; + standardMaterialPremultiplied.opacity = params.opacity; + + } + + var timer = Date.now() * 0.00025; + + camera.lookAt( scene.position ); + + for ( var i = 0, l = objects.length; i < l; i ++ ) { + + var object = objects[ i ]; + object.rotation.y += 0.005; + + } + + composer.render(); + + } + + </script> + + </body> +</html>
true
Other
mrdoob
three.js
03cf74ccffe7b931c052f357bb43123ba0749d67.json
Fix proposal for #8244 Make the parseTrackNam()e regular expression more lenient to accommodate bone names that contain '-' characters.
src/animation/PropertyBinding.js
@@ -543,7 +543,7 @@ THREE.PropertyBinding.parseTrackName = function( trackName ) { // .bone[Armature.DEF_cog].position // created and tested via https://regex101.com/#javascript - var re = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_. ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/; + var re = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/; var matches = re.exec(trackName); if( ! matches ) {
false
Other
mrdoob
three.js
92361214137bb261bc86d024cd2640b89bf6e404.json
support pre-multipled alpha on materials.
src/materials/Material.js
@@ -40,6 +40,8 @@ THREE.Material = function () { this.alphaTest = 0; + this.premultipliedAlpha = false; + this.overdraw = 0; // Overdrawn pixels (typically between 0 and 1) for fixing antialiasing gaps in CanvasRenderer this.visible = true;
true
Other
mrdoob
three.js
92361214137bb261bc86d024cd2640b89bf6e404.json
support pre-multipled alpha on materials.
src/renderers/shaders/ShaderChunk/premultiply_alpha_fragment.glsl
@@ -0,0 +1,6 @@ +#if PREMULTIPLIED_ALPHA + + // Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation. + gl_FragColor.rgb *= gl_FragColor.a; + +#endif
true
Other
mrdoob
three.js
92361214137bb261bc86d024cd2640b89bf6e404.json
support pre-multipled alpha on materials.
src/renderers/shaders/ShaderLib/linedashed_frag.glsl
@@ -30,5 +30,6 @@ void main() { gl_FragColor = linearToOutputTexel( vec4( outgoingLight, diffuseColor.a ) ); #include <fog_fragment> + #include <premultiply_alpha_fragment> }
true
Other
mrdoob
three.js
92361214137bb261bc86d024cd2640b89bf6e404.json
support pre-multipled alpha on materials.
src/renderers/shaders/ShaderLib/meshbasic_frag.glsl
@@ -45,5 +45,6 @@ void main() { gl_FragColor = linearToOutputTexel( vec4( outgoingLight, diffuseColor.a ) ); #include <fog_fragment> + #include <premultiply_alpha_fragment> }
true
Other
mrdoob
three.js
92361214137bb261bc86d024cd2640b89bf6e404.json
support pre-multipled alpha on materials.
src/renderers/shaders/ShaderLib/meshlambert_frag.glsl
@@ -72,5 +72,6 @@ void main() { gl_FragColor = linearToOutputTexel( vec4( outgoingLight, diffuseColor.a ) ); #include <fog_fragment> + #include <premultiply_alpha_fragment> }
true
Other
mrdoob
three.js
92361214137bb261bc86d024cd2640b89bf6e404.json
support pre-multipled alpha on materials.
src/renderers/shaders/ShaderLib/meshphong_frag.glsl
@@ -56,5 +56,6 @@ void main() { gl_FragColor = linearToOutputTexel( vec4( outgoingLight, diffuseColor.a ) ); #include <fog_fragment> + #include <premultiply_alpha_fragment> }
true
Other
mrdoob
three.js
92361214137bb261bc86d024cd2640b89bf6e404.json
support pre-multipled alpha on materials.
src/renderers/shaders/ShaderLib/meshstandard_frag.glsl
@@ -68,5 +68,6 @@ void main() { gl_FragColor = linearToOutputTexel( vec4( outgoingLight, diffuseColor.a ) ); #include <fog_fragment> + #include <premultiply_alpha_fragment> }
true
Other
mrdoob
three.js
92361214137bb261bc86d024cd2640b89bf6e404.json
support pre-multipled alpha on materials.
src/renderers/shaders/ShaderLib/points_frag.glsl
@@ -23,5 +23,6 @@ void main() { gl_FragColor = linearToOutputTexel( vec4( outgoingLight, diffuseColor.a ) ); #include <fog_fragment> + #include <premultiply_alpha_fragment> }
true
Other
mrdoob
three.js
92361214137bb261bc86d024cd2640b89bf6e404.json
support pre-multipled alpha on materials.
src/renderers/webgl/WebGLProgram.js
@@ -491,6 +491,8 @@ THREE.WebGLProgram = ( function () { parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', parameters.pointLightShadows > 0 ? '#define POINT_LIGHT_SHADOWS' : '', + parameters.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : '' + parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', parameters.logarithmicDepthBuffer && renderer.extensions.get( 'EXT_frag_depth' ) ? '#define USE_LOGDEPTHBUF_EXT' : '',
true
Other
mrdoob
three.js
964e08beef081892f95434567136986c25e53596.json
fix bug in encodings.glsl
examples/js/pmrem/PMREMGenerator.js
@@ -82,7 +82,7 @@ THREE.PMREMGenerator.prototype = { renderer.gammaInput = renderer.gammaInput; renderer.gammaOutput = renderer.gammaOutput; - + }, renderToCubeMapTarget: function( renderer, renderTarget ) { @@ -219,7 +219,13 @@ THREE.PMREMGenerator.prototype = { rgbColor /= float(NumSamples);\n\ //rgbColor = testColorMap( roughness ).rgb;\n\ gl_FragColor = linearToOutputTexel( vec4( rgbColor, 1.0 ) );\n\ - }" + }", + blending: THREE.CustomBlending, + blendSrc: THREE.OneFactor, + blendDst: THREE.ZeroFactor, + blendSrcAlpha: THREE.OneFactor, + blendDstAlpha: THREE.ZeroFactor, + blendEquation: THREE.AddEquation } ); }
true
Other
mrdoob
three.js
964e08beef081892f95434567136986c25e53596.json
fix bug in encodings.glsl
examples/js/pmrem/PMREM_CubeUVPacker.js
@@ -11,7 +11,7 @@ THREE.PMREM_CubeUVPacker = function( cubeTextureLods, numLods ) { var size = cubeTextureLods[ 0 ].width * 4; this.CubeUVRenderTarget = new THREE.WebGLRenderTarget( size, size, - { format: THREE.RGBAFormat, magFilter: THREE.LinearFilter, minFilter: THREE.LinearFilter, type:cubeTextureLods[ 0 ].type } ); + { format: THREE.RGBAFormat, magFilter: THREE.LinearFilter, minFilter: THREE.LinearFilter, type: cubeTextureLods[ 0 ].texture.type } ); this.CubeUVRenderTarget.texture.generateMipmaps = false; this.CubeUVRenderTarget.mapping = THREE.CubeUVReflectionMapping; this.camera = new THREE.OrthographicCamera( - size * 0.5, size * 0.5, - size * 0.5, size * 0.5, 0.0, 1000 ); @@ -96,7 +96,6 @@ THREE.PMREM_CubeUVPacker.prototype = { renderer.gammaInput = renderer.gammaInput; renderer.gammaOutput = renderer.gammaOutput; - }, getShader: function() {
true
Other
mrdoob
three.js
964e08beef081892f95434567136986c25e53596.json
fix bug in encodings.glsl
examples/webgl_materials_envmaps_hdr.html
@@ -99,20 +99,23 @@ renderer = new THREE.WebGLRenderer( { alpha:true, antialias: true } ); var hdrType = THREE.UnsignedByteType; - /* if ( renderer.extensions.get( 'OES_texture_half_float' ) && renderer.extensions.get( 'OES_texture_half_float_linear' ) ) { + if ( renderer.extensions.get( 'OES_texture_half_float' ) && renderer.extensions.get( 'OES_texture_half_float_linear' ) ) { hdrType = THREE.HalfFloatType; } else if ( renderer.extensions.get( 'OES_texture_float' ) && renderer.extensions.get( 'OES_texture_float_linear' ) ) { hdrType = THREE.FloatType; - }*/ + } var hdrCubeMap = new THREE.HDRCubeMapLoader().load( hdrType, hdrurls, function ( hdrCubeMap ) { + var pmremGenerator = new THREE.PMREMGenerator( hdrCubeMap ); pmremGenerator.update(renderer); + var pmremCubeUVPacker = new THREE.PMREM_CubeUVPacker(pmremGenerator.cubeLods); pmremCubeUVPacker.update(renderer); + var roughnessTexture = THREE.ImageUtils.loadTexture( "../examples/textures/roughness_map.jpg" ); roughnessTexture.wrapS = THREE.RepeatWrapping; roughnessTexture.wrapT = THREE.RepeatWrapping;
true
Other
mrdoob
three.js
964e08beef081892f95434567136986c25e53596.json
fix bug in encodings.glsl
src/renderers/shaders/ShaderChunk/encodings.glsl
@@ -19,12 +19,12 @@ vec4 LinearTosRGB( in vec4 value ) { } vec4 RGBEToLinear( in vec4 value ) { - return vec4( value.rgb * exp2( value.a * 256.0 - 128.0 ), 1.0 ); + return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 ); } vec4 LinearToRGBE( in vec4 value ) { float maxComponent = max( max( value.r, value.g ), value.b ); - float fExp = ceil( log2( maxComponent ) ); - return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 256.0 ); + float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 ); + return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 ); // return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 ); }
true
Other
mrdoob
three.js
55a5c38d1aae9a00e82c3885c236853906604e30.json
remove unused code.
examples/js/pmrem/PMREM_CubeUVPacker.js
@@ -45,17 +45,6 @@ THREE.PMREM_CubeUVPacker = function( cubeTextureLods, numLods ) { var mipOffsetY = 0; var mipSize = size; - /* - var testColor = []; - testColor.push( new THREE.Vector3( 1, 0, 0 ) ); - testColor.push( new THREE.Vector3( 0, 1, 0 ) ); - testColor.push( new THREE.Vector3( 0, 0, 1 ) ); - testColor.push( new THREE.Vector3( 1, 1, 0 ) ); - testColor.push( new THREE.Vector3( 0, 1, 1 ) ); - testColor.push( new THREE.Vector3( 1, 0, 1 ) ); - testColor.push( new THREE.Vector3( 1, 1, 1 ) ); - testColor.push( new THREE.Vector3( 0.5, 1, 0.5 ) );*/ - for ( var j = 0; j < nMips; j ++ ) { // Mip Maps @@ -137,14 +126,6 @@ THREE.PMREM_CubeUVPacker.prototype = { uniform vec3 testColor;\ uniform int faceIndex;\ \ - const float PI = 3.14159265358979;\ - vec4 sampleCubeMap(float phi, float theta) {\ - float sinTheta = sin(theta);\ - float cosTheta = cos(theta);\ - vec3 sampleDir = vec3(cos(phi) * sinTheta, cosTheta, sin(phi) * sinTheta);\ - vec4 color = envMapTexelToLinear( textureCube(envMap, sampleDir) );\ - return color * vec4(testColor, 1.0);\ - }\ void main() {\ vec3 sampleDirection;\ vec2 uv = vUv;\
false
Other
mrdoob
three.js
54d2c68d934f8bd696d555b5322df750d9f76581.json
add proper source for toHalf.
examples/js/Half.js
@@ -1,5 +1,5 @@ /** - * @author Prashant Sharma / spidersharma03 + * Source: http://gamedev.stackexchange.com/questions/17326/conversion-of-a-number-from-single-precision-floating-point-representation-to-a/17410#17410 */ THREE.toHalf = (function() {
false
Other
mrdoob
three.js
e8f7f3df96fcf4a1af6a4e16190b14d57b2c6fdd.json
add bevelSegments parameter
docs/api/geometries/TextGeometry.html
@@ -1,138 +1,139 @@ -<!DOCTYPE html> -<html lang="en"> - <head> +<!DOCTYPE html> +<html lang="en"> + <head> <meta charset="utf-8" /> - <base href="../../" /> - <script src="list.js"></script> - <script src="page.js"></script> - <link type="text/css" rel="stylesheet" href="page.css" /> - </head> - <body> - [page:ExtrudeGeometry] &rarr; - - <h1>[name]</h1> - - <div class="desc">This object creates a 3D object of text as a single object.</div> - - <iframe id="scene" src="scenes/geometry-browser.html#TextGeometry"></iframe> - - <script> - - // iOS iframe auto-resize workaround - - if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) { - - var scene = document.getElementById( 'scene' ); - - scene.style.width = getComputedStyle( scene ).width; - scene.style.height = getComputedStyle( scene ).height; - scene.setAttribute( 'scrolling', 'no' ); - - } - - </script> - - <h2>Example</h2> - - <div> - [example:webgl_geometry_text geometry / text ]<br/> - [example:webgl_geometry_text2 geometry / text2 ] - </div> - - <h2>Constructor</h2> - - <h3>[name]([page:String text], [page:Object parameters])</h3> - <div> - text β€” The text that needs to be shown. <br /> - parameters β€” Object that can contains the following parameters. - <ul> - <li>font β€” THREE.Font.</li> - <li>size β€” Float. Size of the text.</li> - <li>height β€” Float. Thickness to extrude text. Default is 50.</li> - <li>curveSegments β€” Integer. Number of points on the curves. Default is 12.</li> - <li>bevelEnabled β€” Boolean. Turn on bevel. Default is False.</li> - <li>bevelThickness β€” Float. How deep into text bevel goes. Default is 10.</li> - <li>bevelSize β€” Float. How far from text outline is bevel. Default is 8.</li> - </ul> - </div> - - <h2>Available Fonts</h2> - - <div> - TextGeometry uses <a href='http://gero3.github.io/facetype.js/' target="_top">typeface.json</a> generated fonts. - Some existing fonts can be found located in <b>/examples/fonts</b> and must be included in the page. - </div> - <table> - <tr> - <th>Font</th> - <th>Weight</th> - <th>Style</th> - <th>File Path</th> - </tr> - <tr> - <td>helvetiker</td> - <td>normal</td> - <td>normal</td> - <td>/examples/fonts/helvetiker_regular.typeface.json</td> - </tr> - <tr> - <td>helvetiker</td> - <td>bold</td> - <td>normal</td> - <td>/examples/fonts/helvetiker_bold.typeface.json</td> - </tr> - <tr> - <td>optimer</td> - <td>normal</td> - <td>normal</td> - <td>/examples/fonts/optimer_regular.typeface.json</td> - </tr> - <tr> - <td>optimer</td> - <td>bold</td> - <td>normal</td> - <td>/examples/fonts/optimer_bold.typeface.json</td> - </tr> - <tr> - <td>gentilis</td> - <td>normal</td> - <td>normal</td> - <td>/examples/fonts/gentilis_regular.typeface.json</td> - </tr> - <tr> - <td>gentilis</td> - <td>bold</td> - <td>normal</td> - <td>/examples/fonts/gentilis_bold.typeface.json</td> - </tr> - <tr> - <td>droid sans</td> - <td>normal</td> - <td>normal</td> - <td>/examples/fonts/droid/droid_sans_regular.typeface.json</td> - </tr> - <tr> - <td>droid sans</td> - <td>bold</td> - <td>normal</td> - <td>/examples/fonts/droid/droid_sans_bold.typeface.json</td> - </tr> - <tr> - <td>droid serif</td> - <td>normal</td> - <td>normal</td> - <td>/examples/fonts/droid/droid_serif_regular.typeface.json</td> - </tr> - <tr> - <td>droid serif</td> - <td>bold</td> - <td>normal</td> - <td>/examples/fonts/droid/droid_serif_bold.typeface.json</td> - </tr> - </table> - - <h2>Source</h2> - - [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] - </body> -</html> + <base href="../../" /> + <script src="list.js"></script> + <script src="page.js"></script> + <link type="text/css" rel="stylesheet" href="page.css" /> + </head> + <body> + [page:ExtrudeGeometry] &rarr; + + <h1>[name]</h1> + + <div class="desc">This object creates a 3D object of text as a single object.</div> + + <iframe id="scene" src="scenes/geometry-browser.html#TextGeometry"></iframe> + + <script> + + // iOS iframe auto-resize workaround + + if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) { + + var scene = document.getElementById( 'scene' ); + + scene.style.width = getComputedStyle( scene ).width; + scene.style.height = getComputedStyle( scene ).height; + scene.setAttribute( 'scrolling', 'no' ); + + } + + </script> + + <h2>Example</h2> + + <div> + [example:webgl_geometry_text geometry / text ]<br/> + [example:webgl_geometry_text2 geometry / text2 ] + </div> + + <h2>Constructor</h2> + + <h3>[name]([page:String text], [page:Object parameters])</h3> + <div> + text β€” The text that needs to be shown. <br /> + parameters β€” Object that can contains the following parameters. + <ul> + <li>font β€” THREE.Font.</li> + <li>size β€” Float. Size of the text.</li> + <li>height β€” Float. Thickness to extrude text. Default is 50.</li> + <li>curveSegments β€” Integer. Number of points on the curves. Default is 12.</li> + <li>bevelEnabled β€” Boolean. Turn on bevel. Default is False.</li> + <li>bevelThickness β€” Float. How deep into text bevel goes. Default is 10.</li> + <li>bevelSize β€” Float. How far from text outline is bevel. Default is 8.</li> + <li>bevelSegments β€” Integer. Number of bevel segments. Default is 3.</li> + </ul> + </div> + + <h2>Available Fonts</h2> + + <div> + TextGeometry uses <a href='http://gero3.github.io/facetype.js/' target="_top">typeface.json</a> generated fonts. + Some existing fonts can be found located in <b>/examples/fonts</b> and must be included in the page. + </div> + <table> + <tr> + <th>Font</th> + <th>Weight</th> + <th>Style</th> + <th>File Path</th> + </tr> + <tr> + <td>helvetiker</td> + <td>normal</td> + <td>normal</td> + <td>/examples/fonts/helvetiker_regular.typeface.json</td> + </tr> + <tr> + <td>helvetiker</td> + <td>bold</td> + <td>normal</td> + <td>/examples/fonts/helvetiker_bold.typeface.json</td> + </tr> + <tr> + <td>optimer</td> + <td>normal</td> + <td>normal</td> + <td>/examples/fonts/optimer_regular.typeface.json</td> + </tr> + <tr> + <td>optimer</td> + <td>bold</td> + <td>normal</td> + <td>/examples/fonts/optimer_bold.typeface.json</td> + </tr> + <tr> + <td>gentilis</td> + <td>normal</td> + <td>normal</td> + <td>/examples/fonts/gentilis_regular.typeface.json</td> + </tr> + <tr> + <td>gentilis</td> + <td>bold</td> + <td>normal</td> + <td>/examples/fonts/gentilis_bold.typeface.json</td> + </tr> + <tr> + <td>droid sans</td> + <td>normal</td> + <td>normal</td> + <td>/examples/fonts/droid/droid_sans_regular.typeface.json</td> + </tr> + <tr> + <td>droid sans</td> + <td>bold</td> + <td>normal</td> + <td>/examples/fonts/droid/droid_sans_bold.typeface.json</td> + </tr> + <tr> + <td>droid serif</td> + <td>normal</td> + <td>normal</td> + <td>/examples/fonts/droid/droid_serif_regular.typeface.json</td> + </tr> + <tr> + <td>droid serif</td> + <td>bold</td> + <td>normal</td> + <td>/examples/fonts/droid/droid_serif_bold.typeface.json</td> + </tr> + </table> + + <h2>Source</h2> + + [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] + </body> +</html>
false
Other
mrdoob
three.js
73f36b774ca99b66c68b18a1353fbf1b1e7a3fd2.json
Update scene and camera matrices once, globally.
examples/js/loaders/GLTFLoader.js
@@ -107,6 +107,15 @@ THREE.GLTFLoader = ( function () { update: function ( scene, camera ) { + // update scene graph + + scene.updateMatrixWorld(); + + // update camera matrices and frustum + + camera.updateMatrixWorld(); + camera.matrixWorldInverse.getInverse( camera.matrixWorld ); + for ( var name in objects ) { var object = objects[ name ]; @@ -174,15 +183,6 @@ THREE.GLTFLoader = ( function () { // Update - update all the uniform values GLTFShader.prototype.update = function ( scene, camera ) { - // update scene graph - - scene.updateMatrixWorld(); - - // update camera matrices and frustum - - camera.updateMatrixWorld(); - camera.matrixWorldInverse.getInverse( camera.matrixWorld ); - var boundUniforms = this.boundUniforms; for ( var name in boundUniforms ) {
false
Other
mrdoob
three.js
c728a0538308874de38b0fc98882876cd55766b5.json
Implement issue #10506
src/renderers/shaders/ShaderLib/normal_frag.glsl
@@ -28,7 +28,4 @@ void main() { gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); - #include <premultiplied_alpha_fragment> - #include <encodings_fragment> - }
false
Other
mrdoob
three.js
d22e472012f1c3891ee450c8ed5b26ec75f1432d.json
Add an author
examples/js/loaders/GLTFLoader.js
@@ -2,6 +2,7 @@ * @author Rich Tibbett / https://github.com/richtr * @author mrdoob / http://mrdoob.com/ * @author Tony Parisi / http://www.tonyparisi.com/ + * @author Takahiro / https://github.com/takahirox */ THREE.GLTFLoader = ( function () {
false
Other
mrdoob
three.js
756df409752902dd860790bcebb25d6f6cdc8c09.json
Add WEBGL constants for some technique.states
examples/js/loaders/GLTFLoader.js
@@ -345,6 +345,48 @@ THREE.GLTFLoader = ( function () { 10497: THREE.RepeatWrapping }; + var WEBGL_SIDES = { + 1028: THREE.BackSide, // Culling front + 1029: THREE.FrontSide // Culling back + //1032: THREE.NoSide // Culling front and back, what to do? + }; + + var WEBGL_DEPTH_FUNCS = { + 512: THREE.NeverDepth, + 513: THREE.LessDepth, + 514: THREE.EqualDepth, + 515: THREE.LessEqualDepth, + 516: THREE.GreaterEqualDepth, + 517: THREE.NotEqualDepth, + 518: THREE.GreaterEqualDepth, + 519: THREE.AlwaysDepth + }; + + var WEBGL_BLEND_EQUATIONS = { + 32774: THREE.AddEquation, + 32778: THREE.SubtractEquation, + 32779: THREE.ReverseSubtractEquation + }; + + var WEBGL_BLEND_FUNCS = { + 0: THREE.ZeroFactor, + 1: THREE.OneFactor, + 768: THREE.SrcColorFactor, + 769: THREE.OneMinusSrcColorFactor, + 770: THREE.SrcAlphaFactor, + 771: THREE.OneMinusSrcAlphaFactor, + 772: THREE.DstAlphaFactor, + 773: THREE.OneMinusDstAlphaFactor, + 774: THREE.DstColorFactor, + 775: THREE.OneMinusDstColorFactor, + 776: THREE.SrcAlphaSaturateFactor + // The followings are not supported by Three.js yet + //32769: CONSTANT_COLOR, + //32770: ONE_MINUS_CONSTANT_COLOR, + //32771: CONSTANT_ALPHA, + //32772: ONE_MINUS_CONSTANT_COLOR + }; + var WEBGL_TYPE_SIZES = { 'SCALAR': 1, 'VEC2': 2, @@ -366,6 +408,15 @@ THREE.GLTFLoader = ( function () { STEP: THREE.InterpolateDiscrete }; + var STATES_ENABLES = { + 2884: 'CULL_FACE', + 2929: 'DEPTH_TEST', + 3042: 'BLEND', + 3089: 'SCISSOR_TEST', + 32823: 'POLYGON_OFFSET_FILL', + 32926: 'SAMPLE_ALPHA_TO_COVERAGE' + }; + /* UTILITY FUNCTIONS */ function _each( object, callback, thisObj ) {
false
Other
mrdoob
three.js
169e97e97226653691446334cddf374065ba3537.json
Replace a tab with a space
examples/js/loaders/GLTFLoader.js
@@ -1044,7 +1044,7 @@ THREE.GLTFLoader = ( function () { } - } else { + } else { if ( shaderParam && shaderParam.value ) {
false
Other
mrdoob
three.js
6a53e95c2257c39d8a15b76779f38175c899ed8c.json
Add bone graph to SkinnedMesh
examples/js/loaders/GLTFLoader.js
@@ -1622,6 +1622,31 @@ THREE.GLTFLoader = ( function () { child.bind( new THREE.Skeleton( bones, boneInverses, false ), skinEntry.bindShapeMatrix ); + var buildBoneGraph = function ( parentJson, parentObject, property ) { + + var children = parentJson[ property ]; + + if ( children === undefined ) return; + + for ( var i = 0, il = children.length; i < il; i ++ ) { + + var nodeId = children[ i ]; + var bone = __nodes[ nodeId ]; + var boneJson = json.nodes[ nodeId ]; + + if ( bone !== undefined && bone.isBone === true && boneJson !== undefined ) { + + parentObject.add( bone ); + buildBoneGraph( boneJson, bone, 'children' ); + + } + + } + + } + + buildBoneGraph( node, child, 'skeletons' ); + } _node.add( child );
false
Other
mrdoob
three.js
654e95dc47d1a143efdf074d9a6736ef0531f901.json
Add default material
examples/js/loaders/GLTFLoader.js
@@ -534,6 +534,20 @@ THREE.GLTFLoader = ( function () { } + function createDefaultMaterial() { + + return new THREE.MeshPhongMaterial( { + color: 0x00000, + emissive: 0x888888, + specular: 0x000000, + shininess: 0, + transparent: false, + depthTest: true, + side: THREE.FrontSide + } ); + + }; + // Deferred constructor for RawShaderMaterial types function DeferredShaderMaterial( params ) {
false
Other
mrdoob
three.js
5cb64c0324cf67c5dff50aca13c7e6a5f50e9d78.json
Remove Bone.skin assignment
examples/js/loaders/GLTFLoader.js
@@ -1590,7 +1590,6 @@ THREE.GLTFLoader = ( function () { if ( jointNode ) { - jointNode.skin = child; bones.push( jointNode ); var m = skinEntry.inverseBindMatrices.array;
false
Other
mrdoob
three.js
96893766ca6adf918cb21a30e8abc4b3b7c18223.json
Remove _node.matrixAutoUpdate = false;
examples/js/loaders/GLTFLoader.js
@@ -1447,8 +1447,6 @@ THREE.GLTFLoader = ( function () { if ( node.extras ) _node.userData = node.extras; - _node.matrixAutoUpdate = false; - if ( node.matrix !== undefined ) { matrix.fromArray( node.matrix );
false
Other
mrdoob
three.js
9020017a802f693a1b00d28921af1b9b76c514c0.json
Support non-declared buffer.type
examples/js/loaders/GLTFLoader.js
@@ -694,7 +694,7 @@ THREE.GLTFLoader = ( function () { return _each( json.buffers, function ( buffer ) { - if ( buffer.type === 'arraybuffer' ) { + if ( buffer.type === 'arraybuffer' || buffer.type === undefined ) { return new Promise( function ( resolve ) { @@ -708,6 +708,10 @@ THREE.GLTFLoader = ( function () { } ); + } else { + + console.warn( 'THREE.GLTFLoader: ' + buffer.type + ' buffer type is not supported' ); + } } );
false
Other
mrdoob
three.js
1f8fd19d67108970fcfbc876432d6a51ebc9d5ba.json
Remove an extra space
examples/js/loaders/GLTFLoader.js
@@ -1676,7 +1676,7 @@ THREE.GLTFLoader = ( function () { lightNode = new THREE.PointLight( color ); break; - case "spot ": + case "spot": lightNode = new THREE.SpotLight( color ); lightNode.position.set( 0, 0, 1 ); break;
false
Other
mrdoob
three.js
49648f31e09e38ae4eb0d8ad5f6e2be84340c74c.json
Remove intermediate interpolators.
examples/js/loaders/GLTFLoader.js
@@ -254,36 +254,6 @@ THREE.GLTFLoader = ( function () { }; - function createAnimation( name, interps ) { - - var tracks = []; - - for ( var i = 0, len = interps.length; i < len; i ++ ) { - - var interp = interps[ i ]; - - // KeyframeTrack.optimize() will modify given 'times' and 'values' - // buffers before creating a truncated copy to keep. Because buffers may - // be reused by other tracks, make copies here. - interp.times = THREE.AnimationUtils.arraySlice( interp.times, 0 ); - interp.values = THREE.AnimationUtils.arraySlice( interp.values, 0 ); - - interp.target.updateMatrix(); - interp.target.matrixAutoUpdate = true; - - tracks.push( new THREE.KeyframeTrack( - interp.name, - interp.times, - interp.values, - interp.type - ) ); - - } - - return new THREE.AnimationClip( name, undefined, tracks ); - - } - /*********************************/ /********** INTERNALS ************/ /*********************************/ @@ -1372,7 +1342,7 @@ THREE.GLTFLoader = ( function () { return _each( json.animations, function ( animation, animationId ) { - var interps = []; + var tracks = []; for ( var channelId in animation.channels ) { @@ -1393,23 +1363,30 @@ THREE.GLTFLoader = ( function () { if ( node ) { - var interp = { - times: inputAccessor.array, - values: outputAccessor.array, - target: node, - type: INTERPOLATION[ sampler.interpolation ], - name: node.name + '.' + PATH_PROPERTIES[ target.path ] - }; + node.updateMatrix(); + node.matrixAutoUpdate = true; + + var TypedKeyframeTrack = PATH_PROPERTIES[ target.path ] === PATH_PROPERTIES.rotation + ? THREE.QuaternionKeyframeTrack + : THREE.VectorKeyframeTrack; - interps.push( interp ); + // KeyframeTrack.optimize() will modify given 'times' and 'values' + // buffers before creating a truncated copy to keep. Because buffers may + // be reused by other tracks, make copies here. + tracks.push( new TypedKeyframeTrack( + node.name + '.' + PATH_PROPERTIES[ target.path ], + THREE.AnimationUtils.arraySlice( inputAccessor.array, 0 ), + THREE.AnimationUtils.arraySlice( outputAccessor.array, 0 ), + INTERPOLATION[ sampler.interpolation ] + ) ); } } } - return createAnimation( "animation_" + animationId, interps ); + return new THREE.AnimationClip( "animation_" + animationId, undefined, tracks ); } );
false
Other
mrdoob
three.js
7c0a7849c093e4fa46c9c3b29d1e2f6d68d7c3ee.json
Keep mesh names `name` is the primitive index. Since most meshes have only one primitive, just use the group name for index 0.
examples/js/loaders/GLTFLoader.js
@@ -1224,6 +1224,7 @@ THREE.GLTFLoader = ( function () { var meshNode = new THREE.Mesh( geometry, material ); meshNode.castShadow = true; + meshNode.name = ( name === "0" ? group.name : group.name + name ); if ( primitive.extras ) meshNode.userData = primitive.extras; @@ -1271,6 +1272,8 @@ THREE.GLTFLoader = ( function () { } + meshNode.name = ( name === "0" ? group.name : group.name + name ); + if ( primitive.extras ) meshNode.userData = primitive.extras; group.add( meshNode ); @@ -1512,6 +1515,7 @@ THREE.GLTFLoader = ( function () { var originalMaterial = child.material; var originalGeometry = child.geometry; var originalUserData = child.userData; + var originalName = child.name; var material; @@ -1542,6 +1546,7 @@ THREE.GLTFLoader = ( function () { child.castShadow = true; child.userData = originalUserData; + child.name = originalName; var skinEntry; @@ -1561,6 +1566,7 @@ THREE.GLTFLoader = ( function () { child = new THREE.SkinnedMesh( geometry, material, false ); child.castShadow = true; child.userData = originalUserData; + child.name = originalName; var bones = []; var boneInverses = [];
false
Other
mrdoob
three.js
a44f6e6cd9fa60f3b50113615ab1fdcbf2887eb4.json
remove calculations inside 'const' declarations
examples/js/SkyShader.js
@@ -49,17 +49,20 @@ THREE.ShaderLib[ 'sky' ] = { // wavelength of used primaries, according to preetham "const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );", - // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function + // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function: + // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn)) "const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );", // mie stuff // K coefficient for the primaries "const float v = 4.0;", - "const vec3 K = vec3( 0.686, 0.678, 0.666 );", - "const vec3 MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K;", + "const vec3 K = vec3( 0.686, 0.678, 0.666 );", + // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K + "const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );", // earth shadow hack - "const float cutoffAngle = pi / 1.95;", + // cutoffAngle = pi / 1.95; + "const float cutoffAngle = 1.6110731556870734;", "const float steepness = 1.5;", "const float EE = 1000.0;", @@ -129,8 +132,10 @@ THREE.ShaderLib[ 'sky' ] = { // 66 arc seconds -> degrees, and the cosine of that "const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;", - "const float THREE_OVER_SIXTEENPI = 3.0 / ( 16.0 * pi );", - "const float ONE_OVER_FOURPI = ( 1.0 / ( 4.0 * pi ) );", + // 3.0 / ( 16.0 * pi ) + "const float THREE_OVER_SIXTEENPI = 0.05968310365946075;", + // 1.0 / ( 4.0 * pi ) + "const float ONE_OVER_FOURPI = 0.07957747154594767;", "float rayleighPhase( float cosTheta )", "{",
false
Other
mrdoob
three.js
d6dd44d2470c86e2b35aff1502271ecb414482b9.json
Fix default value for divisions
src/extras/core/Curve.js
@@ -67,7 +67,7 @@ Curve.prototype = { getPoints: function ( divisions ) { - if ( ! divisions ) divisions = 5; + if ( isNaN( divisions ) ) divisions = 5; var points = []; @@ -85,7 +85,7 @@ Curve.prototype = { getSpacedPoints: function ( divisions ) { - if ( ! divisions ) divisions = 5; + if ( isNaN( divisions ) ) divisions = 5; var points = []; @@ -112,7 +112,7 @@ Curve.prototype = { getLengths: function ( divisions ) { - if ( ! divisions ) divisions = ( this.__arcLengthDivisions ) ? ( this.__arcLengthDivisions ) : 200; + if ( isNaN( divisions ) ) divisions = ( this.__arcLengthDivisions ) ? ( this.__arcLengthDivisions ) : 200; if ( this.cacheArcLengths && ( this.cacheArcLengths.length === divisions + 1 )
true
Other
mrdoob
three.js
d6dd44d2470c86e2b35aff1502271ecb414482b9.json
Fix default value for divisions
src/extras/core/CurvePath.js
@@ -139,7 +139,7 @@ CurvePath.prototype = Object.assign( Object.create( Curve.prototype ), { getSpacedPoints: function ( divisions ) { - if ( ! divisions ) divisions = 40; + if ( isNaN( divisions ) ) divisions = 40; var points = [];
true
Other
mrdoob
three.js
d324144d5e4c16aef5894ccceb9ff390e0a66d2f.json
remove duplicate start end points
examples/webgl_geometry_text_earcut.html
@@ -47,38 +47,54 @@ <!-- replace built-in triangulation with Earcut --> <script src="js/libs/earcut.js"></script> <script> + + function removeDupEndPts(points) { + + var l = points.length; + if ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) { + points.pop(); + } + } + function addContour( vertices, contour ) { - for ( var i = 0; i < contour.length; i++ ) { - vertices.push( contour[i].x ); - vertices.push( contour[i].y ); - } + + for ( var i = 0; i < contour.length; i++ ) { + vertices.push( contour[i].x ); + vertices.push( contour[i].y ); + } } THREE.ShapeUtils.triangulateShape = function ( contour, holes ) { - var vertices = []; + + removeDupEndPts( contour ); + holes.forEach( removeDupEndPts ); - addContour( vertices, contour ); + var vertices = []; - var holeIndices = []; - var holeIndex = contour.length; + addContour( vertices, contour ); - for ( i = 0; i < holes.length; i++ ) { - holeIndices.push( holeIndex ); - holeIndex += holes[i].length; - addContour( vertices, holes[i] ); - } + var holeIndices = []; + var holeIndex = contour.length; - var result = earcut( vertices, holeIndices, 2 ); + for ( i = 0; i < holes.length; i++ ) { + holeIndices.push( holeIndex ); + holeIndex += holes[i].length; + addContour( vertices, holes[i] ); + } - var grouped = []; - for ( var i = 0; i < result.length; i += 3 ) { - grouped.push( result.slice( i, i + 3 ) ); - } - return grouped; + var result = earcut( vertices, holeIndices, 2 ); + + var grouped = []; + for ( var i = 0; i < result.length; i += 3 ) { + grouped.push( result.slice( i, i + 3 ) ); + } + + return grouped; + }; + </script> - <script> if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
false
Other
mrdoob
three.js
5b1b197305a7bdfa58e118ece1ee7375a6560dbf.json
Fix DragControls for containers not at (0,0) If the container (renderer.domElement) is not at the top-left corner of the browser, the hit-test will always fail. The `TransformControl` is using the correct way, so it doesn't have such issue.
examples/js/controls/DragControls.js
@@ -52,8 +52,10 @@ THREE.DragControls = function ( _objects, _camera, _domElement ) { event.preventDefault(); - _mouse.x = ( event.clientX / _domElement.clientWidth ) * 2 - 1; - _mouse.y = - ( event.clientY / _domElement.clientHeight ) * 2 + 1; + var rect = _domElement.getBoundingClientRect(); + + _mouse.x = ( (event.clientX - rect.left) / rect.width ) * 2 - 1; + _mouse.y = - ( (event.clientY - rect.top) / rect.height ) * 2 + 1; _raycaster.setFromCamera( _mouse, _camera );
false
Other
mrdoob
three.js
f0cace5c2c9d7a22cec30a50ee61125e1de5f551.json
docs list.js code style whitespace
docs/list.js
@@ -1,5 +1,7 @@ var list = { + "Manual": { + "Getting Started": { "Creating a scene": "manual/introduction/Creating-a-scene", "Detecting WebGL and browser compatibility": "manual/introduction/Detecting-WebGL-and-browser-compatibility", @@ -11,16 +13,21 @@ var list = { "FAQ": "manual/introduction/FAQ", "Useful links": "manual/introduction/Useful-links" }, + "Next Steps": { "How to update things": "manual/introduction/How-to-update-things", "Matrix transformations": "manual/introduction/Matrix-transformations", "Animation System": "manual/introduction/Animation-system" }, + "Build Tools": { "Testing with NPM": "manual/buildTools/Testing-with-NPM" } + }, + "Reference": { + "Animation": { "AnimationAction": "api/animation/AnimationAction", "AnimationClip": "api/animation/AnimationClip", @@ -31,6 +38,7 @@ var list = { "PropertyBinding": "api/animation/PropertyBinding", "PropertyMixer": "api/animation/PropertyMixer" }, + "Animation / Tracks": { "BooleanKeyframeTrack": "api/animation/tracks/BooleanKeyframeTrack", "ColorKeyframeTrack": "api/animation/tracks/ColorKeyframeTrack", @@ -39,20 +47,23 @@ var list = { "StringKeyframeTrack": "api/animation/tracks/StringKeyframeTrack", "VectorKeyframeTrack": "api/animation/tracks/VectorKeyframeTrack" }, + "Audio": { "Audio": "api/audio/Audio", "AudioAnalyser": "api/audio/AudioAnalyser", "AudioContext": "api/audio/AudioContext", "AudioListener": "api/audio/AudioListener", "PositionalAudio": "api/audio/PositionalAudio" }, + "Cameras": { "Camera": "api/cameras/Camera", "CubeCamera": "api/cameras/CubeCamera", "OrthographicCamera": "api/cameras/OrthographicCamera", "PerspectiveCamera": "api/cameras/PerspectiveCamera", "StereoCamera": "api/cameras/StereoCamera" }, + "Constants": { "Animation": "api/constants/Animation", "Core": "api/constants/Core", @@ -62,6 +73,7 @@ var list = { "Renderer": "api/constants/Renderer", "Textures": "api/constants/Textures" }, + "Core": { "BufferAttribute": "api/core/BufferAttribute", "BufferGeometry": "api/core/BufferGeometry", @@ -80,17 +92,21 @@ var list = { "Raycaster": "api/core/Raycaster", "Uniform": "api/core/Uniform" }, + "Core / BufferAttributes": { "BufferAttribute Types": "api/core/bufferAttributeTypes/BufferAttributeTypes" }, + "Deprecated": { "DeprecatedList": "api/deprecated/DeprecatedList" }, + "Extras": { "CurveUtils": "api/extras/CurveUtils", "SceneUtils": "api/extras/SceneUtils", "ShapeUtils": "api/extras/ShapeUtils" }, + "Extras / Core": { "Curve": "api/extras/core/Curve", "CurvePath": "api/extras/core/CurvePath", @@ -99,6 +115,7 @@ var list = { "Shape": "api/extras/core/Shape", "ShapePath": "api/extras/core/ShapePath" }, + "Extras / Curves": { "ArcCurve": "api/extras/curves/ArcCurve", "CatmullRomCurve3": "api/extras/curves/CatmullRomCurve3", @@ -111,10 +128,12 @@ var list = { "QuadraticBezierCurve3": "api/extras/curves/QuadraticBezierCurve3", "SplineCurve": "api/extras/curves/SplineCurve" }, + "Extras / Objects": { "ImmediateRenderObject": "api/extras/objects/ImmediateRenderObject", "MorphBlendMesh": "api/extras/objects/MorphBlendMesh" }, + "Geometries": { "BoxBufferGeometry": "api/geometries/BoxBufferGeometry", "BoxGeometry": "api/geometries/BoxGeometry", @@ -158,6 +177,7 @@ var list = { "TubeBufferGeometry": "api/geometries/TubeBufferGeometry", "WireframeGeometry": "api/geometries/WireframeGeometry" }, + "Helpers": { "ArrowHelper": "api/helpers/ArrowHelper", "AxisHelper": "api/helpers/AxisHelper", @@ -174,6 +194,7 @@ var list = { "SpotLightHelper": "api/helpers/SpotLightHelper", "VertexNormalsHelper": "api/helpers/VertexNormalsHelper" }, + "Lights": { "AmbientLight": "api/lights/AmbientLight", "DirectionalLight": "api/lights/DirectionalLight", @@ -183,12 +204,14 @@ var list = { "RectAreaLight": "api/lights/RectAreaLight", "SpotLight": "api/lights/SpotLight" }, + "Lights / Shadows": { "DirectionalLightShadow": "api/lights/shadows/DirectionalLightShadow", "LightShadow": "api/lights/shadows/LightShadow", "RectAreaLightShadow": "api/lights/shadows/RectAreaLightShadow", "SpotLightShadow": "api/lights/shadows/SpotLightShadow" }, + "Loaders": { "AnimationLoader": "api/loaders/AnimationLoader", "AudioLoader": "api/loaders/AudioLoader", @@ -206,10 +229,12 @@ var list = { "ObjectLoader": "api/loaders/ObjectLoader", "TextureLoader": "api/loaders/TextureLoader" }, + "Loaders / Managers": { "DefaultLoadingManager": "api/loaders/managers/DefaultLoadingManager", "LoadingManager": "api/loaders/managers/LoadingManager" }, + "Materials": { "LineBasicMaterial": "api/materials/LineBasicMaterial", "LineDashedMaterial": "api/materials/LineDashedMaterial", @@ -228,6 +253,7 @@ var list = { "ShadowMaterial": "api/materials/ShadowMaterial", "SpriteMaterial": "api/materials/SpriteMaterial" }, + "Math": { "Box2": "api/math/Box2", "Box3": "api/math/Box3", @@ -250,12 +276,14 @@ var list = { "Vector3": "api/math/Vector3", "Vector4": "api/math/Vector4" }, + "Math / Interpolants": { "CubicInterpolant": "api/math/interpolants/CubicInterpolant", "DiscreteInterpolant": "api/math/interpolants/DiscreteInterpolant", "LinearInterpolant": "api/math/interpolants/LinearInterpolant", "QuaternionLinearInterpolant": "api/math/interpolants/QuaternionLinearInterpolant" }, + "Objects": { "Bone": "api/objects/Bone", "Group": "api/objects/Group", @@ -270,22 +298,26 @@ var list = { "SkinnedMesh": "api/objects/SkinnedMesh", "Sprite": "api/objects/Sprite" }, + "Renderers": { "WebGLRenderer": "api/renderers/WebGLRenderer", "WebGLRenderTarget": "api/renderers/WebGLRenderTarget", "WebGLRenderTargetCube": "api/renderers/WebGLRenderTargetCube" }, + "Renderers / Shaders": { "ShaderChunk": "api/renderers/shaders/ShaderChunk", "ShaderLib": "api/renderers/shaders/ShaderLib", "UniformsLib": "api/renderers/shaders/UniformsLib", "UniformsUtils": "api/renderers/shaders/UniformsUtils" }, + "Scenes": { "Fog": "api/scenes/Fog", "FogExp2": "api/scenes/FogExp2", "Scene": "api/scenes/Scene" }, + "Textures": { "CanvasTexture": "api/textures/CanvasTexture", "CompressedTexture": "api/textures/CompressedTexture", @@ -295,17 +327,22 @@ var list = { "Texture": "api/textures/Texture", "VideoTexture": "api/textures/VideoTexture" } + }, + "Examples": { + "Collada Animation": { "ColladaAnimation": "examples/collada/Animation", "AnimationHandler": "examples/collada/AnimationHandler", "KeyFrameAnimation": "examples/collada/KeyFrameAnimation" }, + "Geometries": { "ConvexBufferGeometry": "examples/geometries/ConvexBufferGeometry", "ConvexGeometry": "examples/geometries/ConvexGeometry" }, + "Loaders": { "BabylonLoader": "examples/loaders/BabylonLoader", "ColladaLoader": "examples/loaders/ColladaLoader", @@ -317,34 +354,44 @@ var list = { "SVGLoader": "examples/loaders/SVGLoader", "TGALoader": "examples/loaders/TGALoader" }, + "Plugins": { "CombinedCamera": "examples/cameras/CombinedCamera", "LookupTable": "examples/Lut", "SpriteCanvasMaterial": "examples/SpriteCanvasMaterial" }, + "QuickHull": { "Face": "examples/quickhull/Face", "HalfEdge": "examples/quickhull/HalfEdge", "QuickHull": "examples/quickhull/QuickHull", "VertexNode": "examples/quickhull/VertexNode", "VertexList": "examples/quickhull/VertexList" }, + "Renderers": { "CanvasRenderer": "examples/renderers/CanvasRenderer" } + }, + "Developer Reference": { + "Polyfills": { "Polyfills": "api/Polyfills" }, + "WebGLRenderer": { "WebGLProgram": "api/renderers/webgl/WebGLProgram", "WebGLShader": "api/renderers/webgl/WebGLShader", "WebGLState": "api/renderers/webgl/WebGLState" }, + "WebGLRenderer / Plugins": { "LensFlarePlugin": "api/renderers/webgl/plugins/LensFlarePlugin", "SpritePlugin": "api/renderers/webgl/plugins/SpritePlugin" } + } -} \ No newline at end of file + +}
false
Other
mrdoob
three.js
63e96283bc23e6ea7f9544d4f31881b5518c724a.json
Compute ParametricGeometry normals from derivative
src/geometries/ParametricGeometry.js
@@ -36,6 +36,7 @@ ParametricGeometry.prototype.constructor = ParametricGeometry; import { BufferGeometry } from '../core/BufferGeometry'; import { Float32BufferAttribute } from '../core/BufferAttribute'; +import { Vector3 } from '../math/Vector3'; function ParametricBufferGeometry( func, slices, stacks ) { @@ -53,11 +54,15 @@ function ParametricBufferGeometry( func, slices, stacks ) { var indices = []; var vertices = []; + var normals = []; var uvs = []; + var EPS = 0.00001; + var pu = new Vector3(), pv = new Vector3(), normal = new Vector3(); + var i, j; - // generate vertices and uvs + // generate vertices, normals and uvs var sliceCount = slices + 1; @@ -72,6 +77,16 @@ function ParametricBufferGeometry( func, slices, stacks ) { var p = func( u, v ); vertices.push( p.x, p.y, p.z ); + // approximate tangent plane vectors via central difference + + pu.subVectors( func( u + EPS, v ), func( u - EPS, v ) ); + pv.subVectors( func( u, v + EPS ), func( u, v - EPS ) ); + + // cross product of tangent plane vectors returns surface normal + + normal.crossVectors( pu, pv ); + normals.push( normal.x, normal.y, normal.z ); + uvs.push( u, v ); } @@ -102,11 +117,10 @@ function ParametricBufferGeometry( func, slices, stacks ) { this.setIndex( indices ); this.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); + this.addAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); this.addAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) ); - // generate normals - - this.computeVertexNormals(); + this.normalizeNormals(); }
false
Other
mrdoob
three.js
64eda9dac1be2cd68ad665ff945d155940f6c364.json
add target to iframe on links
examples/index.html
@@ -249,7 +249,7 @@ <h1><a href="http://threejs.org">three.js</a> / examples</h1> </div> <div id="content"></div> </div> - <iframe id="viewer" allowfullscreen onmousewheel=""></iframe> + <iframe id="viewer" name="viewer" allowfullscreen onmousewheel=""></iframe> <script src="files.js"></script> <script> @@ -334,14 +334,15 @@ <h1><a href="http://threejs.org">three.js</a> / examples</h1> link.className = 'link'; link.textContent = name; link.href = file + '.html'; + link.setAttribute( 'target', 'viewer' ); link.addEventListener( 'click', function ( event ) { if ( event.button === 0 ) { - event.preventDefault(); + //event.preventDefault(); panel.classList.toggle( 'collapsed' ); - load( file ); + //load( file ); }
false
Other
mrdoob
three.js
a38973324823f5724d555f6ea1e2d9f00188ed8f.json
Add AudioLoader.js to common.json
utils/build/includes/common.json
@@ -68,6 +68,7 @@ "src/lights/HemisphereLight.js", "src/lights/PointLight.js", "src/lights/SpotLight.js", + "src/loaders/AudioLoader.js", "src/loaders/Cache.js", "src/loaders/Loader.js", "src/loaders/XHRLoader.js",
false
Other
mrdoob
three.js
93700224815b452b9592f195a66345d28b548e31.json
Fix missing return
src/audio/Audio.js
@@ -47,6 +47,8 @@ THREE.Audio.prototype.load = function( url ) { this.setBuffer( buffer ); }); + return this; + }; THREE.Audio.prototype.setNodeSource = function( audioNode ) {
false
Other
mrdoob
three.js
bf5d23f461f0ecc5ab18a78469877998085ffa7b.json
Add backwards compatibility to THREE.Audio's .load
src/audio/Audio.js
@@ -37,10 +37,16 @@ THREE.Audio.prototype.getOutput = function() { }; -THREE.Audio.prototype.load = function() { +THREE.Audio.prototype.load = function( url ) { console.warn( 'THREE.Audio: .load has been deprecated. Please use THREE.AudioLoader.' ); + var audioLoader = new THREE.AudioLoader(this.context); + + audioLoader.load( url, function( buffer ) { + this.setBuffer( buffer ); + }); + }; THREE.Audio.prototype.setNodeSource = function( audioNode ) {
false
Other
mrdoob
three.js
885c49edd3e09a5fc5dd3ff8cde1b03d6f4c1ac9.json
Update misc_sound example to use THREE.AudioLoader
examples/misc_sound.html
@@ -78,6 +78,8 @@ var listener = new THREE.AudioListener(); camera.add( listener ); + var audioLoader = new THREE.AudioLoader(listener.context); + scene = new THREE.Scene(); scene.fog = new THREE.FogExp2( 0x000000, 0.0025 ); @@ -99,9 +101,11 @@ scene.add( mesh1 ); var sound1 = new THREE.PositionalAudio( listener ); - sound1.load( 'sounds/358232_j_s_song.ogg' ); - sound1.setRefDistance( 20 ); - sound1.autoplay = true; + audioLoader.load( 'sounds/358232_j_s_song.ogg', function( buffer ) { + sound1.setBuffer( buffer ); + sound1.setRefDistance( 20 ); + sound1.play(); + }); mesh1.add( sound1 ); // @@ -111,9 +115,11 @@ scene.add( mesh2 ); var sound2 = new THREE.PositionalAudio( listener ); - sound2.load( 'sounds/376737_Skullbeatz___Bad_Cat_Maste.ogg' ); - sound2.setRefDistance( 20 ); - sound2.autoplay = true; + audioLoader.load( 'sounds/376737_Skullbeatz___Bad_Cat_Maste.ogg', function( buffer ) { + sound2.setBuffer( buffer ); + sound2.setRefDistance( 20 ); + sound2.play(); + }); mesh2.add( sound2 ); // @@ -142,10 +148,12 @@ // global ambient audio var sound4 = new THREE.Audio( listener ); - sound4.load( 'sounds/Project_Utopia.ogg' ); - sound4.autoplay = true; - sound4.setLoop(true); - sound4.setVolume(0.5); + audioLoader.load( 'sounds/Project_Utopia.ogg', function( buffer ) { + sound4.setBuffer( buffer ); + sound4.setLoop(true); + sound4.setVolume(0.5); + sound4.play(); + }); // ground
false
Other
mrdoob
three.js
990d18910101fa60f431b4fe985503944cd9c842.json
Set flipY to true on loaded tga textures
examples/webgl_materials_texture_tga.html
@@ -43,7 +43,7 @@ var SCREEN_WIDTH = window.innerWidth; var SCREEN_HEIGHT = window.innerHeight; - var container,stats; + var container, stats; var camera, scene, renderer; @@ -62,34 +62,38 @@ renderer = new THREE.WebGLRenderer( { antialias: true } ); - camera = new THREE.PerspectiveCamera( 35, SCREEN_WIDTH / SCREEN_HEIGHT, 1, 25000 ); + camera = new THREE.PerspectiveCamera( 35, SCREEN_WIDTH / SCREEN_HEIGHT, 10, 2000 ); camera.position.z = 200; scene = new THREE.Scene(); - var light = new THREE.DirectionalLight( 0xffffff, 2 ); + scene.add( new THREE.AmbientLight( 0xffffff, 0.4 ) ); + + var light = new THREE.DirectionalLight( 0xffffff, 1 ); light.position.set( 1, 1, 1 ); scene.add( light ); var loader = new THREE.TGALoader(); // add box 1 - grey8 texture var texture1 = loader.load( 'textures/crate_grey8.tga' ); + texture1.flipY = true; + 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 = loader.load( 'textures/crate_color8.tga' ); + texture2.flipY = true; + 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 ); @@ -110,7 +114,7 @@ } - function onDocumentMouseMove(event) { + function onDocumentMouseMove( event ) { mouseX = ( event.clientX - windowHalfX ); mouseY = ( event.clientY - windowHalfY );
false
Other
mrdoob
three.js
1a08f3b76d463f41e92a41a4dceaba8780336e62.json
Add AudioLoader documentation
docs/api/loaders/AudioLoader.html
@@ -0,0 +1,90 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8" /> + <base href="../../" /> + <script src="list.js"></script> + <script src="page.js"></script> + <link type="text/css" rel="stylesheet" href="page.css" /> + </head> + <body> + <h1>[name]</h1> + + <div class="desc">Class for loading an [page:String AudioBuffer].</div> + + + <h2>Constructor</h2> + + <h3>[name]( [page:String context], [page:LoadingManager manager] )</h3> + <div> + [page:String context] β€” The [page:String AudioContext] for the loader to use. Default is [page:String window.AudioContext].<br /> + [page:LoadingManager manager] β€” The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager]. + </div> + <div> + Creates a new [name]. + </div> + + + <h2>Methods</h2> + + <h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3> + <div> + [page:String url] β€” required<br /> + [page:Function onLoad] β€” Will be called when load completes. The argument will be the loaded text response.<br /> + [page:Function onProgress] β€” Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br /> + [page:Function onError] β€” Will be called when load errors.<br /> + </div> + <div> + Begin loading from url and pass the loaded [page:String AudioBuffer] to onLoad. + </div> + + + + <h2>Example</h2> + + <code> + // instantiate a listener + var audioListener = new THREE.AudioListener(); + + // add the listener to the camera + camera.add( audioListener ); + + // instantiate audio object + var oceanAmbientSound = new THREE.Audio( audioListener ); + + // add the audio object to the scene + scene.add( oceanAmbientSound ); + + // instantiate a loader + var loader = new THREE.AudioLoader(); + + // load a resource + loader.load( + // resource URL + 'audio/ambient_ocean.ogg', + // Function when resource is loaded + function ( audioBuffer ) { + // set the audio object buffer to the loaded object + oceanAmbientSound.setBuffer( audioBuffer ); + + // play the audio + oceanAmbientSound.play(); + }, + // Function called when download progresses + function ( xhr ) { + console.log( (xhr.loaded / xhr.total * 100) + '% loaded' ); + }, + // Function called when download errors + function ( xhr ) { + console.log( 'An error happened' ); + } + ); + </code> + + + + <h2>Source</h2> + + [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] + </body> +</html>
false
Other
mrdoob
three.js
f8aedef34c3d98441585211d03d25a45504c9ec3.json
Add support for SkinnedMesh and Bone object types
src/loaders/ObjectLoader.js
@@ -605,6 +605,21 @@ Object.assign( ObjectLoader.prototype, { break; + case 'SkinnedMesh': + + var geometry = getGeometry( data.geometry ); + var material = getMaterial( data.material ); + + object = new SkinnedMesh( geometry, material ); + + break; + + case 'Bone': + + object = new Bone(); + + break; + case 'LOD': object = new LOD();
false
Other
mrdoob
three.js
e0df8d13c12bf1b261a4f14430e94cada838e307.json
Add clearDepth attribute to RenderPass
examples/js/postprocessing/RenderPass.js
@@ -15,6 +15,7 @@ THREE.RenderPass = function ( scene, camera, overrideMaterial, clearColor, clear this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 0; this.clear = true; + this.clearDepth = false; this.needsSwap = false; }; @@ -41,6 +42,12 @@ THREE.RenderPass.prototype = Object.assign( Object.create( THREE.Pass.prototype } + if ( this.clearDepth ) { + + renderer.clearDepth(); + + } + renderer.render( this.scene, this.camera, this.renderToScreen ? null : readBuffer, this.clear ); if ( this.clearColor ) {
false
Other
mrdoob
three.js
d83f5f0c5927054c445af0f44537a16cbf2967b5.json
remove use of non existent parameters
examples/webgl_materials_cubemap_dynamic.html
@@ -319,11 +319,11 @@ var params = { - "a" : { map: flareA, useScreenCoordinates: false, color: 0xffffff, blending: THREE.AdditiveBlending }, - "b" : { map: flareB, useScreenCoordinates: false, color: 0xffffff, blending: THREE.AdditiveBlending }, + "a" : { map: flareA, color: 0xffffff, blending: THREE.AdditiveBlending }, + "b" : { map: flareB, color: 0xffffff, blending: THREE.AdditiveBlending }, - "ar" : { map: flareA, useScreenCoordinates: false, color: 0xff0000, blending: THREE.AdditiveBlending }, - "br" : { map: flareB, useScreenCoordinates: false, color: 0xff0000, blending: THREE.AdditiveBlending } + "ar" : { map: flareA, color: 0xff0000, blending: THREE.AdditiveBlending }, + "br" : { map: flareB, color: 0xff0000, blending: THREE.AdditiveBlending } };
false
Other
mrdoob
three.js
4960478a4794429a47b7de6942abcfb71a6adda9.json
remove file from tree
gulpfile.js
@@ -1,12 +0,0 @@ -var gulp = require( 'gulp' ); -var pump = require( 'pump' ); -var connect = require( 'gulp-connect' ); - - -gulp.task('runserver', function() { - - connect.server( { root: '.', port: 8888 } ); - -}); - - gulp.task( 'default', [ 'runserver' ] );
false
Other
mrdoob
three.js
a9720c710acbdb245afff7eda29d892b7c623876.json
Fix missing scope in MMDLoader
examples/js/loaders/MMDLoader.js
@@ -858,8 +858,8 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress var initMaterials = function () { var textures = []; - var textureLoader = new THREE.TextureLoader( this.manager ); - var tgaLoader = new THREE.TGALoader( this.manager ); + var textureLoader = new THREE.TextureLoader( scope.manager ); + var tgaLoader = new THREE.TGALoader( scope.manager ); var offset = 0; var materialParams = [];
false
Other
mrdoob
three.js
4dbe138d095ab099cfc01fec9543a1d7513396a3.json
Remove z-index of #info style from MMD examples
examples/webgl_loader_mmd.html
@@ -18,7 +18,6 @@ top: 10px; width: 100%; text-align: center; - z-index: 100; display:block; } #info a, .button { color: #f00; font-weight: bold; text-decoration: underline; cursor: pointer }
true
Other
mrdoob
three.js
4dbe138d095ab099cfc01fec9543a1d7513396a3.json
Remove z-index of #info style from MMD examples
examples/webgl_loader_mmd_audio.html
@@ -18,7 +18,6 @@ top: 10px; width: 100%; text-align: center; - z-index: 100; display:block; } #info a, .button { color: #f00; font-weight: bold; text-decoration: underline; cursor: pointer }
true
Other
mrdoob
three.js
4dbe138d095ab099cfc01fec9543a1d7513396a3.json
Remove z-index of #info style from MMD examples
examples/webgl_loader_mmd_pose.html
@@ -18,7 +18,6 @@ top: 10px; width: 100%; text-align: center; - z-index: 100; display:block; } #info a, .button { color: #f00; font-weight: bold; text-decoration: underline; cursor: pointer }
true
Other
mrdoob
three.js
6c2627ad2f910b17e1ea8205f471134322d01365.json
remove UniformsUtils.* use in terrain/dynamic
examples/js/ShaderTerrain.js
@@ -15,10 +15,8 @@ THREE.ShaderTerrain = { 'terrain' : { - uniforms: THREE.UniformsUtils.merge( [ + uniforms: Object.assign( - THREE.UniformsLib[ "fog" ], - THREE.UniformsLib[ "lights" ], { @@ -49,9 +47,12 @@ THREE.ShaderTerrain = { "uOffset": { value: new THREE.Vector2( 0, 0 ) } - } + }, + + THREE.UniformsLib[ "fog" ], + THREE.UniformsLib[ "lights" ] - ] ), + ), fragmentShader: [
true
Other
mrdoob
three.js
6c2627ad2f910b17e1ea8205f471134322d01365.json
remove UniformsUtils.* use in terrain/dynamic
examples/webgl_terrain_dynamic.html
@@ -304,7 +304,7 @@ }; - uniformsNormal = THREE.UniformsUtils.clone( normalShader.uniforms ); + uniformsNormal = Object.assign( {}, normalShader.uniforms ); uniformsNormal.height.value = 0.05; uniformsNormal.resolution.value.set( rx, ry ); @@ -335,7 +335,7 @@ var terrainShader = THREE.ShaderTerrain[ "terrain" ]; - uniformsTerrain = THREE.UniformsUtils.clone( terrainShader.uniforms ); + uniformsTerrain = Object.assign( {}, terrainShader.uniforms ); uniformsTerrain[ 'tNormal' ].value = normalMap.texture; uniformsTerrain[ 'uNormalScale' ].value = 3.5;
true
Other
mrdoob
three.js
6c2627ad2f910b17e1ea8205f471134322d01365.json
remove UniformsUtils.* use in terrain/dynamic
gulpfile.js
@@ -0,0 +1,12 @@ +var gulp = require( 'gulp' ); +var pump = require( 'pump' ); +var connect = require( 'gulp-connect' ); + + +gulp.task('runserver', function() { + + connect.server( { root: '.', port: 8888 } ); + +}); + + gulp.task( 'default', [ 'runserver' ] );
true
Other
mrdoob
three.js
a12710d5789a71637be1c69388092d07adefbc66.json
fix terrain/dynamic so it works
examples/webgl_terrain_dynamic.html
@@ -214,7 +214,7 @@ var camera, scene; var cameraOrtho, sceneRenderTarget; - var uniformsNoise, uniformsNormal, + var uniformsNoise, uniformsNormal, uniformsTerrain, heightMap, normalMap, quadTarget; @@ -335,7 +335,7 @@ var terrainShader = THREE.ShaderTerrain[ "terrain" ]; - var uniformsTerrain = THREE.UniformsUtils.clone( terrainShader.uniforms ); + uniformsTerrain = THREE.UniformsUtils.clone( terrainShader.uniforms ); uniformsTerrain[ 'tNormal' ].value = normalMap.texture; uniformsTerrain[ 'uNormalScale' ].value = 3.5;
false
Other
mrdoob
three.js
c03600ba3f93426075b575f5120b2c7a2a691f8b.json
Add sourcemaps (#9949) This would create `build/three.js.map` and `build/three.modules.js.map` alongside the bundles. If you wanted inline sourcemaps instead (not recommended, but possible!) you would use `sourceMap: 'inline'`. Ref https://github.com/mrdoob/three.js/issues/9941
rollup.config.js
@@ -42,5 +42,6 @@ export default { dest: 'build/three.modules.js' } ], - outro: outro + outro: outro, + sourceMap: true };
false
Other
mrdoob
three.js
b781b229f82cfef4ae779432319eb5761942adbf.json
Simplify repository url (#9947) https://docs.npmjs.com/files/package.json#repository
package.json
@@ -3,6 +3,7 @@ "version": "0.82.0", "description": "JavaScript 3D library", "main": "build/three.js", + "repository": "mrdoob/three.js", "jsnext:main": "build/three.modules.js", "files": [ "package.json", @@ -28,10 +29,6 @@ "dev": "rollup -c -w", "test": "echo \"Error: no test specified\" && exit 1" }, - "repository": { - "type": "git", - "url": "https://github.com/mrdoob/three.js" - }, "keywords": [ "three", "three.js",
false
Other
mrdoob
three.js
c6f7ce7eb0d289ee6ccc53dee10221da43c50902.json
Add ToonMap support to MaterialLoader
src/loaders/MaterialLoader.js
@@ -140,6 +140,9 @@ Object.assign( MaterialLoader.prototype, { if ( json.aoMap !== undefined ) material.aoMap = getTexture( json.aoMap ); if ( json.aoMapIntensity !== undefined ) material.aoMapIntensity = json.aoMapIntensity; + if ( json.toonMap !== undefined ) material.toonMap = getTexture( json.toonMap ); + if ( json.toonMapDirectionY !== undefined ) material.toonMapDirectionY = json.toonMapDirectionY; + // MultiMaterial if ( json.materials !== undefined ) {
false
Other
mrdoob
three.js
8463151bcda6e5b5a5749d4dc5f223faf3ae4697.json
Update doc to match code (#9938)
docs/api/loaders/MTLLoader.html
@@ -1,57 +1,99 @@ -<!DOCTYPE html> -<html lang="en"> - <head> +<!DOCTYPE html> +<html lang="en"> + <head> <meta charset="utf-8" /> - <base href="../../" /> - <script src="list.js"></script> - <script src="page.js"></script> - <link type="text/css" rel="stylesheet" href="page.css" /> - </head> - <body> - - <h1>[name]</h1> - - <div class="desc">A loader for loading an <em>.mtl</em> resource, used internaly by [page:OBJMTLLoader] and [page:UTF8Loader].</div> - - - <h2>Constructor</h2> - - <h3>[name]( [page:String baseUrl], [page:Object options], [page:String crossOrigin] )</h3> - <div> - [page:String baseUrl] β€” The base url from which to find subsequent resources.<br /> - [page:Object options] β€” Options passed to the created material (side, wrap, normalizeRGB, ignoreZeroRGBs).<br /> - [page:String crossOrigin] β€” The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.<br /> - </div> - <div> - Creates a new [name]. - </div> - - <h2>Properties</h2> - - - <h2>Methods</h2> - - <h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3> - <div> - [page:String url] β€” required<br /> - [page:Function onLoad] β€” Will be called when load completes. The argument will be the loaded [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator] instance.<br /> - [page:Function onProgress] β€” Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br /> - [page:Function onError] β€” Will be called when load errors.<br /> - </div> - <div> - Begin loading from url and return the loaded material. - </div> - - <h3>[method:MTLLoaderMaterialCreator parse]( [page:String text] )</h3> - <div> - [page:String text] β€” The textual <em>mtl</em> structure to parse. - </div> - <div> - Parse a <em>mtl</em> text structure and return a [page:MTLLoaderMaterialCreator] instance.<br /> - </div> - - <h2>Source</h2> - - [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/[name].js examples/js/loaders/[name].js] - </body> -</html> + <base href="../../" /> + <script src="list.js"></script> + <script src="page.js"></script> + <link type="text/css" rel="stylesheet" href="page.css" /> + </head> + <body> + + <h1>[name]</h1> + + <div class="desc">A loader for loading an <em>.mtl</em> resource, used internaly by [page:OBJMTLLoader] and [page:UTF8Loader].</div> + + <h2>Constructor</h2> + + <h3>[name]( [page:LoadingManager loadingManager] )</h3> + <div> + [page:LoadingManager loadingManager] β€” LoadingManager to use. Defaults to [page:DefaultLoadingManager DefaultLoadingManager]<br /> + </div> + <div> + Creates a new [name]. + </div> + + <!-- <h2>Properties</h2> --> + + + <h2>Methods</h2> + + + <h3>[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )</h3> + <div> + [page:String url] β€” required<br /> + [page:Function onLoad] β€” Will be called when load completes. The argument will be the loaded [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator] instance.<br /> + [page:Function onProgress] β€” Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br /> + [page:Function onError] β€” Will be called when load errors.<br /> + </div> + <div> + Begin loading from url and return the loaded material. + </div> + + + <h3>[method:null setPath]( [page:String path] )</h3> + <div> + [page:String path] β€” required<br /> + </div> + <div> + Set base path for resolving references. If set this path will be prepended to each loaded and found reference. + </div> + + + <h3>[method:null setTexturePath]( [page:String path] )</h3> + <div> + [page:String path] β€” required<br /> + </div> + <div> + Set base path for resolving texture references. If set this path will be prepended found texture reference. If not set and setPath is, it will be used as texture base path. + </div> + + + <h3>[method:null setCrossOrigin]( [page:boolean useCrossOrigin] )</h3> + <div> + [page:boolean useCrossOrigin] β€” required<br /> + </div> + <div> + Set to true if you need to load textures from a different origin. + </div> + + + <h3>[method:null setMaterialOptions]( [page:Object options] )</h3> + <div> + [page:Object options] β€” required + <ul> + <li>side: Which side to apply the material. THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide</li> + <li>wrap: What type of wrapping to apply for textures. THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping</li> + <li>normalizeRGB: RGBs need to be normalized to 0-1 from 0-255. Default: false, assumed to be already normalized</li> + <li>ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's. Default: false</li> + </ul> + </div> + <div> + Set of options on how to construct the materials + </div> + + + <h3>[method:MTLLoaderMaterialCreator parse]( [page:String text] )</h3> + <div> + [page:String text] β€” The textual <em>mtl</em> structure to parse. + </div> + <div> + Parse a <em>mtl</em> text structure and return a [page:MTLLoaderMaterialCreator] instance.<br /> + </div> + + + <h2>Source</h2> + + [link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/[name].js examples/js/loaders/[name].js] + </body> +</html>
false
Other
mrdoob
three.js
d9a7ea4945007d0f1d8f22d310c367ddf9dc2697.json
Fix Matrix3, Matix4 applyToBuffer (#9910) * Fix Matix4 applyToBuffer `BufferAttribute.setXYZ` was missing `index` argument. * Fix Matrix3 applyToBuffer
src/math/Matrix3.js
@@ -137,7 +137,7 @@ Matrix3.prototype = { v1.applyMatrix3( this ); - buffer.setXYZ( v1.x, v1.y, v1.z ); + buffer.setXYZ( j, v1.x, v1.y, v1.z ); }
true
Other
mrdoob
three.js
d9a7ea4945007d0f1d8f22d310c367ddf9dc2697.json
Fix Matrix3, Matix4 applyToBuffer (#9910) * Fix Matix4 applyToBuffer `BufferAttribute.setXYZ` was missing `index` argument. * Fix Matrix3 applyToBuffer
src/math/Matrix4.js
@@ -490,7 +490,7 @@ Matrix4.prototype = { v1.applyMatrix4( this ); - buffer.setXYZ( v1.x, v1.y, v1.z ); + buffer.setXYZ( j, v1.x, v1.y, v1.z ); }
true
Other
mrdoob
three.js
c18be1eca38a1f3c779e8dcb168edf06ee9441ad.json
Update documentation for r81 (#9919)
docs/api/math/Box2.html
@@ -86,7 +86,7 @@ <h3>[method:Box2 setFromPoints]( [page:Array points] ) [page:Box2 this]</h3> Sets the upper and lower bounds of this box to include all of the points in *points*. </div> - <h3>[method:Vector2 size]( [page:Vector2 optionalTarget] ) [page:Box2 this]</h3> + <h3>[method:Vector2 getSize]( [page:Vector2 optionalTarget] ) [page:Box2 this]</h3> <div> optionalTarget -- If specified, the result will be copied here. </div> @@ -194,7 +194,7 @@ <h3>[method:Box2 makeEmpty]() [page:Box2 this]</h3> Makes this box empty. </div> - <h3>[method:Vector2 center]( [page:Vector2 optionalTarget] ) [page:Box2 this]</h3> + <h3>[method:Vector2 getCenter]( [page:Vector2 optionalTarget] ) [page:Box2 this]</h3> <div> optionalTarget -- If specified, the result will be copied here. </div>
true
Other
mrdoob
three.js
c18be1eca38a1f3c779e8dcb168edf06ee9441ad.json
Update documentation for r81 (#9919)
docs/api/math/Box3.html
@@ -112,7 +112,7 @@ <h3>[method:Box3 setFromObject]( [page:Object3D object] ) [page:Box3 this]</h3> - <h3>[method:Vector3 size]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3> + <h3>[method:Vector3 getSize]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3> <div> optionalTarget -- If specified, the result will be copied here. </div> @@ -237,7 +237,7 @@ <h3>[method:Box3 makeEmpty]() [page:Box3 this]</h3> Makes this box empty. </div> - <h3>[method:Vector3 center]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3> + <h3>[method:Vector3 getCenter]( [page:Vector3 optionalTarget] ) [page:Box3 this]</h3> <div> optionalTarget -- If specified, the result will be copied here. </div>
true
Other
mrdoob
three.js
c18be1eca38a1f3c779e8dcb168edf06ee9441ad.json
Update documentation for r81 (#9919)
docs/api/math/Line3.html
@@ -95,7 +95,7 @@ <h3>[method:Vector3 at]( [page:Float t], [page:Vector3 optionalTarget] )</h3> Return a vector at a certain position along the line. When t = 0, it returns the start vector, and when t=1 it returns the end vector. </div> - <h3>[method:Vector3 center]( [page:Vector3 optionalTarget] )</h3> + <h3>[method:Vector3 getCenter]( [page:Vector3 optionalTarget] )</h3> <div> optionalTarget -- [page:Vector3] Optional target to set the result. </div>
true
Other
mrdoob
three.js
0eaa2c674298858bdb5be7bd002c36d7e84bbe14.json
Fix some MMDLoader bugs (#9920)
examples/js/loaders/MMDLoader.js
@@ -2253,7 +2253,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress m.skinning = geometry.bones.length > 0 ? true : false; m.morphTargets = geometry.morphTargets.length > 0 ? true : false; m.lights = true; - m.side = p.side; + m.side = ( model.metadata.format === 'pmx' && ( p2.flag & 0x1 ) === 1 ) ? THREE.DoubleSide : p.side; m.transparent = p.transparent; m.fog = true; @@ -2459,7 +2459,7 @@ THREE.MMDLoader.prototype.createMesh = function ( model, texturePath, onProgress alpha: p2.edgeColor[ 3 ] }; - if ( m.outlineParameters.thickness === 0.0 ) m.outlineParameters.visible = false; + if ( ( p2.flag & 0x10 ) === 0 || m.outlineParameters.thickness === 0.0 ) m.outlineParameters.visible = false; m.uniforms.celShading.value = 1; @@ -2846,21 +2846,14 @@ THREE.MMDLoader.prototype.leftToRightModel = function ( model ) { var m = model.morphs[ i ]; - if ( model.metadata.format === 'pmx' ) { - - if ( m.type === 1 ) { + if ( model.metadata.format === 'pmx' && m.type !== 1 ) { - m = m.elements; - - } else { - - continue; - - } + // TODO: implement + continue; } - for ( var j = 0; j < m.elementCount; j++ ) { + for ( var j = 0; j < m.elements.length; j++ ) { helper.leftToRightVector3( m.elements[ j ].position );
false
Other
mrdoob
three.js
0a5d2c1e0b3be0f08fede84a92c3d7b40b78b987.json
Restore light setting for MMDLoader example.
examples/webgl_loader_mmd.html
@@ -76,10 +76,10 @@ scene = new THREE.Scene(); - var ambient = new THREE.AmbientLight( 0x444444 ); + var ambient = new THREE.AmbientLight( 0x666666 ); scene.add( ambient ); - var directionalLight = new THREE.DirectionalLight( 0x888888 ); + var directionalLight = new THREE.DirectionalLight( 0x887766 ); directionalLight.position.set( -1, 1, 1 ).normalize(); scene.add( directionalLight );
false
Other
mrdoob
three.js
1e6894562b43bcc81dac6d3c91121f07260d41e4.json
Improve robustness of retrieving WebGL version
src/renderers/webgl/WebGLState.js
@@ -336,7 +336,9 @@ function WebGLState( gl, extensions, paramThreeToGL ) { var maxTextures = gl.getParameter( gl.MAX_TEXTURE_IMAGE_UNITS ); - var lineWidthAvailable = parseFloat(gl.getParameter(gl.VERSION).split(' ')[1]) >= 1.0; + var glVersion = gl.getParameter(gl.VERSION).split(' ')[1]; + var glMajorVersion = glVersion.split('.').slice(0, 2).join('.'); + var lineWidthAvailable = parseFloat(glMajorVersion) >= 1.0; var currentTextureSlot = null; var currentBoundTextures = {};
false
Other
mrdoob
three.js
d8e0e3db7fc2a995d67a26fae28213412a1bba04.json
add documentation for the Layers object. (#9892)
docs/api/cameras/Camera.html
@@ -33,6 +33,10 @@ <h3>[property:Matrix4 matrixWorldInverse]</h3> <h3>[property:Matrix4 projectionMatrix]</h3> <div>This is the matrix which contains the projection.</div> + <h3>[property:Layers layers]</h3> + <div> + The layer membership of the camera. Only objects that have at least one layer in common with the camera will be visible. + </div> <h2>Methods</h2>
true
Other
mrdoob
three.js
d8e0e3db7fc2a995d67a26fae28213412a1bba04.json
add documentation for the Layers object. (#9892)
docs/api/core/Layers.html
@@ -0,0 +1,81 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8" /> + <base href="../../" /> + <script src="list.js"></script> + <script src="page.js"></script> + <link type="text/css" rel="stylesheet" href="page.css" /> + </head> + <body> + <h1>[name]</h1> + + <div class="desc"> + An object providing a bit mask and accessor method used to control an [page:Object3D]'s visibility. + A [page:Layers] object assigns an [page:Object3D] to 0 or more of 32 layers numbered 0 to 31. + </div> + + + <h2>Constructor</h2> + + + <h3>[name]()</h3> + <div> + Create a new Layers object, with an initial mask set to layer 1. + </div> + + <h2>Properties</h2> + + <h3>[property:Integer mask]</h3> + <div> + Internal layer mask. + </div> + + + <h2>Methods</h2> + + <h3>[method:null set]( [page:Integer layer] )</h3> + <div> + layer - an integer from 0 to 31. + </div> + <div> + Set the layer mask to the value *layer*. + </div> + + <h3>[method:null enable]( [page:Integer layer] )</h3> + <div> + layer - an integer from 0 to 31. + </div> + <div> + Add *layer* to the mask. + </div> + + <h3>[method:null disable]( [page:Integer layer] )</h3> + <div> + layer - an integer from 0 to 31. + </div> + <div> + Remove *layer* from the mask. + </div> + + <h3>[method:null toggle]( [page:Integer layer] )</h3> + <div> + layer - an integer from 0 to 31. + </div> + <div> + Toggle the *layer* value in the mask. + </div> + + <h3>[method:Boolean test]( [page:Integer layers] )</h3> + <div> + layers - a 32bit bit mask of layer numbers. + </div> + <div> + Returns true if *layers* and .mask have any bits set in common. + </div> + + <h2>Source</h2> + + [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] + </body> +</html>
true
Other
mrdoob
three.js
d8e0e3db7fc2a995d67a26fae28213412a1bba04.json
add documentation for the Layers object. (#9892)
docs/api/core/Object3D.html
@@ -153,6 +153,11 @@ <h3>[property:Number renderOrder]</h3> This value allows the default rendering order of scene graph objects to be overridden although opaque and transparent objects remain sorted independently. Sorting is from lowest to highest renderOrder. Default value is 0. </div> + <h3>[property:Layers layers]</h3> + <div> + The layer membership of the object. The object is only visible if it has at least one layer in common with the [page:Camera] in use. + </div> + <h2>Methods</h2> <h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
true
Other
mrdoob
three.js
d8e0e3db7fc2a995d67a26fae28213412a1bba04.json
add documentation for the Layers object. (#9892)
docs/list.js
@@ -31,6 +31,7 @@ var list = { [ "EventDispatcher", "api/core/EventDispatcher" ], [ "Face3", "api/core/Face3" ], [ "Geometry", "api/core/Geometry" ], + [ "Layers", "api/core/Layers" ], [ "Object3D", "api/core/Object3D" ], [ "Raycaster", "api/core/Raycaster" ], [ "Uniform", "api/core/Uniform"]
true
Other
mrdoob
three.js
435ed397331d5c2e9cc041e52d6e4a3f0a9391d1.json
Add missing semicolon in webgl_gpu_particle_system
examples/webgl_gpu_particle_system.html
@@ -80,7 +80,7 @@ horizontalSpeed: 1.5, verticalSpeed: 1.33, timeScale: 1 - } + }; gui.add(options, "velocityRandomness", 0, 3); gui.add(options, "positionRandomness", 0, 3);
false
Other
mrdoob
three.js
c6e3f5aeb24760e2fbabc937702212d58e8b82c3.json
Remove unnecessary comme in webgl_extrude_splines
examples/webgl_geometry_extrude_splines.html
@@ -66,7 +66,7 @@ new THREE.Vector3( 0, 40, -40 ), new THREE.Vector3( 0, 140, -40 ), new THREE.Vector3( 0, 40, 40 ), - new THREE.Vector3( 0, -40, 40 ), + new THREE.Vector3( 0, -40, 40 ) ] ); sampleClosedSpline.type = 'catmullrom';
false
Other
mrdoob
three.js
b7249cb312e42d75d463de2d2bcea1cdac130833.json
Remove unnecessary comme in webgl_extrude_shape2
examples/webgl_geometry_extrude_shapes2.html
@@ -292,7 +292,7 @@ color = new THREE.Color( theColors[i] ); material = new THREE.MeshLambertMaterial({ color: color, - emissive: color, + emissive: color }); amount = theAmounts[i]; simpleShapes = path.toShapes(true);
false
Other
mrdoob
three.js
8360e8358876305d7ed46c1ad735d5b0c540c83c.json
Remove unnecessary comme in webgl_extrude_shapes
examples/webgl_geometry_extrude_shapes.html
@@ -165,7 +165,7 @@ bevelEnabled : true, bevelThickness : 2, bevelSize : 4, - bevelSegments : 1, + bevelSegments : 1 }; var geometry = new THREE.ExtrudeGeometry( shape, extrudeSettings );
false
Other
mrdoob
three.js
399d806f01982b0105d46287f660fa8638a2a016.json
Add missing semicolon in webgl_depth_texture
examples/webgl_depth_texture.html
@@ -196,7 +196,7 @@ // Setup some geometries var geometry = new THREE.TorusKnotGeometry(1, 0.3, 128, 64); - var material = new THREE.MeshBasicMaterial({ color: 'blue' }) + var material = new THREE.MeshBasicMaterial({ color: 'blue' }); var count = 50; var scale = 5;
false
Other
mrdoob
three.js
c86d149f5236185826de5bb800ad98d3eb8f943d.json
Add missing semicolon in webgl_animation_cloth
examples/webgl_animation_cloth.html
@@ -295,7 +295,7 @@ window.addEventListener( 'resize', onWindowResize, false ); - sphere.visible = ! true + sphere.visible = ! true; }
false
Other
mrdoob
three.js
5a0df2a6261ee5aa04d6999baf84380f8610e5b6.json
Add missing semicolon in software_sandbox
examples/software_sandbox.html
@@ -104,7 +104,7 @@ var points = hilbert3D( new THREE.Vector3( 0,0,0 ), 200.0, 1, 0, 1, 2, 3, 4, 5, 6, 7 ); var spline = new THREE.Spline( points ); var n_sub = 6, colors = [], line; - var lineGeometry = new THREE.Geometry() + var lineGeometry = new THREE.Geometry(); for ( i = 0; i < points.length * n_sub; i ++ ) {
false
Other
mrdoob
three.js
b18791818da7f24a04d79bd796035f6b626f0784.json
Add missing semicolon in raytracing_sandbox
examples/raytracing_sandbox.html
@@ -247,7 +247,7 @@ info.style.textAlign = 'center'; container.appendChild( info ); - updateWorkers() + updateWorkers(); //
false
Other
mrdoob
three.js
3e224e091e01f987e002f743d4343298d4b0929d.json
Add missing semicolon in misc_sound
examples/misc_sound.html
@@ -171,7 +171,7 @@ var GeneratorControls = function() { this.frequency = oscillator.frequency.value; this.wavetype = oscillator.type; - } + }; var gui = new dat.GUI(); var soundControls = new SoundControls(); var generatorControls = new GeneratorControls();
false
Other
mrdoob
three.js
a9905bc6ffb01f7bd546770e1379417dba9ec4ae.json
Add missing semicolon in index.html
examples/index.html
@@ -244,7 +244,7 @@ <h1><a href="http://threejs.org">three.js</a> / examples</h1> <script> function extractQuery() { - var p = window.location.search.indexOf( '?q=' ) + var p = window.location.search.indexOf( '?q=' ); if( p !== -1 ) { return window.location.search.substr( 3 ); } @@ -383,7 +383,7 @@ <h1><a href="http://threejs.org">three.js</a> / examples</h1> } else { window.history.replaceState( {} , '', window.location.pathname ); } - if( selected ) window.location.hash = selected + if( selected ) window.location.hash = selected; var exp = new RegExp( v, 'gi' ); @@ -473,7 +473,7 @@ <h1><a href="http://threejs.org">three.js</a> / examples</h1> } - filterInput.value = extractQuery() + filterInput.value = extractQuery(); updateFilter( ) </script>
false
Other
mrdoob
three.js
d8a6ab85bd1016c5628cf00cd5ea174d9b8cfc8f.json
Add missing semicolon in VolumeSlice
examples/js/VolumeSlice.js
@@ -85,7 +85,7 @@ THREE.VolumeSlice = function( volume, index, axis ) { */ -} +}; THREE.VolumeSlice.prototype = { @@ -214,4 +214,4 @@ THREE.VolumeSlice.prototype = { } -} +};
false
Other
mrdoob
three.js
f81eb19ea78cbd5ce69db8ac3f51efc5a7f035b5.json
Remove unnecessary comma in SkyShader
examples/js/SkyShader.js
@@ -98,7 +98,7 @@ THREE.ShaderLib[ 'sky' ] = { // mie coefficients "vBetaM = totalMie(lambda, turbidity) * mieCoefficient;", - "}", + "}" ].join( "\n" ), @@ -201,7 +201,7 @@ THREE.ShaderLib[ 'sky' ] = { "gl_FragColor.rgb = retColor;", "gl_FragColor.a = 1.0;", - "}", + "}" ].join( "\n" )
false
Other
mrdoob
three.js
98da28a50e97792e1e9a3746266c88028f65fb41.json
Add missing semicolon in RollerCoaster
examples/js/RollerCoaster.js
@@ -265,19 +265,19 @@ var RollerCoasterLiftersGeometry = function ( curve, size ) { var point1 = shape[ j ]; var point2 = shape[ ( j + 1 ) % jl ]; - vector1.copy( point1 ) + vector1.copy( point1 ); vector1.applyQuaternion( quaternion ); vector1.add( fromPoint ); - vector2.copy( point2 ) + vector2.copy( point2 ); vector2.applyQuaternion( quaternion ); vector2.add( fromPoint ); - vector3.copy( point2 ) + vector3.copy( point2 ); vector3.applyQuaternion( quaternion ); vector3.add( toPoint ); - vector4.copy( point1 ) + vector4.copy( point1 ); vector4.applyQuaternion( quaternion ); vector4.add( toPoint );
false
Other
mrdoob
three.js
bd958a146ad1423f2775d942649cb017544edd3e.json
Add missing semicolon in GPUComputationRenderer
examples/js/GPUComputationRenderer.js
@@ -258,7 +258,7 @@ function GPUComputationRenderer( sizeX, sizeY, renderer ) { materialShader.defines.resolution = 'vec2( ' + sizeX.toFixed( 1 ) + ', ' + sizeY.toFixed( 1 ) + " )"; - }; + } this.addResolutionDefine = addResolutionDefine; @@ -277,7 +277,7 @@ function GPUComputationRenderer( sizeX, sizeY, renderer ) { addResolutionDefine( material ); return material; - }; + } this.createShaderMaterial = createShaderMaterial; this.createRenderTarget = function( sizeXTexture, sizeYTexture, wrapS, wrapT, minFilter, magFilter ) { @@ -367,4 +367,4 @@ function GPUComputationRenderer( sizeX, sizeY, renderer ) { } -} \ No newline at end of file +}
false
Other
mrdoob
three.js
65adaab2e52f6d3e93106425c10db6f912386daa.json
Add missing semicolon in Encodings
examples/js/Encodings.js
@@ -5,7 +5,7 @@ THREE.Encodings = function() { if( THREE.toHalf === undefined ) throw new Error("THREE.Encodings is required for HDRCubeMapLoader when loading half data."); -} +}; THREE.Encodings.RGBEByteToRGBFloat = function( sourceArray, sourceOffset, destArray, destOffset ) { var e = sourceArray[sourceOffset+3]; @@ -14,7 +14,7 @@ THREE.Encodings.RGBEByteToRGBFloat = function( sourceArray, sourceOffset, destAr destArray[destOffset+0] = sourceArray[sourceOffset+0] * scale; destArray[destOffset+1] = sourceArray[sourceOffset+1] * scale; destArray[destOffset+2] = sourceArray[sourceOffset+2] * scale; -} +}; THREE.Encodings.RGBEByteToRGBHalf = function( sourceArray, sourceOffset, destArray, destOffset ) { var e = sourceArray[sourceOffset+3]; @@ -23,4 +23,4 @@ THREE.Encodings.RGBEByteToRGBHalf = function( sourceArray, sourceOffset, destArr destArray[destOffset+0] = THREE.toHalf( sourceArray[sourceOffset+0] * scale ); destArray[destOffset+1] = THREE.toHalf( sourceArray[sourceOffset+1] * scale ); destArray[destOffset+2] = THREE.toHalf( sourceArray[sourceOffset+2] * scale ); -} +};
false
Other
mrdoob
three.js
79eba2ac3596a3be6c88640d8abe297636d914ea.json
Remove unnecessary comma in TechnicolorShader
examples/js/shaders/TechnicolorShader.js
@@ -11,7 +11,7 @@ THREE.TechnicolorShader = { uniforms: { - "tDiffuse": { value: null }, + "tDiffuse": { value: null } },
false
Other
mrdoob
three.js
e2773b2bc6942f685210709c313d3c62750b697b.json
Remove unnecessary comma in ParallaxShader
examples/js/shaders/ParallaxShader.js
@@ -10,7 +10,7 @@ THREE.ParallaxShader = { basic: 'USE_BASIC_PARALLAX', steep: 'USE_STEEP_PARALLAX', occlusion: 'USE_OCLUSION_PARALLAX', // a.k.a. POM - relief: 'USE_RELIEF_PARALLAX', + relief: 'USE_RELIEF_PARALLAX' }, uniforms: { @@ -177,7 +177,7 @@ THREE.ParallaxShader = { "vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );", "gl_FragColor = texture2D( map, mapUv );", - "}", + "}" ].join( "\n" )
false
Other
mrdoob
three.js
59162563eddb4fab7f294560bdfdf2cc0c5abfd7.json
Remove unnecessary comma in OceanShader
examples/js/shaders/OceanShaders.js
@@ -86,7 +86,7 @@ THREE.ShaderLib[ 'ocean_initial_spectrum' ] = { uniforms: { "u_wind": { value: new THREE.Vector2( 10.0, 10.0 ) }, "u_resolution": { value: 512.0 }, - "u_size": { value: 250.0 }, + "u_size": { value: 250.0 } }, fragmentShader: [ 'precision highp float;', @@ -163,7 +163,7 @@ THREE.ShaderLib[ 'ocean_phase' ] = { "u_phases": { value: null }, "u_deltaTime": { value: null }, "u_resolution": { value: null }, - "u_size": { value: null }, + "u_size": { value: null } }, fragmentShader: [ 'precision highp float;', @@ -204,7 +204,7 @@ THREE.ShaderLib[ 'ocean_spectrum' ] = { "u_resolution": { value: null }, "u_choppiness": { value: null }, "u_phases": { value: null }, - "u_initialSpectrum": { value: null }, + "u_initialSpectrum": { value: null } }, fragmentShader: [ 'precision highp float;', @@ -266,7 +266,7 @@ THREE.ShaderLib[ 'ocean_normals' ] = { uniforms: { "u_displacementMap": { value: null }, "u_resolution": { value: null }, - "u_size": { value: null }, + "u_size": { value: null } }, fragmentShader: [ 'precision highp float;', @@ -308,7 +308,7 @@ THREE.ShaderLib[ 'ocean_main' ] = { "u_skyColor": { value: null }, "u_oceanColor": { value: null }, "u_sunDirection": { value: null }, - "u_exposure": { value: null }, + "u_exposure": { value: null } }, vertexShader: [ 'precision highp float;',
false
Other
mrdoob
three.js
e40766b5e819230f6ecfc6b8b6b8d83ca7f37b5e.json
Remove unnecessary comma in GammaCorrectionShader
examples/js/shaders/GammaCorrectionShader.js
@@ -9,7 +9,7 @@ THREE.GammaCorrectionShader = { uniforms: { - "tDiffuse": { value: null }, + "tDiffuse": { value: null } },
false
Other
mrdoob
three.js
f32d8bf75146a4ea5ed836674eed13b5990ad04b.json
Remove unnecessary comma in EdgeShader2
examples/js/shaders/EdgeShader2.js
@@ -12,7 +12,7 @@ THREE.EdgeShader2 = { uniforms: { "tDiffuse": { value: null }, - "aspect": { value: new THREE.Vector2( 512, 512 ) }, + "aspect": { value: new THREE.Vector2( 512, 512 ) } }, vertexShader: [ @@ -66,7 +66,7 @@ THREE.EdgeShader2 = { "}", "gl_FragColor = vec4(0.5 * sqrt(cnv[0]*cnv[0]+cnv[1]*cnv[1]));", - "} ", + "} " ].join( "\n" )
false
Other
mrdoob
three.js
67986fe8f2892733300066fc1bcbbbf767486106.json
Remove unnecessary comma in ConvolutionShader
examples/js/shaders/ConvolutionShader.js
@@ -11,7 +11,7 @@ THREE.ConvolutionShader = { defines: { "KERNEL_SIZE_FLOAT": "25.0", - "KERNEL_SIZE_INT": "25", + "KERNEL_SIZE_INT": "25" },
false
Other
mrdoob
three.js
1ff4e4568d3d2623b3e7af45cd3d8a51f5ec2d60.json
Remove unnecessary comma in BokehShader2
examples/js/shaders/BokehShader2.js
@@ -44,7 +44,7 @@ THREE.BokehShader = { "pentagon": { value: 0 }, "shaderFocus": { value: 1 }, - "focusCoords": { value: new THREE.Vector2() }, + "focusCoords": { value: new THREE.Vector2() } },
false
Other
mrdoob
three.js
af43c8797a337aaa288f5b338ef38dcd6557f7c0.json
Update Creating-a-scene.html (#9759) Corrected the spelling of argument in docs/manual/introduction/Creating-a-scene.html
docs/manual/introduction/Creating-a-scene.html
@@ -61,7 +61,7 @@ <h2>Creating the scene</h2> <div>In addition to creating the renderer instance, we also need to set the size at which we want it to render our app. It's a good idea to use the width and height of the area we want to fill with our app - in this case, the width and height of the browser window. For performance intensive apps, you can also give <strong>setSize</strong> smaller values, like <strong>window.innerWidth/2</strong> and <strong>window.innerHeight/2</strong>, which will make the app render at half size.</div> - <div>If you wish to keep the size of your app but render it at a lower resolution, you can do so by calling <strong>setSize</strong> with false as <strong>updateStyle</strong> (the third arugment). For example, <strong>setSize(window.innerWidth/2, window.innerHeight/2, false)</strong> will render your app at half resolution, given that your &lt;canvas&gt; has 100% width and height.</div> + <div>If you wish to keep the size of your app but render it at a lower resolution, you can do so by calling <strong>setSize</strong> with false as <strong>updateStyle</strong> (the third argument). For example, <strong>setSize(window.innerWidth/2, window.innerHeight/2, false)</strong> will render your app at half resolution, given that your &lt;canvas&gt; has 100% width and height.</div> <div>Last but not least, we add the <strong>renderer</strong> element to our HTML document. This is a &lt;canvas&gt; element the renderer uses to display the scene to us.</div>
false
Other
mrdoob
three.js
bc0696718d5fc2ee4c83acd0906559a83a547983.json
Add Delimiter to regex for trackName (#9696)
src/animation/PropertyBinding.js
@@ -540,10 +540,11 @@ PropertyBinding.parseTrackName = function( trackName ) { // uuid.objectName[objectIndex].propertyName[propertyIndex] // parentName/nodeName.property // parentName/parentName/nodeName.property[index] - // .bone[Armature.DEF_cog].position + // .bone[Armature.DEF_cog].position + // scene:helium_balloon_model:helium_balloon_model.position // created and tested via https://regex101.com/#javascript - var re = /^((?:\w+\/)*)(\w+)?(?:\.(\w+)(?:\[(.+)\])?)?\.(\w+)(?:\[(.+)\])?$/; + var re = /^((?:\w+[\/:])*)(\w+)?(?:\.(\w+)(?:\[(.+)\])?)?\.(\w+)(?:\[(.+)\])?$/; var matches = re.exec( trackName ); if ( ! matches ) {
false