Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
98c92701
T
three.js
项目概览
车家大少爷
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
98c92701
编写于
10月 28, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
26633fa1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
261 addition
and
220 deletion
+261
-220
build/three.js
build/three.js
+111
-71
build/three.min.js
build/three.min.js
+150
-149
未找到文件。
build/three.js
浏览文件 @
98c92701
...
...
@@ -12291,12 +12291,7 @@ THREE.AnimationClip = function ( name, duration, tracks ) {
// this means it should figure out its duration by scanning the tracks
if ( this.duration < 0 ) {
for ( var i = 0; i < this.tracks.length; i ++ ) {
var track = this.tracks[i];
this.duration = Math.max( track.times[ track.times.length - 1 ] );
}
this.resetDuration();
}
...
...
@@ -12311,6 +12306,24 @@ THREE.AnimationClip.prototype = {
constructor: THREE.AnimationClip,
resetDuration: function() {
var tracks = this.tracks,
duration = 0;
for ( var i = 0, n = tracks.length; i !== n; ++ i ) {
var track = this.tracks[ i ];
duration = Math.max(
duration, track.times[ track.times.length - 1 ] );
}
this.duration = duration;
},
trim: function() {
for ( var i = 0; i < this.tracks.length; i ++ ) {
...
...
@@ -15298,6 +15311,12 @@ THREE.PropertyBinding.prototype = {
this.resolvedProperty = nodeProperty;
} else if ( Array.isArray( nodeProperty ) ) {
bindingType = this.BindingType.EntireArray;
this.resolvedProperty = nodeProperty;
} else {
this.propertyName = propertyName;
...
...
@@ -15335,8 +15354,9 @@ Object.assign( THREE.PropertyBinding.prototype, { // prototype, continued
BindingType: {
Direct: 0,
ArrayElement: 1,
HasFromToArray: 2
EntireArray: 1,
ArrayElement: 2,
HasFromToArray: 3
},
Versioning: {
...
...
@@ -15353,6 +15373,18 @@ Object.assign( THREE.PropertyBinding.prototype, { // prototype, continued
},
function getValue_array( buffer, offset ) {
var source = this.node[ this.propertyName ];
for ( var i = 0, n = source.length; i !== n; ++ i ) {
buffer[ offset ++ ] = source[ i ];
}
},
function getValue_arrayElement( buffer, offset ) {
buffer[ offset ] = this.resolvedProperty[ this.propertyIndex ];
...
...
@@ -15392,6 +15424,50 @@ Object.assign( THREE.PropertyBinding.prototype, { // prototype, continued
}
], [
// EntireArray
function setValue_array( buffer, offset ) {
var dest = this.resolvedProperty;
for ( var i = 0, n = dest.length; i !== n; ++ i ) {
dest[ i ] = buffer[ offset ++ ];
}
},
function setValue_array_setNeedsUpdate( buffer, offset ) {
var dest = this.resolvedProperty;
for ( var i = 0, n = dest.length; i !== n; ++ i ) {
dest[ i ] = buffer[ offset ++ ];
}
this.targetObject.needsUpdate = true;
},
function setValue_array_setMatrixWorldNeedsUpdate( buffer, offset ) {
var dest = this.resolvedProperty;
for ( var i = 0, n = dest.length; i !== n; ++ i ) {
dest[ i ] = buffer[ offset ++ ];
}
this.targetObject.matrixWorldNeedsUpdate = true;
}
], [
// ArrayElement
...
...
@@ -24507,6 +24583,8 @@ THREE.WebGLRenderer = function ( parameters ) {
_lights = {
hash: '',
ambient: [ 0, 0, 0 ],
directional: [],
point: [],
...
...
@@ -24602,7 +24680,6 @@ THREE.WebGLRenderer = function ( parameters ) {
var state = new THREE.WebGLState( _gl, extensions, paramThreeToGL );
var properties = new THREE.WebGLProperties();
var materialsCache = new THREE.WebGLMaterials();
var objects = new THREE.WebGLObjects( _gl, properties, this.info );
var programCache = new THREE.WebGLPrograms( this, capabilities );
...
...
@@ -24994,7 +25071,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function releaseMaterialProgramReference( material ) {
var programInfo =
materialsCache
.get( material ).program;
var programInfo =
properties
.get( material ).program;
material.program = undefined;
...
...
@@ -25776,7 +25853,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function initMaterial( material, lights, fog, object ) {
var materialProperties =
materialsCache
.get( material );
var materialProperties =
properties
.get( material );
var parameters = programCache.getParameters( material, lights, fog, object );
var code = programCache.getProgramCode( material, parameters );
...
...
@@ -25895,6 +25972,10 @@ THREE.WebGLRenderer = function ( parameters ) {
material instanceof THREE.MeshPhysicalMaterial ||
material.lights ) {
// store the light setup it was created for
materialProperties.lightsHash = _lights.hash;
// wire up the material to this renderer's lighting state
uniforms.ambientLightColor.value = _lights.ambient;
...
...
@@ -25940,9 +26021,22 @@ THREE.WebGLRenderer = function ( parameters ) {
_usedTextureUnits = 0;
var materialProperties = materialsCache.get( material );
var materialProperties = properties.get( material );
if ( materialProperties.program === undefined ) {
material.needsUpdate = true;
}
if ( materialProperties.lightsHash !== undefined &&
materialProperties.lightsHash !== _lights.hash ) {
if ( material.needsUpdate || ! materialProperties.program ) {
material.needsUpdate = true;
}
if ( material.needsUpdate ) {
initMaterial( material, lights, fog, object );
material.needsUpdate = false;
...
...
@@ -26153,7 +26247,7 @@ THREE.WebGLRenderer = function ( parameters ) {
} else if ( material instanceof THREE.MeshPhysicalMaterial ) {
refreshUniforms
Standard
( m_uniforms, material );
refreshUniforms
Physical
( m_uniforms, material );
} else if ( material instanceof THREE.MeshDepthMaterial ) {
...
...
@@ -26372,7 +26466,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
function refreshUniforms
Standard
( uniforms, material ) {
function refreshUniforms
Physical
( uniforms, material ) {
uniforms.roughness.value = material.roughness;
//uniforms.reflectivity.value = material.reflectivity; // part of uniforms common
...
...
@@ -26963,11 +27057,6 @@ THREE.WebGLRenderer = function ( parameters ) {
viewMatrix = camera.matrixWorldInverse,
directionalCurrent = _lights.directional.length,
pointCurrent = _lights.point.length,
spotCurrent = _lights.spot.length,
hemiCurrent = _lights.hemi.length,
directionalLength = 0,
pointLength = 0,
spotLength = 0,
...
...
@@ -27090,22 +27179,13 @@ THREE.WebGLRenderer = function ( parameters ) {
_lights.ambient[ 1 ] = g;
_lights.ambient[ 2 ] = b;
// Reset materials if light setup changes
if ( directionalCurrent !== directionalLength ||
pointCurrent !== pointLength ||
spotCurrent !== spotLength ||
hemiCurrent !== hemiLength ) {
materialsCache.clear();
}
_lights.directional.length = directionalLength;
_lights.point.length = pointLength;
_lights.spot.length = spotLength;
_lights.hemi.length = hemiLength;
_lights.hash = directionalLength + ',' + pointLength + ',' + spotLength + ',' + hemiLength;
}
// GL state setting
...
...
@@ -28399,46 +28479,6 @@ THREE.WebGLGeometries = function ( gl, properties, info ) {
};
// File:src/renderers/webgl/WebGLMaterials.js
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.WebGLMaterials = function () {
var properties = {};
this.get = function ( material ) {
var uuid = material.uuid;
var map = properties[ uuid ];
if ( map === undefined ) {
map = {};
properties[ uuid ] = map;
}
return map;
};
this.delete = function ( object ) {
delete properties[ object.uuid ];
};
this.clear = function () {
properties = {};
};
};
// File:src/renderers/webgl/WebGLObjects.js
/**
...
...
build/three.min.js
浏览文件 @
98c92701
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录