Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge dev #2

Merged
merged 76 commits into from
Jul 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
c87ca5d
BVHLoader & example (#9188)
Jun 23, 2016
d5e3bdd
BVHLoader: Clean up.
mrdoob Jun 23, 2016
b3faac7
Minor clean up.
mrdoob Jun 23, 2016
9631648
CurvePath: getPoints() should respect last point (#9169)
zz85 Jun 23, 2016
0226662
Clean up (#9199)
WestLangley Jun 23, 2016
aa69bd3
GridHelper: Changed step to segments. See #9193.
mrdoob Jun 23, 2016
a070071
Updated builds.
mrdoob Jun 23, 2016
1af21bc
Updated GridHelper ussages.
mrdoob Jun 23, 2016
14991dc
GridHelper: Renamed segments to divisions. See #9193.
mrdoob Jun 24, 2016
52b970f
Updated builds.
mrdoob Jun 24, 2016
1a984f9
Shadows on Buffergeometry with morphAttributes (#9184)
Astrak Jun 24, 2016
74b3522
WebGLShadowMap: Reworked useMorphing check code.
mrdoob Jun 24, 2016
d8bc876
Updated builds.
mrdoob Jun 24, 2016
35216e7
fix ImageLoader manager issue (#9176)
indif Jun 24, 2016
4631447
Clean up.
mrdoob Jun 24, 2016
a88d56a
Updated builds.
mrdoob Jun 24, 2016
7e45066
Added Manhattan distance (#9206)
WestLangley Jun 24, 2016
929869c
Updated builds.
mrdoob Jun 24, 2016
c3f6aca
Make AMF Loader preserve part names, issue #9214 (#9215)
EnricSala Jun 24, 2016
46c1aa4
Update ISSUE_TEMPLATE.md (#9212)
gero3 Jun 24, 2016
20391b0
Merge branch 'master' into dev
mrdoob Jun 24, 2016
79caa2d
not used libs and repeated (#9219)
sunag Jun 24, 2016
14a0091
Merge branch 'master' into dev
mrdoob Jun 24, 2016
4533e97
Removed UVs from geometry (#9220)
WestLangley Jun 24, 2016
e29fccd
GLTFLoader: Added Uint32Array support. #9205
mrdoob Jun 24, 2016
d651bbc
Repeated subexpression in MTLLoader.js (#9207)
kilida Jun 24, 2016
97ffef1
Fix problems with non floating type in InterleavedBufferAttribute. (#…
Dvad Jun 24, 2016
346af5f
Updated builds.
mrdoob Jun 24, 2016
8c91b85
Clean up.
mrdoob Jun 24, 2016
a350f91
Use flat vertex normals (#9221)
WestLangley Jun 24, 2016
1104e26
Brighter webvr examples.
mrdoob Jun 25, 2016
5f73e14
Editor: Added WebVR support.
mrdoob Jun 25, 2016
c35438a
Merge branch 'master' into dev
mrdoob Jun 25, 2016
e07f90b
Editor: Proper App.dispose()
mrdoob Jun 25, 2016
579d6d9
Merge branch 'master' into dev
mrdoob Jun 25, 2016
7f0e131
Improve example (#9223)
WestLangley Jun 25, 2016
448423a
view source support (#9225)
verteAzur Jun 26, 2016
beed901
Examples: Clean up.
mrdoob Jun 26, 2016
40a20cc
Added webkit-playsinline to video examples.
mrdoob Jun 26, 2016
3e6696e
fixed Animation Keyframe IO (#9192)
ShynRou Jun 27, 2016
da0d1c1
Save memory by loading JPEGs as RGB by default (#9203)
Oletus Jun 27, 2016
6cec110
TextureLoader: Clean up.
mrdoob Jun 27, 2016
bb98531
Added clear coat energy conservation (#9238)
WestLangley Jun 28, 2016
aa078fa
added editor gamma options #2 (#9231)
thmasn Jun 28, 2016
fc66a1e
Editor: Gamma UI clean up.
mrdoob Jun 28, 2016
1f41957
Updated builds.
mrdoob Jun 28, 2016
f52585d
Material variations examples clean up.
mrdoob Jun 28, 2016
8deb302
fix set automatic .transparent NodeMaterial (#9243)
sunag Jun 28, 2016
34ed69b
Merge branch 'master' into dev
mrdoob Jun 28, 2016
cb71bd0
build.js ux improvements (#9237)
abelnation Jun 28, 2016
2be6078
Docs: Fixed BufferGeometry index itemSize. See #9236.
mrdoob Jun 28, 2016
fc72061
GLTFLoader: Added basic material/textures support.
mrdoob Jun 29, 2016
14c4cca
GLTFLoader: Clean up.
mrdoob Jun 29, 2016
9318d75
Texture.toJSON(): flipY support.
mrdoob Jun 29, 2016
414e5fb
ObjectLoader: handleTexture clean up.
mrdoob Jun 29, 2016
24a8ff5
Updated builds.
mrdoob Jun 29, 2016
b740dbf
Editor: Clean up fog UI.
mrdoob Jun 29, 2016
f9f3048
VREffect: Check autoClear before clear()ing.
mrdoob Jun 30, 2016
9bc935a
Editor/App: More robust vr camera.
mrdoob Jun 30, 2016
7209a5b
Merge branch 'master' into dev
mrdoob Jun 30, 2016
9b45897
Editor/App: More robust gamma handling.
mrdoob Jun 30, 2016
a723031
Added the missing core/Layers.js, and removed core/Face4.js, from the…
photonstorm Jun 30, 2016
4b60f04
Merge branch 'master' into dev
mrdoob Jun 30, 2016
3be3e5e
Use VRDisplays's requestAnimationFrame if VR headset connected (#9252)
mkeblx Jun 30, 2016
c1c8b4a
VRControls/VREffect: Added getVRDisplay. See #9133 #9252.
mrdoob Jun 30, 2016
81c05ef
VRControls/VREffect: Clean up.
mrdoob Jun 30, 2016
44ca421
VRControls/VREffect: Added getVRDisplays(). See #9133.
mrdoob Jun 30, 2016
b239812
SpritePlugin: Handle material.visible. Fixes #9257.
mrdoob Jun 30, 2016
b47f62a
Updated builds.
mrdoob Jun 30, 2016
2b6042a
Editor/App: Not sure where this came from.
mrdoob Jun 30, 2016
0f6e9c6
Fix for background clipping when using logarithmicDepthBuffer (#9259)
jbaicoianu Jun 30, 2016
50ad44c
WebGLRenderer: Clean up.
mrdoob Jun 30, 2016
8dcd65e
CurvePath.getPoints() for Arcs resolution should be doubled (#9168)
zz85 Jul 1, 2016
2dc18e6
For box3, the setFromCenterAndSize method description should contain …
iefreer Jul 1, 2016
e51d15c
Remove mouseout handlers from OrbitControls (#8832)
unconed Jul 1, 2016
10e71fe
Editor/App: Fixed setSize() and better dispose().
mrdoob Jul 1, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
##### Three.js version

- [ ] Dev
- [ ] r77
- [ ] r78
- [ ] ...

##### Browser
Expand Down
120 changes: 92 additions & 28 deletions build/three.js
Original file line number Diff line number Diff line change
Expand Up @@ -1834,6 +1834,12 @@ THREE.Vector2.prototype = {

},

distanceToManhattan: function ( v ) {

return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y );

},

setLength: function ( length ) {

return this.multiplyScalar( length / this.length() );
Expand Down Expand Up @@ -2576,6 +2582,12 @@ THREE.Vector3.prototype = {

},

distanceToManhattan: function ( v ) {

return Math.abs( this.x - v.x ) + Math.abs( this.y - v.y ) + Math.abs( this.z - v.z );

},

setFromSpherical: function( s ) {

var sinPhiRadius = Math.sin( s.phi ) * s.radius;
Expand Down Expand Up @@ -9765,14 +9777,16 @@ THREE.InstancedInterleavedBuffer.prototype.copy = function ( source ) {
* @author benaadams / https://twitter.com/ben_a_adams
*/

THREE.InterleavedBufferAttribute = function ( interleavedBuffer, itemSize, offset ) {
THREE.InterleavedBufferAttribute = function ( interleavedBuffer, itemSize, offset, normalized ) {

this.uuid = THREE.Math.generateUUID();

this.data = interleavedBuffer;
this.itemSize = itemSize;
this.offset = offset;

this.normalized = normalized === true;

};


Expand All @@ -9793,6 +9807,12 @@ THREE.InterleavedBufferAttribute.prototype = {

},

get array() {

return this.data.array;

},

setX: function ( index, x ) {

this.data.array[ index * this.data.stride + this.offset ] = x;
Expand Down Expand Up @@ -13505,7 +13525,7 @@ Object.assign( THREE.AnimationClip, {
} else {
// ...assume skeletal animation

var boneName = '.bones[' + bones[ h ].name + ']';
var boneName = '.bones[' + bones[ hierarchyTracks[h].parent ].name + ']';

addNonemptyTrack(
THREE.VectorKeyframeTrack, boneName + '.position',
Expand Down Expand Up @@ -18500,12 +18520,17 @@ Object.assign( THREE.ImageLoader.prototype, {

load: function ( url, onLoad, onProgress, onError ) {

var scope = this;

var image = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'img' );
image.onload = function () {

URL.revokeObjectURL( image.src );

if ( onLoad ) onLoad( image );

scope.manager.itemEnd( url );

};

if ( url.indexOf( 'data:' ) === 0 ) {
Expand All @@ -18514,7 +18539,7 @@ Object.assign( THREE.ImageLoader.prototype, {

} else {

var loader = new THREE.XHRLoader( this.manager );
var loader = new THREE.XHRLoader();
loader.setPath( this.path );
loader.setResponseType( 'blob' );
loader.load( url, function ( blob ) {
Expand All @@ -18525,6 +18550,8 @@ Object.assign( THREE.ImageLoader.prototype, {

}

scope.manager.itemStart( url );

return image;

},
Expand Down Expand Up @@ -19806,19 +19833,24 @@ Object.assign( THREE.ObjectLoader.prototype, {
texture.uuid = data.uuid;

if ( data.name !== undefined ) texture.name = data.name;

if ( data.mapping !== undefined ) texture.mapping = parseConstant( data.mapping );
if ( data.offset !== undefined ) texture.offset = new THREE.Vector2( data.offset[ 0 ], data.offset[ 1 ] );
if ( data.repeat !== undefined ) texture.repeat = new THREE.Vector2( data.repeat[ 0 ], data.repeat[ 1 ] );
if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter );
if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter );
if ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy;
if ( Array.isArray( data.wrap ) ) {

if ( data.offset !== undefined ) texture.offset.fromArray( data.offset );
if ( data.repeat !== undefined ) texture.repeat.fromArray( data.repeat );
if ( data.wrap !== undefined ) {

texture.wrapS = parseConstant( data.wrap[ 0 ] );
texture.wrapT = parseConstant( data.wrap[ 1 ] );

}

if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter );
if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter );
if ( data.anisotropy !== undefined ) texture.anisotropy = data.anisotropy;

if ( data.flipY !== undefined ) texture.flipY = data.flipY;

textures[ data.uuid ] = texture;

}
Expand Down Expand Up @@ -20055,6 +20087,10 @@ Object.assign( THREE.TextureLoader.prototype, {
loader.setPath( this.path );
loader.load( url, function ( image ) {

// JPEGs can't have an alpha channel, so memory can be saved by storing them as RGB.
var isJPEG = url.search( /\.(jpg|jpeg)$/ ) > 0 || url.search( /^data\:image\/jpeg/ ) === 0;

texture.format = isJPEG ? THREE.RGBFormat : THREE.RGBAFormat;
texture.image = image;
texture.needsUpdate = true;

Expand Down Expand Up @@ -22058,7 +22094,9 @@ THREE.Texture.prototype = {

minFilter: this.minFilter,
magFilter: this.magFilter,
anisotropy: this.anisotropy
anisotropy: this.anisotropy,

flipY: this.flipY
};

if ( this.image !== undefined ) {
Expand Down Expand Up @@ -24034,7 +24072,7 @@ THREE.ShaderChunk[ 'lights_physical_fragment' ] = "PhysicalMaterial material;\nm

// File:src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl

THREE.ShaderChunk[ 'lights_physical_pars_fragment' ] = "struct PhysicalMaterial {\n vec3 diffuseColor;\n float specularRoughness;\n vec3 specularColor;\n #ifndef STANDARD\n float clearCoat;\n float clearCoatRoughness;\n #endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n reflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n reflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n #ifndef STANDARD\n reflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n #endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n #ifndef STANDARD\n reflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n #endif\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n";
THREE.ShaderChunk[ 'lights_physical_pars_fragment' ] = "struct PhysicalMaterial {\n vec3 diffuseColor;\n float specularRoughness;\n vec3 specularColor;\n #ifndef STANDARD\n float clearCoat;\n float clearCoatRoughness;\n #endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n return DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n float dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n vec3 irradiance = dotNL * directLight.color;\n #ifndef PHYSICALLY_CORRECT_LIGHTS\n irradiance *= PI;\n #endif\n #ifndef STANDARD\n float clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n #else\n float clearCoatDHR = 0.0;\n #endif\n reflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n reflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n #ifndef STANDARD\n reflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n #endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n reflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n #ifndef STANDARD\n float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n float dotNL = dotNV;\n float clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n #else\n float clearCoatDHR = 0.0;\n #endif\n reflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n #ifndef STANDARD\n reflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n #endif\n}\n#define RE_Direct RE_Direct_Physical\n#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular RE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n";

// File:src/renderers/shaders/ShaderChunk/lights_template.glsl

Expand Down Expand Up @@ -29892,8 +29930,21 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {

if ( ! customMaterial ) {

var useMorphing = geometry.morphTargets !== undefined &&
geometry.morphTargets.length > 0 && material.morphTargets;
var useMorphing = false;

if ( material.morphTargets ) {

if ( geometry instanceof THREE.BufferGeometry ) {

useMorphing = geometry.morphAttributes && geometry.morphAttributes.position && geometry.morphAttributes.position.length > 0;

} else if ( geometry instanceof THREE.Geometry ) {

useMorphing = geometry.morphTargets && geometry.morphTargets.length > 0;

}

}

var useSkinning = object instanceof THREE.SkinnedMesh && material.skinning;

Expand Down Expand Up @@ -32843,6 +32894,8 @@ THREE.SpritePlugin = function ( renderer, sprites ) {
var sprite = sprites[ i ];
var material = sprite.material;

if ( material.visible === false ) continue;

gl.uniform1f( uniforms.alphaTest, material.alphaTest );
gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite.modelViewMatrix.elements );

Expand Down Expand Up @@ -33018,7 +33071,7 @@ THREE.SpritePlugin = function ( renderer, sprites ) {
}

function painterSortStable ( a, b ) {

if ( a.renderOrder !== b.renderOrder ) {

return a.renderOrder - b.renderOrder;
Expand Down Expand Up @@ -34097,6 +34150,21 @@ THREE.ShapeUtils = {

triangulateShape: function ( contour, holes ) {

function removeDupEndPts(points) {

var l = points.length;

if ( l > 2 && points[ l - 1 ].equals( points[ 0 ] ) ) {

points.pop();

}

}

removeDupEndPts( contour );
holes.forEach( removeDupEndPts );

function point_in_segment_2D_colin( inSegPt1, inSegPt2, inOtherPt ) {

// inOtherPt needs to be collinear to the inSegment
Expand Down Expand Up @@ -35124,13 +35192,7 @@ THREE.CurvePath.prototype = Object.assign( Object.create( THREE.Curve.prototype

}

if ( points[ points.length - 1 ].equals( points[ 0 ] ) ) {

points.pop();

}

if ( this.autoClose ) {
if ( this.autoClose && points.length > 1 && !points[ points.length - 1 ].equals( points[ 0 ] ) ) {

points.push( points[ 0 ] );

Expand Down Expand Up @@ -40786,20 +40848,22 @@ THREE.FaceNormalsHelper.prototype.update = ( function () {
* @author mrdoob / http://mrdoob.com/
*/

THREE.GridHelper = function ( size, step, color1, color2 ) {
THREE.GridHelper = function ( size, divisions, color1, color2 ) {

divisions = divisions || 1;
color1 = new THREE.Color( color1 !== undefined ? color1 : 0x444444 );
color2 = new THREE.Color( color2 !== undefined ? color2 : 0x888888 );

var vertices = [];
var colors = [];
var center = divisions / 2;
var step = ( size * 2 ) / divisions;
var vertices = [], colors = [];

for ( var i = - size, j = 0; i <= size; i += step ) {
for ( var i = 0, j = 0, k = - size; i <= divisions; i ++, k += step ) {

vertices.push( - size, 0, i, size, 0, i );
vertices.push( i, 0, - size, i, 0, size );
vertices.push( - size, 0, k, size, 0, k );
vertices.push( k, 0, - size, k, 0, size );

var color = i === 0 ? color1 : color2;
var color = i === center ? color1 : color2;

color.toArray( colors, j ); j += 3;
color.toArray( colors, j ); j += 3;
Expand Down
Loading