Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
e423d57d
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,发现更多精彩内容 >>
提交
e423d57d
编写于
8月 07, 2015
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated builds.
上级
5750c435
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
364 addition
and
350 deletion
+364
-350
build/three.js
build/three.js
+96
-82
build/three.min.js
build/three.min.js
+268
-268
未找到文件。
build/three.js
浏览文件 @
e423d57d
...
...
@@ -8259,9 +8259,11 @@ THREE.Object3D.prototype = {
callback( this );
for ( var i = 0, l = this.children.length; i < l; i ++ ) {
var children = this.children;
for ( var i = 0, l = children.length; i < l; i ++ ) {
this.
children[ i ].traverse( callback );
children[ i ].traverse( callback );
}
...
...
@@ -8273,9 +8275,11 @@ THREE.Object3D.prototype = {
callback( this );
for ( var i = 0, l = this.children.length; i < l; i ++ ) {
var children = this.children;
for ( var i = 0, l = children.length; i < l; i ++ ) {
this.
children[ i ].traverseVisible( callback );
children[ i ].traverseVisible( callback );
}
...
...
@@ -8283,11 +8287,13 @@ THREE.Object3D.prototype = {
traverseAncestors: function ( callback ) {
if ( this.parent ) {
var parent = this.parent;
callback( this.parent );
if ( parent !== undefined ) {
this.parent.traverseAncestors( callback );
callback( parent );
parent.traverseAncestors( callback );
}
...
...
@@ -15829,6 +15835,8 @@ THREE.MeshFaceMaterial = function ( materials ) {
this.materials = materials instanceof Array ? materials : [];
this.visible = true;
};
THREE.MeshFaceMaterial.prototype = {
...
...
@@ -15854,6 +15862,8 @@ THREE.MeshFaceMaterial.prototype = {
}
output.visible = this.visible;
return output;
},
...
...
@@ -15868,6 +15878,8 @@ THREE.MeshFaceMaterial.prototype = {
}
material.visible = this.visible;
return material;
}
...
...
@@ -19850,17 +19862,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
_canvas.addEventListener( 'webglcontextlost', function ( event ) {
event.preventDefault();
resetGLState();
setDefaultGLState();
objects.clear();
properties.clear();
}, false );
_canvas.addEventListener( 'webglcontextlost', onContextLost, false );
} catch ( error ) {
...
...
@@ -20284,8 +20286,26 @@ THREE.WebGLRenderer = function ( parameters ) {
this.resetGLState = resetGLState;
this.dispose = function() {
_canvas.removeEventListener( 'webglcontextlost', onContextLost, false );
};
// Events
function onContextLost( event ) {
event.preventDefault();
resetGLState();
setDefaultGLState();
objects.clear();
properties.clear();
};
function onTextureDispose( event ) {
var texture = event.target;
...
...
@@ -20544,7 +20564,11 @@ THREE.WebGLRenderer = function ( parameters ) {
for ( var i = 0, il = materials.length; i < il; i ++ ) {
_this.renderBufferDirect( camera, lights, fog, materials[ i ], object );
material = materials[ i ];
if ( material === null || material.visible === false ) continue;
_this.renderBufferDirect( camera, lights, fog, material, object );
}
...
...
@@ -20552,8 +20576,6 @@ THREE.WebGLRenderer = function ( parameters ) {
}
if ( material.visible === false ) return;
setMaterial( material );
var geometry = objects.geometries.get( object );
...
...
@@ -21384,56 +21406,58 @@ THREE.WebGLRenderer = function ( parameters ) {
function projectObject( object ) {
if ( object.visible ===
true ) {
if ( object.visible ===
false ) return;
if ( object instanceof THREE.Scene || object instanceof THREE.Group ) {
if ( object instanceof THREE.Scene || object instanceof THREE.Group ) {
// skip
// skip
} else {
} else {
// update Skeleton objects
if ( object instanceof THREE.SkinnedMesh ) {
// update Skeleton objects
if ( object instanceof THREE.SkinnedMesh ) {
object.skeleton.update();
object.skeleton.update();
}
}
objects.init( object );
objects.init( object );
if ( object instanceof THREE.Light ) {
if ( object instanceof THREE.Light ) {
lights.push( object );
lights.push( object );
} else if ( object instanceof THREE.Sprite ) {
} else if ( object instanceof THREE.Sprite ) {
sprites.push( object );
sprites.push( object );
} else if ( object instanceof THREE.LensFlare ) {
} else if ( object instanceof THREE.LensFlare ) {
lensFlares.push( object );
lensFlares.push( object );
} else if ( object instanceof THREE.ImmediateRenderObject ) {
} else if ( object instanceof THREE.ImmediateRenderObject ) {
var material = object.material;
var material = object.material;
if ( material.transparent ) {
if ( material.transparent ) {
transparentImmediateObjects.push( object );
transparentImmediateObjects.push( object );
} else {
} else {
opaqueImmediateObjects.push( object );
opaqueImmediateObjects.push( object );
}
}
} else {
} else {
var webglObject = objects.objects[ object.id ];
var webglObject = objects.objects[ object.id ];
if ( webglObject && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
if ( webglObject && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
var material = object.material;
var material = object.material;
if ( material !== null && material.visible === true ) {
if ( properties.get( material ) ) {
...
...
@@ -21466,11 +21490,13 @@ THREE.WebGLRenderer = function ( parameters ) {
}
for ( var i = 0, l = object.children.length; i < l; i ++ ) {
}
projectObject( object.children[ i ] )
;
var children = object.children
;
}
for ( var i = 0, l = children.length; i < l; i ++ ) {
projectObject( children[ i ] );
}
...
...
@@ -24267,13 +24293,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
for ( var i = 0, ul = renderList.length; i < ul; i ++ ) {
var object = renderList[ i ].object;
if ( object.material.visible !== false ) {
updateObject( object );
}
updateObject( renderList[ i ].object );
}
...
...
@@ -25079,19 +25099,18 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
webglObject = _renderList[ j ];
object = webglObject.object;
objectMaterial = object.material;
// culling is overridden globally for all objects
// while rendering depth map
if ( objectMaterial instanceof THREE.MeshFaceMaterial ) {
// need to deal with MeshFaceMaterial somehow
// in that case just use the first of material.materials for now
// (proper solution would require to break objects by materials
// similarly to regular rendering and then set corresponding
// depth materials per each chunk instead of just once per object)
// For the moment just ignore objects that have multiple materials with different animation methods
// Only the first material will be taken into account for deciding which depth material to use for shadow maps
objectMaterial = getObjectMaterial( object )
;
objectMaterial = object.material.materials[ 0 ]
;
if ( objectMaterial.visible === false ) continue;
if ( objectMaterial === null || objectMaterial.visible === false ) continue;
}
useMorphing = object.geometry.morphTargets !== undefined && object.geometry.morphTargets.length > 0 && objectMaterial.morphTargets;
useSkinning = object instanceof THREE.SkinnedMesh && objectMaterial.skinning;
...
...
@@ -25142,35 +25161,30 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
function projectObject( object, camera ) {
if ( object.visible === true ) {
var webglObject = _objects.objects[ object.id ];
if ( object.visible === false ) return;
if ( webglObject && object.castShadow && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
var webglObject = _objects.objects[ object.id ];
object._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
_renderList.push( webglObject );
if ( webglObject && object.castShadow && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
}
var material = object.material;
for ( var i = 0, l = object.children.length; i < l; i ++
) {
if ( material !== null && material.visible === true
) {
projectObject( object.children[ i ], camera );
object._modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
_renderList.push( webglObject );
}
}
}
var children = object.children;
// For the moment just ignore objects that have multiple materials with different animation methods
// Only the first material will be taken into account for deciding which depth material to use for shadow maps
for ( var i = 0, l = children.length; i < l; i ++ ) {
function getObjectMaterial( object ) {
projectObject( children[ i ], camera );
return object.material instanceof THREE.MeshFaceMaterial
? object.material.materials[ 0 ]
: object.material;
}
}
...
...
build/three.min.js
浏览文件 @
e423d57d
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录